Skip to content

Commit

Permalink
MDL-37679 Course: Adding section name to page title
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnfwlr committed Dec 17, 2013
1 parent 2f4e0db commit 761c5fc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 9 additions & 1 deletion course/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,15 @@
$PAGE->set_button($buttons);
}

$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)) {
$sectionname = get_string('sectionname', "format_$course->format");
$sectiontitle = get_section_name($course, $section);
$PAGE->set_title(get_string('coursesectiontitle', 'moodle', array('course' => $course->fullname, 'sectiontitle' => $sectiontitle, 'sectionname' => $sectionname)));
} else {
$PAGE->set_title(get_string('coursetitle', 'moodle', array('course' => $course->fullname)));
}

$PAGE->set_heading($course->fullname);
echo $OUTPUT->header();

Expand Down
2 changes: 2 additions & 0 deletions lang/en/moodle.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,14 @@
$string['courserestore'] = 'Course restore';
$string['courses'] = 'Courses';
$string['coursesectionsummaries'] = 'Course section summaries';
$string['coursesectiontitle'] = 'Course: {$a->course}, {$a->sectionname}: {$a->sectiontitle}';
$string['coursesettings'] = 'Course default settings';
$string['coursesmovedout'] = 'Courses moved out from {$a}';
$string['coursespending'] = 'Courses pending approval';
$string['coursestart'] = 'Course start';
$string['coursesummary'] = 'Course summary';
$string['coursesummary_help'] = 'The course summary is displayed in the list of courses. A course search searches course summary text in addition to course names.';
$string['coursetitle'] = 'Course: {$a->course}';
$string['courseupdates'] = 'Course updates';
$string['create'] = 'Create';
$string['createaccount'] = 'Create my new account';
Expand Down

0 comments on commit 761c5fc

Please sign in to comment.