diff --git a/course/format/renderer.php b/course/format/renderer.php index edc7d87af3459..25a0ea4406c7e 100644 --- a/course/format/renderer.php +++ b/course/format/renderer.php @@ -555,13 +555,14 @@ protected function stealth_section_footer() { * @param int $sectionno The section number in the coruse which is being dsiplayed * @return string HTML to output. */ - protected function section_hidden($sectionno) { + protected function section_hidden($sectionno, $courseorid) { $o = ''; $o.= html_writer::start_tag('li', array('id' => 'section-'.$sectionno, 'class' => 'section main clearfix hidden')); $o.= html_writer::tag('div', '', array('class' => 'left side')); $o.= html_writer::tag('div', '', array('class' => 'right side')); $o.= html_writer::start_tag('div', array('class' => 'content')); - $o.= get_string('notavailable'); + $o .= html_writer::tag('div', get_string('notavailablecourse', '', get_section_name( + $courseorid, $sectionno, array('class' => 'availabilityinfo')))); $o.= html_writer::end_tag('div'); $o.= html_writer::end_tag('li'); return $o; @@ -626,7 +627,7 @@ public function print_single_section_page($course, $sections, $mods, $modnames, if (!$sectioninfo->uservisible) { if (!$course->hiddensections) { echo $this->start_section_list(); - echo $this->section_hidden($displaysection); + echo $this->section_hidden($displaysection, $course->id); echo $this->end_section_list(); } // Can't view this section. @@ -745,7 +746,7 @@ public function print_multiple_section_page($course, $sections, $mods, $modnames // Hidden section message is overridden by 'unavailable' control // (showavailability option). if (!$course->hiddensections && $thissection->available) { - echo $this->section_hidden($section); + echo $this->section_hidden($section, $course->id); } continue; diff --git a/lang/en/moodle.php b/lang/en/moodle.php index 469ff001bdff7..916abb7cabead 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -1314,6 +1314,7 @@ $string['nostudentsyet'] = 'No students enrolled in this course yet'; $string['nosuchemail'] = 'No such email address'; $string['notavailable'] = 'Not available'; +$string['notavailablecourse'] = '{$a} is not available'; $string['noteachersyet'] = 'No teachers in this course yet'; $string['notenrolled'] = '{$a} is not enrolled in this course.'; $string['notenrolledprofile'] = 'This profile is not available because this user is not enrolled in this course.';