Merged MDL-13245 from 1.9

This commit is contained in:
moodler 2008-01-30 06:59:25 +00:00
parent 86ef7676c8
commit f1401c244e

View file

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