$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") { xoops_cp_header(); edit_block($bid); xoops_cp_footer(); exit; } /* if ($op == 'clone') { clone_block($bid); } if ($op == 'clone_ok') {
} else { response(sprintf(__('The block "%s" was deleted successfully!', 'rmcommon'), $block->getVar('name')), array(), 0, 1); } } $action = rmc_server_var($_POST, 'action', ''); switch ($action) { case 'insert': insert_block(); break; case 'settings': configure_block(); break; case 'saveconfig': save_block_config(); break; case 'savepos': save_block_position(); break; case 'save-orders': save_block_order(); break; case 'show-block': change_block_visibility(1); break; case 'hide-block': change_block_visibility(0); break; case 'delete-block': delete_block(); break; }
$bmodule = isset($bmodule) ? $bmodule : array(); $groups = isset($groups) ? $groups : array(); if (save_block($instanceid, $bside, $bvisible, $bweight, $btitle, $bid, $bcachetime, $bmodule, $groups, $options)) { redirect_header("admin.php?fct=blocksadmin&selmod=" . $_REQUEST["selmod"], 2, _MD_AM_DBUPDATED); } redirect_header("admin.php?fct=blocksadmin&selmod=" . $_REQUEST["selmod"], 2, _AM_ERRORDURINGSAVE); exit; } if ($op == "delete_ok") { if (!$GLOBALS['xoopsSecurity']->check()) { redirect_header("admin.php?fct=blocksadmin&selmod=" . $_REQUEST["selmod"], 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors())); exit; } delete_block_ok($bid); exit; } if ($op == "delete") { xoops_cp_header(); delete_block($_REQUEST['id']); xoops_cp_footer(); exit; } if ($op == "edit") { xoops_cp_header(); edit_block($_REQUEST['id']); xoops_cp_footer(); exit; } if ($op == 'new') { instantiate_block($_REQUEST['bid']); }
<?php require_once $_SERVER["DOCUMENT_ROOT"] . "/../includes/base.php"; $id = isset($_POST["id"]) ? $_POST["id"] : null; if ($id === null) { http_response_code(404); header("Location: /error/404/not-found"); } if (is_manager()) { if (delete_block($id)) { echo "success"; } else { echo "failed"; } } else { http_response_code(404); header("Location: /error/404/not-found"); }