diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 43f803092bc..d64134721e5 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -4131,6 +4131,8 @@ EOD; // Make sure to use the heading if it has been set. if (isset($headerinfo['heading'])) { $heading = $headerinfo['heading']; + } else { + $heading = $this->page->heading; } // The user context currently has images and buttons. Other contexts may follow. @@ -4155,7 +4157,7 @@ EOD; if (user_can_view_profile($user, $course)) { // Use the user's full name if the heading isn't set. - if (!isset($heading)) { + if (empty($heading)) { $heading = fullname($user); } diff --git a/my/index.php b/my/index.php index 9722450fe89..331954b73c9 100644 --- a/my/index.php +++ b/my/index.php @@ -62,14 +62,15 @@ if (isguestuser()) { // Force them to see system default, no editing allowed $USER->editing = $edit = 0; // Just in case $context = context_system::instance(); $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; } else { // We are trying to view or edit our own My Moodle page $userid = $USER->id; // Owner of the page $context = context_user::instance($USER->id); $PAGE->set_blocks_editing_capability('moodle/my:manageblocks'); - $header = fullname($USER); + $header = "$SITE->shortname: $strmymoodle"; $pagetitle = $strmymoodle; }