]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-20311 refactoring regression - thanks Clyde Tan for noticing this
authorskodak <skodak>
Sat, 26 Sep 2009 18:22:12 +0000 (18:22 +0000)
committerskodak <skodak>
Sat, 26 Sep 2009 18:22:12 +0000 (18:22 +0000)
grade/lib.php
grade/report/index.php

index c772da6c6428805b4a368216f156c4707f7ec742..3b7b858b48446920b23270a945be6769e771170a 100644 (file)
@@ -498,7 +498,7 @@ function grade_get_plugin_info($courseid, $active_type, $active_plugin) {
         // Remove ones we can't see
         foreach ($reports as $plugin => $unused) {
             if (!has_capability('gradereport/'.$plugin.':view', $context)) {
-                unset($reports[$key]);
+                unset($reports[$plugin]);
             }
         }
     }
@@ -633,7 +633,7 @@ function grade_get_plugin_info($courseid, $active_type, $active_plugin) {
     if ($imports = get_plugin_list('gradeimport')) { // Get all installed import plugins
         foreach ($imports as $plugin => $plugindir) { // Remove ones we can't see
             if (!has_capability('gradeimport/'.$plugin.':view', $context)) {
-                unset($imports[$key]);
+                unset($imports[$plugin]);
             }
         }
     }
index 864e70ea88b2e7b49e963cfd3f6a013b01e32f5d..718adb894bf3e002c5562755ba9a777d417191e3 100644 (file)
@@ -31,7 +31,7 @@ $reports = get_plugin_list('gradereport');     // Get all installed reports
 
 foreach ($reports as $plugin => $plugindir) {                      // Remove ones we can't see
     if (!has_capability('gradereport/'.$plugin.':view', $context)) {
-        unset($reports[$key]);
+        unset($reports[$plugin]);
     }
 }