Permalink
Browse files

MDL-32508 course formats: Remove key callback

This was used by course formats but now there is a standardised
'section' param
  • Loading branch information...
danpoltawski committed Apr 26, 2012
1 parent 5218b9b commit f755868314e6acdad75af4552f816c974a443938
Showing with 2 additions and 23 deletions.
  1. +0 −10 course/format/topics/lib.php
  2. +0 −10 course/format/weeks/lib.php
  3. +2 −3 lib/navigationlib.php
@@ -57,16 +57,6 @@ function callback_topics_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_topics_request_key() {
return 'topic';
}
function callback_topics_get_section_name($course, $section) {
// We can't add a node without any text
if (!empty($section->name)) {
@@ -57,16 +57,6 @@ function callback_weeks_definition() {
return get_string('week');
}
/**
* The GET argument variable that is used to identify the section being
* viewed by the user (if there is one)
*
* @return string
*/
function callback_weeks_request_key() {
return 'week';
}
/**
* Gets the name for the provided section.
*
View
@@ -1766,10 +1766,9 @@ public function load_generic_course_sections(stdClass $course, navigation_node $
$urlfunction = null;
}
$keyfunction = 'callback_'.$courseformat.'_request_key';
$key = 0;
if (defined('AJAX_SCRIPT') && AJAX_SCRIPT == '0' && function_exists($keyfunction) && $this->page->url->compare(new moodle_url('/course/view.php'), URL_MATCH_BASE)) {
$key = optional_param($keyfunction(), $key, PARAM_INT);
if (defined('AJAX_SCRIPT') && AJAX_SCRIPT == '0' && $this->page->url->compare(new moodle_url('/course/view.php'), URL_MATCH_BASE)) {
$key = optional_param('section', $key, PARAM_INT);
}
$navigationsections = array();

0 comments on commit f755868

Please sign in to comment.