diff --git a/course/format/scorm/lib.php b/course/format/scorm/lib.php index 663ceea92a5..5fe471095da 100644 --- a/course/format/scorm/lib.php +++ b/course/format/scorm/lib.php @@ -33,16 +33,6 @@ function callback_scorm_definition() { return get_string('scorm'); } -/** - * The GET argument variable that is used to identify the section being - * viewed by the user (if there is one) - * - * @return string - */ -function callback_scorm_request_key() { - return 'scorm'; -} - /** * Toogle display of course contents (sections, activities) * diff --git a/course/format/social/lib.php b/course/format/social/lib.php index 7543b8eb614..6a9629d72f9 100644 --- a/course/format/social/lib.php +++ b/course/format/social/lib.php @@ -70,16 +70,6 @@ function callback_social_definition() { return get_string('topic'); } -/** - * The GET argument variable that is used to identify the section being - * viewed by the user (if there is one) - * - * @return string - */ -function callback_social_request_key() { - return 'social'; -} - /** * Toogle display of course contents (sections, activities) * diff --git a/course/format/upgrade.txt b/course/format/upgrade.txt index 7e56d033367..d4a6d7f4e7f 100644 --- a/course/format/upgrade.txt +++ b/course/format/upgrade.txt @@ -2,6 +2,11 @@ This files describes API changes for course formats Overview of this plugin type at http://docs.moodle.org/dev/Course_formats +=== 2.4 === + +* Function settings_navigation::add_course_editing_links() is completely removed, course format + functions callback_XXXX_request_key() are no longer used (where XXXX is the course format name) + === 2.3 === * The new $course->coursedisplay option was introduced, users can now choose to display diff --git a/lib/navigationlib.php b/lib/navigationlib.php index 298c26f8622..b54f6489679 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -3593,11 +3593,6 @@ class settings_navigation extends navigation_node { user_preference_allow_ajax_update('usemodchooser', PARAM_BOOL); } - if ($this->page->user_is_editing()) { - // Removed as per MDL-22732 - // $this->add_course_editing_links($course); - } - // Add the course settings link $url = new moodle_url('/course/edit.php', array('id'=>$course->id)); $coursenode->add(get_string('editsettings'), $url, self::TYPE_SETTING, null, null, new pix_icon('i/settings', '')); @@ -3738,91 +3733,6 @@ class settings_navigation extends navigation_node { return $coursenode; } - /** - * Adds branches and links to the settings navigation to add course activities - * and resources. - * - * @param stdClass $course - */ - protected function add_course_editing_links($course) { - global $CFG; - - require_once($CFG->dirroot.'/course/lib.php'); - - // Add `add` resources|activities branches - $structurefile = $CFG->dirroot.'/course/format/'.$course->format.'/lib.php'; - if (file_exists($structurefile)) { - require_once($structurefile); - $requestkey = call_user_func('callback_'.$course->format.'_request_key'); - $formatidentifier = optional_param($requestkey, 0, PARAM_INT); - } else { - $requestkey = get_string('section'); - $formatidentifier = optional_param($requestkey, 0, PARAM_INT); - } - - $modinfo = get_fast_modinfo($course); - $sections = $modinfo->get_section_info_all(); - - $addresource = $this->add(get_string('addresource')); - $addactivity = $this->add(get_string('addactivity')); - if ($formatidentifier!==0) { - $addresource->force_open(); - $addactivity->force_open(); - } - - $this->get_course_modules($course); - - foreach ($sections as $section) { - if ($formatidentifier !== 0 && $section->section != $formatidentifier) { - continue; - } - $sectionurl = new moodle_url('/course/view.php', array('id'=>$course->id, $requestkey=>$section->section)); - if ($section->section == 0) { - $sectionresources = $addresource->add(get_string('course'), $sectionurl, self::TYPE_SETTING); - $sectionactivities = $addactivity->add(get_string('course'), $sectionurl, self::TYPE_SETTING); - } else { - $sectionname = get_section_name($course, $section); - $sectionresources = $addresource->add($sectionname, $sectionurl, self::TYPE_SETTING); - $sectionactivities = $addactivity->add($sectionname, $sectionurl, self::TYPE_SETTING); - } - foreach ($resources as $value=>$resource) { - $url = new moodle_url('/course/mod.php', array('id'=>$course->id, 'sesskey'=>sesskey(), 'section'=>$section->section)); - $pos = strpos($value, '&type='); - if ($pos!==false) { - $url->param('add', textlib::substr($value, 0,$pos)); - $url->param('type', textlib::substr($value, $pos+6)); - } else { - $url->param('add', $value); - } - $sectionresources->add($resource, $url, self::TYPE_SETTING); - } - $subbranch = false; - foreach ($activities as $activityname=>$activity) { - if ($activity==='--') { - $subbranch = false; - continue; - } - if (strpos($activity, '--')===0) { - $subbranch = $sectionactivities->add(trim($activity, '-')); - continue; - } - $url = new moodle_url('/course/mod.php', array('id'=>$course->id, 'sesskey'=>sesskey(), 'section'=>$section->section)); - $pos = strpos($activityname, '&type='); - if ($pos!==false) { - $url->param('add', textlib::substr($activityname, 0,$pos)); - $url->param('type', textlib::substr($activityname, $pos+6)); - } else { - $url->param('add', $activityname); - } - if ($subbranch !== false) { - $subbranch->add($activity, $url, self::TYPE_SETTING); - } else { - $sectionactivities->add($activity, $url, self::TYPE_SETTING); - } - } - } - } - /** * This function calls the module function to inject module settings into the * settings navigation tree. diff --git a/lib/upgrade.txt b/lib/upgrade.txt index 61d350a3b6d..10c3bb14d18 100644 --- a/lib/upgrade.txt +++ b/lib/upgrade.txt @@ -6,6 +6,7 @@ information provided here is intended especially for developers. * Pagelib: Numerous deprecated functions were removed as classes page_base, page_course and page_generic_activity. * use $CFG->googlemapkey3 instead of removed $CFG->googlemapkey and migrate to Google Maps API V3 +* Function settings_navigation::add_course_editing_links() is completely removed YUI changes: * moodle-enrol-notification has been renamed to moodle-core-notification