示例#1
0
文件: admin.trash.php 项目: cwcw/cms
/**
* Permanently deletes the selected list of trash items
*/
function deleteTrash($cid, $option)
{
    global $database, $mainframe, $adminLanguage;
    $type = mosGetParam($_POST, 'type', array(0));
    $total = count($cid);
    if ($type == "content") {
        $obj = new mosContent($database);
        $fp = new mosFrontPage($database);
        foreach ($cid as $id) {
            $id = intval($id);
            $obj->delete($id);
            $fp->delete($id);
        }
    } else {
        if ($type == "menu") {
            $obj = new mosMenu($database);
            foreach ($cid as $id) {
                $id = intval($id);
                $obj->delete($id);
            }
        }
    }
    $msg = $total . " " . $adminLanguage->A_COMP_TRASH_SUCCESS_DEL;
    mosRedirect("index2.php?option={$option}&mosmsg=" . $msg . "");
}
示例#2
0
/**
* Permanently deletes the selected list of trash items
*/
function deleteTrash($cid, $option)
{
    global $database;
    josSpoofCheck();
    $type = mosGetParam($_POST, 'type', array(0));
    $total = count($cid);
    if ($type == 'content') {
        $obj = new mosContent($database);
        $fp = new mosFrontPage($database);
        foreach ($cid as $id) {
            $id = intval($id);
            $obj->delete($id);
            $fp->delete($id);
        }
    } else {
        if ($type == 'menu') {
            $obj = new mosMenu($database);
            foreach ($cid as $id) {
                $id = intval($id);
                $obj->delete($id);
            }
        }
    }
    $msg = $total . " Iten(s) apagados com sucesso!";
    mosRedirect("index2.php?option={$option}&mosmsg=" . $msg . "");
}
示例#3
0
/**
* Permanently deletes the selected list of trash items
*/
function deleteTrash($cid, $option)
{
    global $database, $mainframe;
    $type = mosGetParam($_POST, 'type', array(0));
    $total = count($cid);
    if ($type == "content") {
        $obj = new mosContent($database);
        $fp = new mosFrontPage($database);
        foreach ($cid as $id) {
            $id = intval($id);
            $obj->delete($id);
            $fp->delete($id);
        }
    } else {
        if ($type == "menu") {
            $obj = new mosMenu($database);
            foreach ($cid as $id) {
                $id = intval($id);
                $obj->delete($id);
            }
        }
    }
    $msg = sprintf(Tn_('%s Item successfully Deleted', '%s Items successfully Deleted', $total), $total);
    mosRedirect("index2.php?option={$option}&mosmsg=" . $msg . "");
}