Exemplo n.º 1
0
        $bid = isset($_GET['bid']) ? intval($_GET['bid']) : 0;
    }
}
$_REQUEST["selmod"] = empty($_REQUEST["selmod"]) ? 0 : intval($_REQUEST["selmod"]);
if ($op == "list") {
    xoops_cp_header();
    list_blocks();
    xoops_cp_footer();
    exit;
}
if ($op == "order") {
    if (!$GLOBALS['xoopsSecurity']->check()) {
        redirect_header("admin.php?fct=blocksadmin&amp;selmod=" . $_REQUEST["selmod"], 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
        exit;
    }
    if (order_block($id, $weight, $side, $module)) {
        redirect_header("admin.php?fct=blocksadmin&amp;selmod=" . $_REQUEST["selmod"], 2, _MD_AM_DBUPDATED);
    }
    redirect_header("admin.php?fct=blocksadmin&amp;selmod=" . $_REQUEST["selmod"], 2, _AM_ERRORDURINGSAVE);
    exit;
}
if ($op == "save") {
    if (!$GLOBALS['xoopsSecurity']->check()) {
        redirect_header("admin.php?fct=blocksadmin&amp;selmod=" . $_REQUEST["selmod"], 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
        exit;
    }
    if (!isset($instanceid)) {
        $instanceid = 0;
    }
    $options = isset($options) ? $options : array();
    $bmodule = isset($bmodule) ? $bmodule : array();
Exemplo n.º 2
0
    </script>';
    exit;
}
if ($op == "list") {
    require_once XOOPS_ROOT_PATH . "/modules/system/admin/blocksadmin/blocksadmin.php";
    xoops_cp_header();
    list_blocks();
    xoops_cp_footer();
    exit;
}
if ($op == "order") {
    if (is_array($_POST['bid'])) {
        require_once XOOPS_ROOT_PATH . "/modules/system/admin/blocksadmin/blocksadmin.php";
        foreach (array_keys($_POST['bid']) as $i) {
            if ($_POST['oldweight'][$i] != $_POST['weight'][$i] || $_POST['oldvisible'][$i] != $_POST['visible'][$i] || $_POST['oldside'][$i] != $_POST['side'][$i]) {
                order_block($_POST['bid'][$i], $_POST['weight'][$i], $_POST['visible'][$i], $_POST['side'][$i]);
            }
        }
    }
    redirect_header("admin.php?fct=blocksadmin", 1, _AM_DBUPDATED);
    exit;
}
if ($op == "save") {
    if (empty($_POST['bmodule']) || !XoopsMultiTokenHandler::quickValidate('block')) {
        xoops_cp_header();
        xoops_error(sprintf(_AM_NOTSELNG, _AM_VISIBLEIN));
        xoops_cp_footer();
        exit;
    }
    $myblock = new XoopsBlock();
    $myblock->setVar('side', $_POST['bside']);
Exemplo n.º 3
0
            if (is_array(${$each}[$i])) {
                if (count(${$each}[$i]) != count(${'old' . $each}[$i])) {
                    $isChange = 1;
                } else {
                    if (array_diff(${$each}[$i], ${'old' . $each}[$i])) {
                        $isChange = 1;
                    }
                }
            } else {
                if (trim(${'old' . $each}[$i]) != trim(${$each}[$i])) {
                    $isChange = 1;
                }
            }
        }
        if ($isChange == 1) {
            order_block($bid[$i], $weight[$i], $visible[$i], $side[$i], $title[$i], $bmodule[$i], $bcachetime[$i]);
        }
    }
    redirect_header("admin.php?fct=blocksadmin", 1, _AM_DBUPDATED);
    exit;
}
if ($op == "save") {
    if (!$GLOBALS['xoopsSecurity']->check()) {
        redirect_header("admin.php?fct=blocksadmin", 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
        exit;
    }
    $bgroups = isset($bgroups) ? $bgroups : array();
    save_block($bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bmodule, $bcachetime, $bgroups);
    exit;
}
if ($op == "update") {
Exemplo n.º 4
0
    exit;
}
if ($op == "list") {
    xoops_cp_header();
    list_blocks();
    xoops_cp_footer();
    exit;
}
if ($op == "order") {
    if (!$GLOBALS['xoopsSecurity']->check()) {
        redirect_header("admin.php?fct=blocksadmin", 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
        exit;
    }
    foreach (array_keys($bid) as $i) {
        if ($oldweight[$i] != $weight[$i] || $oldvisible[$i] != $visible[$i] || $oldside[$i] != $side[$i]) {
            order_block($bid[$i], $weight[$i], $visible[$i], $side[$i]);
        }
    }
    redirect_header("admin.php?fct=blocksadmin", 1, _AM_DBUPDATED);
    exit;
}
if ($op == "save") {
    if (!$GLOBALS['xoopsSecurity']->check()) {
        redirect_header("admin.php?fct=blocksadmin", 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
        exit;
    }
    save_block($bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bmodule, $bcachetime);
    exit;
}
if ($op == "update") {
    if (!$GLOBALS['xoopsSecurity']->check()) {