Merge branch 'MDL-79047-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE

This commit is contained in:
Ilya Tregubov 2023-09-18 12:25:40 +08:00
commit 880e7e7298
No known key found for this signature in database
GPG Key ID: 0F58186F748E55C1

View File

@ -770,8 +770,8 @@ function grade_get_plugin_info($courseid, $active_type, $active_plugin) {
break;
}
foreach ($plugins as $plugin) {
if (is_a($plugin, 'grade_plugin_info')) {
if ($active_plugin == $plugin->id) {
if (is_a($plugin, grade_plugin_info::class)) {
if ($plugin_type === $active_type && $active_plugin == $plugin->id) {
$plugin_info['strings']['active_plugin_str'] = $plugin->string;
}
}
@ -880,7 +880,7 @@ class grade_plugin_info {
* @param string|null $headerhelpidentifier The help string identifier if required.
* @param string|null $headerhelpcomponent The component for the help string.
* @param stdClass|null $user The user object for use with the user context header.
* @param actionbar|null $actionbar The actions bar which will be displayed on the page if $shownavigation is set
* @param action_bar|null $actionbar The actions bar which will be displayed on the page if $shownavigation is set
* to true. If $actionbar is not explicitly defined, the general action bar
* (\core_grades\output\general_action_bar) will be used by default.
* @param boolean $showtitle If set to false just show course full name as a title.
@ -922,7 +922,19 @@ function print_grade_page_head(int $courseid, string $active_type, ?string $acti
} else {
$PAGE->set_pagelayout('admin');
}
$PAGE->set_title(get_string('grades') . ': ' . $stractive_type);
$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'])) {
$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));
$PAGE->set_heading($title);
$PAGE->set_secondary_active_tab('grades');
@ -988,8 +1000,7 @@ function print_grade_page_head(int $courseid, string $active_type, ?string $acti
echo $output;
}
$returnval .= print_natural_aggregation_upgrade_notice($courseid, context_course::instance($courseid), $PAGE->url,
$return);
$returnval .= print_natural_aggregation_upgrade_notice($courseid, $coursecontext, $PAGE->url, $return);
if ($return) {
return $returnval;