mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
navigation MDL-14632 Improved display conditions for progress report
This commit is contained in:
parent
83f1fa9c4d
commit
b6a56aeae0
@ -33,7 +33,16 @@
|
||||
*/
|
||||
function progress_report_extend_navigation($navigation, $course, $context) {
|
||||
global $CFG, $OUTPUT;
|
||||
if (has_capability('coursereport/progress:view', $context)) {
|
||||
|
||||
$showonnavigation = has_capability('coursereport/progress:view', $context);
|
||||
$group=groups_get_course_group($course,true); // Supposed to verify group
|
||||
if($group===0 && $course->groupmode==SEPARATEGROUPS) {
|
||||
$showonnavigation = ($showonnavigation && has_capability('moodle/site:accessallgroups', $context));
|
||||
}
|
||||
|
||||
$completion = new completion_info($course);
|
||||
$showonnavigation = ($showonnavigation && $completion->is_enabled() && count($completion->get_activities())>0);
|
||||
if ($showonnavigation) {
|
||||
$url = new moodle_url('/course/report/progress/index.php', array('course'=>$course->id));
|
||||
$navigation->add(get_string('completionreport','completion'), $url, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/report', ''));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user