MDL-32508 course formats: Remove key callback
authorDan Poltawski <dan@moodle.com>
Thu, 26 Apr 2012 13:53:25 +0000 (21:53 +0800)
committerDan Poltawski <dan@moodle.com>
Fri, 4 May 2012 02:52:59 +0000 (10:52 +0800)
This was used by course formats but now there is a standardised
'section' param

course/format/topics/lib.php
course/format/weeks/lib.php
lib/navigationlib.php

index dddbcf7..18688ea 100644 (file)
@@ -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)) {
index 9524587..3c36383 100644 (file)
@@ -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.
  *
index d4e03e8..f0eb367 100644 (file)
@@ -1766,10 +1766,9 @@ class global_navigation extends 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();