Example #1
0
        $formHash['delete'] = TRUE;
        $formHash['batch_submit'] = 'remove_pages';
        foreach ($_REQUEST["checked"] as $del) {
            $tmpPage = new BitPage($del);
            if ($tmpPage->load() && !empty($tmpPage->mInfo['title'])) {
                $info = $tmpPage->mInfo['title'];
            } else {
                $info = $del;
            }
            $formHash['input'][] = '<input type="hidden" name="checked[]" value="' . $del . '"/>' . $info;
        }
        $gBitSystem->confirmDialog($formHash, array('warning' => tra('Are you sure you want to delete these pages?') . ' (' . tra('Count: ') . count($_REQUEST["checked"]) . ')', 'error' => tra('This cannot be undone!')));
    } else {
        foreach ($_REQUEST["checked"] as $deletepage) {
            $tmpPage = new BitPage($deletepage);
            if (!$tmpPage->load() || !$tmpPage->expunge()) {
                array_merge($errors, array_values($tmpPage->mErrors));
            }
        }
        if (!empty($errors)) {
            $gBitSmarty->assignByRef('errors', $errors);
        }
    }
}
$gBitSmarty->assignByRef("gContent", $gContent);
if (!empty($_REQUEST['sort_mode'])) {
    $listHash['sort_mode'] = preg_replace('/^user_/', 'creator_user_', $_REQUEST['sort_mode']);
}
$listHash = $_REQUEST;
$listHash['extras'] = TRUE;
$listpages = $gContent->getList($listHash);