Esempio n. 1
0
    $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&amp;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']);
}
Esempio n. 2
0
    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') {
	clone_block_ok($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options);
}
*/
// import from modules/system/admin/blocksadmin/blocksadmin.php
function myblocksadmin_update_block($bid, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $bmodule, $options = array())
{
Esempio n. 3
0
require_once 'include/common.php';
AccessControl('4', null, false);
# null means no log, false means don't redirect
$op = empty($_GET['op']) ? 'default' : $_GET['op'];
if (isset($_GET['block_id']) && preg_match("/[0-9]*/", $_GET['block_id'])) {
    $block_id = $_GET['block_id'];
} else {
    header("HTTP/1.1 400 Bad Request");
    // Tells Ajax.InPlaceEditor that an error has occured.
    echo $COLLATE['languages']['selected']['selectblock'];
    exit;
}
switch ($op) {
    case "edit":
        edit_block();
        break;
    case "delete":
        delete_block();
        break;
}
function edit_block()
{
    global $COLLATE;
    global $block_id;
    include 'include/validation_functions.php';
    $dbo = getdbo();
    $edit = empty($_GET['edit']) ? '' : clean($_GET['edit']);
    $value = empty($_POST['value']) ? '' : clean($_POST['value']);
    $username = isset($COLLATE['user']['username']) ? $COLLATE['user']['username'] : '******';
    if ($edit == 'name') {