From f1401c244ea9702e994ee4e50997fee73048c679 Mon Sep 17 00:00:00 2001 From: moodler Date: Wed, 30 Jan 2008 06:59:25 +0000 Subject: [PATCH] Merged MDL-13245 from 1.9 --- blocks/admin/block_admin.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/blocks/admin/block_admin.php b/blocks/admin/block_admin.php index e50951f809..7c189d0a55 100644 --- a/blocks/admin/block_admin.php +++ b/blocks/admin/block_admin.php @@ -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; + } } } } -- 2.39.5