Esempio n. 1
0
         $BlogCache =& get_BlogCache();
         $blog_names = array();
         foreach ($default_ids as $blog_ID => $item_type_ID) {
             if ($edited_Itemtype->ID == $item_type_ID && ($Blog =& $BlogCache->get_by_ID($blog_ID, false, false))) {
                 $blog_names[] = '<a href="' . $admin_url . '?ctrl=coll_settings&tab=features&blog=' . $Blog->ID . '#fieldset_wrapper_post_options"><b>' . $Blog->get('name') . '</b></a>';
             }
         }
         $Messages->add(sprintf(T_('This Item type is the default for the collections: %s. You can not delete this Item type.'), implode(', ', $blog_names)));
     }
     // To don't display a confirmation question
     $action = 'edit';
 } else {
     // ID is good
     if (param('confirm', 'integer', 0)) {
         // confirmed, Delete from DB:
         $msg = sprintf(T_('Post type &laquo;%s&raquo; deleted.'), $edited_Itemtype->dget('name'));
         $edited_Itemtype->dbdelete();
         unset($edited_Itemtype);
         forget_param('ityp_ID');
         $Messages->add($msg, 'success');
         // Redirect so that a reload doesn't write to the DB twice:
         header_redirect($admin_url . '?ctrl=itemtypes&blog=' . $blog . '&tab=' . $tab . '&tab3=' . $tab3 . '', 303);
         // Will EXIT
         // We have EXITed already at this point!!
     } else {
         // not confirmed, Check for restrictions:
         if (!$edited_Itemtype->check_delete(sprintf(T_('Cannot delete Post Type &laquo;%s&raquo;'), $edited_Itemtype->dget('name')))) {
             // There are restrictions:
             $action = 'view';
         }
     }