diff --git a/lang/en/moodle.php b/lang/en/moodle.php index b4e29fbbf6e..e1d54bab64f 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -1188,6 +1188,7 @@ $string['loginstepsnone'] = '
Hi!
If someone else has already chosen your username then you\'ll have to try again using a different username.
'; $string['loginto'] = 'Log in to {$a}'; $string['loginagain'] = 'Log in again'; +$string['logoof'] = 'Logo of {$a}'; $string['logout'] = 'Log out'; $string['logoutconfirm'] = 'Do you really want to log out?'; $string['logs'] = 'Logs'; diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 0e6417310a0..4b43557913c 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -4133,12 +4133,6 @@ EOD; $subheader = null; $userbuttons = null; - if ($this->should_display_main_logo($headinglevel)) { - $sitename = format_string($SITE->fullname, true, array('context' => context_course::instance(SITEID))); - return html_writer::div(html_writer::empty_tag('img', [ - 'src' => $this->get_logo_url(null, 150), 'alt' => $sitename, 'class' => 'img-fluid']), 'logo'); - } - // Make sure to use the heading if it has been set. if (isset($headerinfo['heading'])) { $heading = $headerinfo['heading']; @@ -4214,6 +4208,26 @@ EOD; } } + if ($this->should_display_main_logo($headinglevel)) { + $sitename = format_string($SITE->fullname, true, ['context' => context_course::instance(SITEID)]); + // Logo. + $html = html_writer::div( + html_writer::empty_tag('img', [ + 'src' => $this->get_logo_url(null, 150), + 'alt' => get_string('logoof', '', $sitename), + 'class' => 'img-fluid' + ]), + 'logo' + ); + // Heading. + if (!isset($heading)) { + $html .= $this->heading($this->page->heading, $headinglevel, 'sr-only'); + } else { + $html .= $this->heading($heading, $headinglevel, 'sr-only'); + } + return $html; + } + $contextheader = new context_header($heading, $headinglevel, $imagedata, $userbuttons); return $this->render_context_header($contextheader); }