コード例 #1
0
function removeFrontPage(&$cid, $option)
{
    global $database;
    josSpoofCheck();
    if (!is_array($cid) || count($cid) < 1) {
        echo "<script> alert('Select an item to delete'); window.history.go(-1);</script>\n";
        exit;
    }
    $fp = new mosFrontPage($database);
    foreach ($cid as $id) {
        if (!$fp->delete((int) $id)) {
            echo "<script> alert('" . $fp->getError() . "'); </script>\n";
            exit;
        }
        $obj = new mosContent($database);
        $obj->load((int) $id);
        $obj->mask = 0;
        if (!$obj->store()) {
            echo "<script> alert('" . $fp->getError() . "'); </script>\n";
            exit;
        }
    }
    $fp->updateOrder();
    // clean any existing cache files
    mosCache::cleanCache('com_content');
    mosRedirect("index2.php?option={$option}");
}
コード例 #2
0
ファイル: admin.frontpage.php プロジェクト: cwcw/cms
function removeFrontPage(&$cid, $option)
{
    global $database, $adminLanguage;
    if (!is_array($cid) || count($cid) < 1) {
        echo "<script> alert(\"" . $adminLanguage->A_COMP_CONTENT_SEL_DEL . "\"); window.history.go(-1);</script>\n";
        exit;
    }
    $fp = new mosFrontPage($database);
    foreach ($cid as $id) {
        if (!$fp->delete($id)) {
            echo "<script> alert('" . $fp->getError() . "'); </script>\n";
            exit;
        }
        $obj = new mosContent($database);
        $obj->load($id);
        $obj->mask = 0;
        if (!$obj->store()) {
            echo "<script> alert('" . $fp->getError() . "'); </script>\n";
            exit;
        }
    }
    $fp->updateOrder();
    mosRedirect("index2.php?option={$option}");
}