MDL-29392 grade/report/index.php should use $CFG->grade_profilereport

This commit is contained in:
M Kassaei 2011-09-16 12:00:19 +01:00 committed by Tim Hunt
parent 9cfaebbd0e
commit 5cd7869883

View File

@ -38,7 +38,7 @@ foreach ($reports as $plugin => $plugindir) { // Remove one
}
if (empty($reports)) {
print_error('noreports', 'debug', $CFG->wwwroot.'/course/view.php?id='.$course->id); // TODO: localize
print_error('noreports', 'debug', $CFG->wwwroot.'/course/view.php?id='.$course->id);
}
if (!isset($USER->grade_last_report)) {
@ -59,11 +59,12 @@ if (empty($last)) {
if (array_key_exists('grader', $reports)) {
$last = 'grader';
} else if (array_key_exists('user', $reports)) {
$last = 'user';
} else if (array_key_exists($CFG->grade_profilereport, $reports)) {
$last = $CFG->grade_profilereport;
} else {
$last = key(reset($reports));
reset($reports);
$last = key($reports);
}
}