Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'wip-MDL-28582-m21' of git://github.com/samhemelryk/mood…

…le into MOODLE_21_STABLE
  • Loading branch information...
commit 489f5b1338ba4a478991153280781ffdcfaad9ca 2 parents 28d838b + 960262f
@nebgor nebgor authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 course/user.php
View
10 course/user.php
@@ -270,6 +270,7 @@
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 @@
$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 '<div class="section">';
echo '<h2>';
echo get_section_name($course, $section);
@@ -352,6 +355,11 @@
}
}
}
+
+ if (!$itemsprinted) {
+ echo $OUTPUT->notification(get_string('nothingtodisplay'));
+ }
+
break;
case "coursecompletion":
case "coursecompletions":
Please sign in to comment.
Something went wrong with that request. Please try again.