From e372e143cabd3df20accf8931f57e0da9d6496fc Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Thu, 23 Nov 2023 22:16:52 +0800 Subject: [PATCH] MDL-80043 grade: Use heading parameter for the page title if provided --- grade/lib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/grade/lib.php b/grade/lib.php index c31b9a5654b..535787a7a88 100644 --- a/grade/lib.php +++ b/grade/lib.php @@ -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));