]> git.mjollnir.org Git - moodle.git/commitdiff
Merged MDL-13245 from 1.9
authormoodler <moodler>
Wed, 30 Jan 2008 06:59:25 +0000 (06:59 +0000)
committermoodler <moodler>
Wed, 30 Jan 2008 06:59:25 +0000 (06:59 +0000)
blocks/admin/block_admin.php

index e50951f809685f103423dda38a55d745c68a9443..7c189d0a55fc9fb2bf5cf0cffed1aa39d0b4f6b3 100644 (file)
@@ -73,13 +73,15 @@ class block_admin extends block_list {
     /// find all accessible reports
         if ($course->id !== SITEID) {
             $reportavailable = false;
-            if ($reports = get_list_of_plugins('grade/report')) {     // Get all installed reports
-                arsort($reports); // user is last, we want to test it first
-                foreach ($reports as $plugin) {
-                    if (has_capability('gradereport/'.$plugin.':view', $context)) {
-                        //stop when fisrt visible found
-                        $reportavailable = true;
-                        break;
+            if (!empty($course->showgrades)) {
+                if ($reports = get_list_of_plugins('grade/report')) {     // Get all installed reports
+                    arsort($reports); // user is last, we want to test it first
+                    foreach ($reports as $plugin) {
+                        if (has_capability('gradereport/'.$plugin.':view', $context)) {
+                            //stop when fisrt visible found
+                            $reportavailable = true;
+                            break;
+                        }
                     }
                 }
             }