MDL-78550 grade: Avoid rendering an empty <h2> heading

This commit is contained in:
Jun Pataleta
2023-07-28 17:25:21 +08:00
parent d351633fb9
commit 997d5e44a8
+6 -8
View File
@@ -970,15 +970,13 @@ function print_grade_page_head(int $courseid, string $active_type, ?string $acti
$output = '';
// Add a help dialogue box if provided.
if (isset($headerhelpidentifier)) {
if (isset($headerhelpidentifier) && !empty($heading)) {
$output = $OUTPUT->heading_with_help($heading, $headerhelpidentifier, $headerhelpcomponent);
} else {
if (isset($user)) {
$renderer = $PAGE->get_renderer('core_grades');
$output = $OUTPUT->heading($renderer->user_heading($user, $courseid));
} else {
$output = $OUTPUT->heading($heading);
}
} else if (isset($user)) {
$renderer = $PAGE->get_renderer('core_grades');
$output = $OUTPUT->heading($renderer->user_heading($user, $courseid));
} else if (!empty($heading)) {
$output = $OUTPUT->heading($heading);
}
if ($return) {