Skip to content

Commit

Permalink
MDL-32508 course formats: Remove key callback
Browse files Browse the repository at this point in the history
This was used by course formats but now there is a standardised
'section' param
  • Loading branch information
danpoltawski committed May 4, 2012
1 parent 5218b9b commit f755868
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.
10 changes: 0 additions & 10 deletions course/format/topics/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
10 changes: 0 additions & 10 deletions course/format/weeks/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
5 changes: 2 additions & 3 deletions lib/navigationlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit f755868

Please sign in to comment.