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

This commit is contained in:
Jun Pataleta
2023-12-01 09:11:46 +08:00
parent 253028f813
commit e372e143ca
+4 -2
View File
@@ -930,14 +930,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 = $stractive_plugin;
} else {
$uniquetitle = $stractive_type . ': ' . $stractive_plugin;
}
$titlecomponents = [
$uniquetitle,
get_string('grades'),
$coursecontext->get_context_name(false),
];
$PAGE->set_title(implode(moodle_page::TITLE_SEPARATOR, $titlecomponents));