芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/public_html/cepali/blocks/admin_bookmarks/delete.php
. /** * Delete admin bookmarks. * * @package block_admin_bookmarks * @copyright 2006 vinkmar * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require('../../config.php'); require_once($CFG->libdir.'/adminlib.php'); require_login(); $context = context_system::instance(); $PAGE->set_context($context); $adminroot = admin_get_root(false, false); // settings not required - only pages if ($section = optional_param('section', '', PARAM_SAFEDIR) and confirm_sesskey()) { if (get_user_preferences('admin_bookmarks')) { $bookmarks = explode(',', get_user_preferences('admin_bookmarks')); $key = array_search($section, $bookmarks); if ($key === false) { print_error('nonexistentbookmark','admin'); die; } unset($bookmarks[$key]); $bookmarks = implode(',', $bookmarks); set_user_preference('admin_bookmarks', $bookmarks); $temp = $adminroot->locate($section); if ($temp instanceof admin_externalpage) { redirect($temp->url, get_string('bookmarkdeleted','admin')); } elseif ($temp instanceof admin_settingpage) { redirect($CFG->wwwroot . '/' . $CFG->admin . '/settings.php?section=' . $section); } else if ($temp instanceof admin_category) { redirect($CFG->wwwroot . '/' . $CFG->admin . '/category.php?category=' . $section); } else { redirect($CFG->wwwroot); } die; } print_error('nobookmarksforuser','admin'); die; } else { print_error('invalidsection', 'admin'); die; }