Beispiel #1
0
 function delete_block($bid)
 {
     $myblock = new XoopsBlock($bid);
     if ($myblock->getVar('block_type') == 'S') {
         $message = _AM_SYSTEMCANT;
         redirect_header('admin.php?fct=blocksadmin', 4, $message);
         exit;
     } elseif ($myblock->getVar('block_type') == 'M') {
         // Fix for duplicated blocks created in 2.0.9 module update
         // A module block can be deleted if there is more than 1 that
         // has the same func_num/show_func which is mostly likely
         // be the one that was duplicated in 2.0.9
         if (1 >= ($count = XoopsBlock::countSimilarBlocks($myblock->getVar('mid'), $myblock->getVar('func_num'), $myblock->getVar('show_func')))) {
             $message = _AM_MODULECANT;
             redirect_header('admin.php?fct=blocksadmin', 4, $message);
             exit;
         }
     }
     xoops_token_confirm(array('fct' => 'blocksadmin', 'op' => 'delete_ok', 'bid' => $myblock->getVar('bid')), 'admin.php', sprintf(_AM_RUSUREDEL, $myblock->getVar('title')));
 }