Navigation Menu

Skip to content

Commit

Permalink
Merge branch 'wip-MDL-28582-m21' of git://github.com/samhemelryk/mood…
Browse files Browse the repository at this point in the history
…le into MOODLE_21_STABLE
  • Loading branch information
Aparup Banerjee committed Oct 11, 2011
2 parents 28d838b + 960262f commit 489f5b1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion course/user.php
Expand Up @@ -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++) {

Expand All @@ -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);
Expand Down Expand Up @@ -352,6 +355,11 @@
}
}
}

if (!$itemsprinted) {
echo $OUTPUT->notification(get_string('nothingtodisplay'));
}

break;
case "coursecompletion":
case "coursecompletions":
Expand Down

0 comments on commit 489f5b1

Please sign in to comment.