MDL-80043 grade: Use heading parameter for the page title if provided

This commit is contained in:
Jun Pataleta
2023-12-01 09:10:52 +08:00
parent 6ff6327a6b
commit fd8b7fc730
+4 -2
View File
@@ -926,14 +926,16 @@ function print_grade_page_head(int $courseid, string $active_type, ?string $acti
}
$coursecontext = context_course::instance($courseid);
// Title will be constituted by information starting from the unique identifying information for the page.
if (in_array($active_type, ['report', 'settings'])) {
if ($heading) {
// If heading is supplied, use this for the page title.
$uniquetitle = $heading;
} else if (in_array($active_type, ['report', 'settings'])) {
$uniquetitle = $stractiveplugin;
} else {
$uniquetitle = $stractive_type . ': ' . $stractiveplugin;
}
$titlecomponents = [
$uniquetitle,
get_string('grades'),
$coursecontext->get_context_name(false),
];
$PAGE->set_title(implode(moodle_page::TITLE_SEPARATOR, $titlecomponents));