Trivial rename of the active method selector param
authorDavid Mudrak <david@moodle.com>
Tue, 18 Oct 2011 14:39:54 +0000 (16:39 +0200)
committerDavid Mudrak <david@moodle.com>
Tue, 18 Oct 2011 14:39:54 +0000 (16:39 +0200)
grade/grading/manage.php
grade/grading/renderer.php

index ec29d9f..1fff61c 100644 (file)
 require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
 require_once($CFG->dirroot.'/grade/grading/lib.php');
 
-$areaid         = optional_param('areaid', null, PARAM_INT);
-$contextid      = optional_param('contextid', null, PARAM_INT);
-$component      = optional_param('component', null, PARAM_COMPONENT);
-$area           = optional_param('area', null, PARAM_AREA);
-$returnurl      = optional_param('returnurl', null, PARAM_LOCALURL);
-$activemethod   = optional_param('activemethod', null, PARAM_PLUGIN);
+$areaid     = optional_param('areaid', null, PARAM_INT);
+$contextid  = optional_param('contextid', null, PARAM_INT);
+$component  = optional_param('component', null, PARAM_COMPONENT);
+$area       = optional_param('area', null, PARAM_AREA);
+$returnurl  = optional_param('returnurl', null, PARAM_LOCALURL);
+$setmethod  = optional_param('setmethod', null, PARAM_PLUGIN);
 
 if (!is_null($areaid)) {
     // get manager by id
@@ -65,13 +65,13 @@ $PAGE->set_heading(get_string('gradingmanagement', 'core_grading'));
 $output = $PAGE->get_renderer('core_grading');
 
 // process the eventual change of the active grading method
-if (!empty($activemethod)) {
+if (!empty($setmethod)) {
     require_sesskey();
-    if ($activemethod == 'none') {
+    if ($setmethod == 'none') {
         // here we expect that noone would actually want to call their plugin as 'none'
-        $activemethod = null;
+        $setmethod = null;
     }
-    $manager->set_active_method($activemethod);
+    $manager->set_active_method($setmethod);
     redirect($PAGE->url);
 }
 
index fa4ba46..173f07b 100644 (file)
@@ -44,7 +44,7 @@ class core_grading_renderer extends plugin_renderer_base {
         $methods = $manager->get_available_methods(false);
         $methods['none'] = get_string('gradingmethodnone', 'core_grading');
         $selector = new single_select(new moodle_url($targeturl, array('sesskey' => sesskey())),
-            'activemethod', $methods, empty($method) ? 'none' : $method, null, 'activemethodselector');
+            'setmethod', $methods, empty($method) ? 'none' : $method, null, 'activemethodselector');
         $selector->set_label(get_string('changeactivemethod', 'core_grading'));
         $selector->set_help_icon('gradingmethod', 'core_grading');