mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
MDL-28582 course-report: Added a nothing to display notification to the outline and complete activity reports
This commit is contained in:
parent
b77088cd04
commit
5a1b6297c9
1 changed files with 9 additions and 1 deletions
|
@ -270,6 +270,7 @@ switch ($mode) {
|
||||||
case "complete" :
|
case "complete" :
|
||||||
get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused);
|
get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused);
|
||||||
$sections = get_all_sections($course->id);
|
$sections = get_all_sections($course->id);
|
||||||
|
$itemsprinted = false;
|
||||||
|
|
||||||
for ($i=0; $i<=$course->numsections; $i++) {
|
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);
|
$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!
|
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) {
|
if ($section->sequence) {
|
||||||
|
$itemsprinted = true;
|
||||||
echo '<div class="section">';
|
echo '<div class="section">';
|
||||||
echo '<h2>';
|
echo '<h2>';
|
||||||
echo get_section_name($course, $section);
|
echo get_section_name($course, $section);
|
||||||
|
@ -352,6 +355,11 @@ switch ($mode) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$itemsprinted) {
|
||||||
|
echo $OUTPUT->notification(get_string('nothingtodisplay'));
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "coursecompletion":
|
case "coursecompletion":
|
||||||
case "coursecompletions":
|
case "coursecompletions":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue