diff --git a/course/delete_category_form.php b/course/delete_category_form.php deleted file mode 100644 index fa694f4f5ac..00000000000 --- a/course/delete_category_form.php +++ /dev/null @@ -1,48 +0,0 @@ -. - - -/** - * Delete category form. - * - * This file has been deprecated since 2.6. - * The class delete_category_form has been renamed to core_course_deletecategory_form and is now autloaded. - * Please update your code to use that new class. - * - * @deprecated since 2.6 - * @package core_course - * @copyright 2002 onwards Martin Dougiamas (http://dougiamas.com) - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ - -defined('MOODLE_INTERNAL') || die; - -/** - * Class delete_category_form - * - * The class delete_category_form has been renamed to core_course_deletecategory_form and is now autloaded. - * Please update your code to use that new class. - * - * @deprecated since 2.6 - * @todo remove in 2.7 MDL-41502 - * @package core_course - * @copyright 2002 onwards Martin Dougiamas (http://dougiamas.com) - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ -class delete_category_form extends core_course_deletecategory_form { - // Nothing to do here. -} - diff --git a/course/editcategory_form.php b/course/editcategory_form.php deleted file mode 100644 index ebff691654d..00000000000 --- a/course/editcategory_form.php +++ /dev/null @@ -1,66 +0,0 @@ -. - -/** - * Edit category form. - * - * This file and class have been deprecated, the form has been renamed to core_course_editcategory_form and is not autoloaded when - * first used. Please update your code to use this new form. - * - * @deprecated since 2.6 - * @todo remove in 2.7 MDL-41502 - * - * @package core_course - * @copyright 2002 onwards Martin Dougiamas (http://dougiamas.com) - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ - -defined('MOODLE_INTERNAL') || die; - -debugging('Please update your code to use core_course_editcategory_form (autloaded). This file will be removed in 2.7'); - -/** - * Class editcategory_form. - * - * This file and class have been deprecated, the form has been renamed to core_course_editcategory_form and is not autoloaded when - * first used. Please update your code to use this new form. - * - * @deprecated since 2.6 - * @todo remove in 2.7 MDL-41502 - * @package core_course - * @copyright 2002 onwards Martin Dougiamas (http://dougiamas.com) - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ -class editcategory_form extends core_course_editcategory_form { - - /** - * Constructs the form. - * @param null $action - * @param null $customdata - * @param string $method - * @param string $target - * @param null $attributes - * @param bool $editable - */ - public function __construct($action = null, $customdata = null, $method = 'post', $target = '', $attributes = null, - $editable = true) { - $customdata['categoryid'] = $customdata['category']->id; - $customdata['parent'] = $customdata['category']->parent; - unset($customdata['category']); - parent::moodleform($action, $customdata, $method, $target, $attributes, $editable); - } - -}; \ No newline at end of file diff --git a/course/manage.php b/course/manage.php deleted file mode 100644 index 8670abdca21..00000000000 --- a/course/manage.php +++ /dev/null @@ -1,158 +0,0 @@ -. - -/** - * Allows the admin to create, delete and rename course categories rearrange courses - * - * This script has been deprecated since Moodle 2.6. - * Please update your links as - * - * @deprecated - * @todo remove in 2.7 MDL-41502 - * @package core_course - * @copyright 2013 Marina Glancy - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ - -require_once("../config.php"); -require_once($CFG->dirroot.'/course/lib.php'); -require_once($CFG->libdir.'/coursecatlib.php'); - -$id = optional_param('categoryid', 0, PARAM_INT); // Category id. -$page = optional_param('page', 0, PARAM_INT); // Which page to show. -$perpage = optional_param('perpage', $CFG->coursesperpage, PARAM_INT); // How many per page. -$search = optional_param('search', '', PARAM_RAW); // Search words. -$blocklist = optional_param('blocklist', 0, PARAM_INT); -$modulelist = optional_param('modulelist', '', PARAM_PLUGIN); - -debugging('This script has been deprecated and will be removed in the future. Please update any bookmarks you have.', - DEBUG_DEVELOPER); - -// Look for legacy actions. -// If there are any we're going to make and equivalent request to management.php. -$sesskey = optional_param('sesskey', null, PARAM_RAW); -if ($sesskey !== null && confirm_sesskey($sesskey)) { - // Actions to manage categories. - $deletecat = optional_param('deletecat', 0, PARAM_INT); - $hidecat = optional_param('hidecat', 0, PARAM_INT); - $showcat = optional_param('showcat', 0, PARAM_INT); - $movecat = optional_param('movecat', 0, PARAM_INT); - $movetocat = optional_param('movetocat', -1, PARAM_INT); - $moveupcat = optional_param('moveupcat', 0, PARAM_INT); - $movedowncat = optional_param('movedowncat', 0, PARAM_INT); - - // Actions to manage courses. - $hide = optional_param('hide', 0, PARAM_INT); - $show = optional_param('show', 0, PARAM_INT); - $moveup = optional_param('moveup', 0, PARAM_INT); - $movedown = optional_param('movedown', 0, PARAM_INT); - $moveto = optional_param('moveto', 0, PARAM_INT); - $resort = optional_param('resort', 0, PARAM_BOOL); - - $murl = new moodle_url('/course/management.php', array('sesskey' => sesskey())); - - // Process any category actions. - if (!empty($deletecat)) { - // Redirect to the new management script. - redirect(new moodle_url($murl, array('categoryid' => $deletecat, 'action' => 'deletecategory'))); - } - - if (!empty($movecat) and $movetocat >= 0) { - // Redirect to the new management script. - redirect(new moodle_url($murl, array( - 'action' => 'bulkaction', - 'bulkmovecategories' => true, - 'movecategoriesto' => $movetocat, - 'bcat[]' => $movecat - ))); - } - - // Hide or show a category. - if ($hidecat) { - // Redirect to the new management script. - redirect(new moodle_url($murl, array('categoryid' => $hidecat, 'action' => 'hidecategory'))); - } else if ($showcat) { - // Redirect to the new management script. - redirect(new moodle_url($murl, array('categoryid' => $showcat, 'action' => 'showcategory'))); - } - - if (!empty($moveupcat) or !empty($movedowncat)) { - // Redirect to the new management script. - if (!empty($moveupcat)) { - redirect(new moodle_url($murl, array('categoryid' => $moveupcat, 'action' => 'movecategoryup'))); - } else { - redirect(new moodle_url($murl, array('categoryid' => $movedowncat, 'action' => 'movecategorydown'))); - } - } - - if ($resort && $id) { - // Redirect to the new management script. - redirect(new moodle_url($murl, array('categoryid' => $id, 'action' => 'resortcategories', 'resort' => 'name'))); - } - - if (!empty($moveto) && ($data = data_submitted())) { - // Redirect to the new management script. - $courses = array(); - foreach ($data as $key => $value) { - if (preg_match('/^c\d+$/', $key)) { - $courses[] = substr($key, 1); - } - } - redirect(new moodle_url($murl, array( - 'action' => 'bulkaction', - 'bulkmovecourses' => true, - 'movecoursesto' => $moveto, - 'bc' => $courses - ))); - } - - if (!empty($hide) or !empty($show)) { - // Redirect to the new management script. - if (!empty($hide)) { - redirect(new moodle_url($murl, array('courseid' => $hide, 'action' => 'hidecourse'))); - } else { - redirect(new moodle_url($murl, array('courseid' => $show, 'action' => 'showcourse'))); - } - } - - if (!empty($moveup) or !empty($movedown)) { - // Redirect to the new management script. - if (!empty($moveup)) { - redirect(new moodle_url($murl, array('courseid' => $moveup, 'action' => 'movecourseup'))); - } else { - redirect(new moodle_url($murl, array('courseid' => $movedown, 'action' => 'movecoursedown'))); - } - } -} - -// Now check if its a search or not. If its not we'll head to the new management page. -$url = new moodle_url('/course/management.php'); -if ($id !== 0) { - // We've got an ID it can't be a search. - $url->param('categoryid', $id); -} else { - // No $id, perhaps its a search. - if ($search !== '') { - $url->param('search', $search); - } - if ($blocklist !== 0) { - $url->param('blocklist', $blocklist); - } - if ($modulelist !== '') { - $url->param('modulelist', $modulelist); - } -} -redirect($url); diff --git a/course/management.php b/course/management.php index ecdee05bce3..67b2329788d 100644 --- a/course/management.php +++ b/course/management.php @@ -235,7 +235,6 @@ if ($action !== false && confirm_sesskey()) { if (!$category->can_delete()) { throw new moodle_exception('permissiondenied', 'error', '', null, 'coursecat::can_resort'); } - require_once($CFG->dirroot.'/course/delete_category_form.php'); $mform = new core_course_deletecategory_form(null, $category); if ($mform->is_cancelled()) { redirect($PAGE->url);