From 5a1b6297c9ece5d6b4ca799680a13ce06b27d5e0 Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Thu, 6 Oct 2011 15:23:19 +1300 Subject: [PATCH] MDL-28582 course-report: Added a nothing to display notification to the outline and complete activity reports --- course/user.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/course/user.php b/course/user.php index 1796f086a91..21af6d71161 100644 --- a/course/user.php +++ b/course/user.php @@ -270,6 +270,7 @@ switch ($mode) { case "complete" : get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused); $sections = get_all_sections($course->id); + $itemsprinted = false; for ($i=0; $i<=$course->numsections; $i++) { @@ -279,8 +280,10 @@ switch ($mode) { $showsection = (has_capability('moodle/course:viewhiddensections', $coursecontext) or $section->visible or !$course->hiddensections); if ($showsection) { // prevent hidden sections in user activity. Thanks to Geoff Wilbert! - + // Check the section has a sequence. This is the sequence of modules/resources. + // If there is no sequence there is nothing to display. if ($section->sequence) { + $itemsprinted = true; echo '
'; echo '

'; echo get_section_name($course, $section); @@ -352,6 +355,11 @@ switch ($mode) { } } } + + if (!$itemsprinted) { + echo $OUTPUT->notification(get_string('nothingtodisplay')); + } + break; case "coursecompletion": case "coursecompletions":