From 13e8736049e7608a007ccb151654202610423c7d Mon Sep 17 00:00:00 2001 From: Mark Nielsen Date: Thu, 12 Dec 2013 11:42:21 +0800 Subject: [PATCH] MDL-37679 Course: Adding section to page title on section only pages --- course/view.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/course/view.php b/course/view.php index 5430b6c1f3e..d74fcd40d97 100644 --- a/course/view.php +++ b/course/view.php @@ -240,6 +240,14 @@ } $PAGE->set_title(get_string('course') . ': ' . $course->fullname); + // If viewing a section, make the title more specific + if ($section and $section > 0 and course_format_uses_sections($course->format)) { + // Get section details and check it exists. + $newtitle = $PAGE->title.', '.get_string('sectionname', "format_$course->format").': '. + get_section_name($course, $section); + $PAGE->set_title($newtitle); + } + $PAGE->set_heading($course->fullname); echo $OUTPUT->header();