require_once WIKI_PKG_PATH . 'BitPage.php'; // verify stuff $gBitSystem->verifyPackage('wiki'); $gBitSystem->verifyPermission('p_wiki_list_pages'); $gContent = new BitPage(); $gContent->invokeServices('content_list_function', $_REQUEST); /* mass-remove: the checkboxes are sent as the array $_REQUEST["checked[]"], values are the wiki-PageNames, e.g. $_REQUEST["checked"][3]="HomePage" $_REQUEST["batch_submit"] holds the value of the "with selected do..."-option list we look if any page's checkbox is on and if remove_pages is selected. then we check permission to delete pages. if so, we call BitPage::expunge for all the checked pages. */ if (isset($_REQUEST["batch_submit"]) && isset($_REQUEST["checked"]) && $_REQUEST["batch_submit"] == "remove_pages") { // Now check permissions to remove the selected pages $gContent->verifyUserPermission('p_wiki_remove_page'); if (!empty($_REQUEST['cancel'])) { // user cancelled - just continue on, doing nothing } elseif (empty($_REQUEST['confirm'])) { $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!')));