if ( !empty($_POST['bweight']) ) { $bweight = intval($_POST['bweight']); } else { $bweight = 0; } if ( !empty($_POST['bvisible']) ) { $bvisible = intval($_POST['bvisible']); } else { $bvisible = 0; } if ( !empty($_POST['btitle']) ) { $btitle = $_POST['btitle']; } else { $btitle = ""; } if ( !empty($_POST['bcontent']) ) { $bcontent = $_POST['bcontent']; } else { $bcontent = ""; } if ( !empty($_POST['bctype']) ) { $bctype = $_POST['bctype']; } else { $bctype = ""; } if ( !empty($_POST['bcachetime']) ) { $bcachetime = intval($_POST['bcachetime']); } else { $bcachetime = 0; } if ( !empty($_POST['bmodule']) ) { $bmodule = $_POST['bmodule']; } else { $bmodule = array(); } if ( !empty($_POST['options']) ) { $options = $_POST['options']; } else { $options = array(); } update_block($bid, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $bmodule, $options);*/ $bcachetime = isset($_POST['bcachetime']) ? intval($_POST['bcachetime']) : 0; $options = isset($_POST['options']) ? $_POST['options'] : array(); $bcontent = isset($_POST['bcontent']) ? $_POST['bcontent'] : ''; $bctype = isset($_POST['bctype']) ? $_POST['bctype'] : ''; $bmodule = isset($_POST['bmodule']) && is_array($_POST['bmodule']) ? $_POST['bmodule'] : array(-1); // GIJ + $msg = myblocksadmin_update_block($_POST['bid'], $_POST['bside'], $_POST['bweight'], $_POST['bvisible'], $_POST['btitle'], $bcontent, $bctype, $bcachetime, $bmodule, $options); // GIJ ! redirect_header('myblocksadmin.php', 1, $msg); } if ($op == 'delete_ok') { //if ( !admin_refcheck("/modules/$admin_mydirname/admin/") ) { // exit('Invalid Referer'); //} if (!$xoopsGTicket->check(true, 'myblocksadmin')) { redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors()); } // delete_block_ok($bid); GIJ imported from blocksadmin.php $myblock = new XoopsBlock($bid); if ($myblock->getVar('block_type') != 'D' && $myblock->getVar('block_type') != 'C') { redirect_header('myblocksadmin.php', 4, 'Invalid block'); exit;
// redirect_header("admin.php?fct=blocksadmin",1,_AM_DBUPDATED); GIJ redirect_header("myblocksadmin.php", 1, _AM_DBUPDATED); exit; } if ($op == "save") { save_block($bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bmodule, $bcachetime); exit; } if ($op == "update") { $bcachetime = isset($bcachetime) ? intval($bcachetime) : 0; $options = isset($options) ? $options : array(); $bcontent = isset($bcontent) ? $bcontent : ''; $bctype = isset($bctype) ? $bctype : ''; $bmodule = isset($bmodule) && is_array($bmodule) ? $bmodule : array(-1); // GIJ + $msg = myblocksadmin_update_block($bid, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $bmodule, $options); // GIJ c redirect_header('myblocksadmin.php', 1, $msg); // GIJ + } if ($op == "delete_ok") { delete_block_ok($bid); exit; } if ($op == "delete") { xoops_cp_header(); delete_block($bid); xoops_cp_footer(); exit; } if ($op == "edit") {
if ($op == "list") { xoops_cp_header(); list_blocks(); xoops_cp_footer(); exit; } if ($op == "order") { foreach (array_keys($bid) as $i) { if ($side[$i] < 0) { $visible[$i] = 0; $side[$i] = -1; } else { $visible[$i] = 1; } $bmodule[$i] = isset($bmodule[$i]) && is_array($bmodule[$i]) ? $bmodule[$i] : array(-1); myblocksadmin_update_block($i, $side[$i], $weight[$i], $visible[$i], $title[$i], '', '', $bcachetime[$i], $bmodule[$i], array()); // if ( $oldweight[$i] != $weight[$i] || $oldvisible[$i] != $visible[$i] || $oldside[$i] != $side[$i] ) // order_block($bid[$i], $weight[$i], $visible[$i], $side[$i]); GIJ } // redirect_header("admin.php?fct=blocksadmin",1,_AM_DBUPDATED); GIJ redirect_header("myblocksadmin.php", 1, _AM_DBUPDATED); exit; } if ($op == "save") { save_block($bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bmodule, $bcachetime); exit; } if ($op == "update") { $bcachetime = isset($bcachetime) ? intval($bcachetime) : 0; if (empty($options)) { $options = array();