MDL-70173 core: Use a meaningful first level header

This commit is contained in:
Shamim Rezaie 2021-01-21 22:34:40 +11:00
parent 23ed4c4440
commit e3142ca2e2
2 changed files with 6 additions and 3 deletions

View file

@ -4144,6 +4144,8 @@ EOD;
// Make sure to use the heading if it has been set. // Make sure to use the heading if it has been set.
if (isset($headerinfo['heading'])) { if (isset($headerinfo['heading'])) {
$heading = $headerinfo['heading']; $heading = $headerinfo['heading'];
} else {
$heading = $this->page->heading;
} }
// The user context currently has images and buttons. Other contexts may follow. // The user context currently has images and buttons. Other contexts may follow.
@ -4168,7 +4170,7 @@ EOD;
if (user_can_view_profile($user, $course)) { if (user_can_view_profile($user, $course)) {
// Use the user's full name if the heading isn't set. // Use the user's full name if the heading isn't set.
if (!isset($heading)) { if (empty($heading)) {
$heading = fullname($user); $heading = fullname($user);
} }

View file

@ -62,14 +62,15 @@ if (isguestuser()) { // Force them to see system default, no editing allowed
$USER->editing = $edit = 0; // Just in case $USER->editing = $edit = 0; // Just in case
$context = context_system::instance(); $context = context_system::instance();
$PAGE->set_blocks_editing_capability('moodle/my:configsyspages'); // unlikely :) $PAGE->set_blocks_editing_capability('moodle/my:configsyspages'); // unlikely :)
$header = "$SITE->shortname: $strmymoodle (GUEST)"; $strguest = get_string('guest');
$header = "$SITE->shortname: $strmymoodle ($strguest)";
$pagetitle = $header; $pagetitle = $header;
} else { // We are trying to view or edit our own My Moodle page } else { // We are trying to view or edit our own My Moodle page
$userid = $USER->id; // Owner of the page $userid = $USER->id; // Owner of the page
$context = context_user::instance($USER->id); $context = context_user::instance($USER->id);
$PAGE->set_blocks_editing_capability('moodle/my:manageblocks'); $PAGE->set_blocks_editing_capability('moodle/my:manageblocks');
$header = fullname($USER); $header = "$SITE->shortname: $strmymoodle";
$pagetitle = $strmymoodle; $pagetitle = $strmymoodle;
} }