MDL-70172 output: pages with main logo should have a first-level header

This commit is contained in:
Shamim Rezaie
2021-03-02 05:41:50 +11:00
parent af390c4495
commit 8ec7ddb92b
2 changed files with 21 additions and 6 deletions
+1
View File
@@ -1180,6 +1180,7 @@ $string['loginstepsnone'] = '<p>Hi!</p>
<p>All you need to do is make up a username and password and use it in the form on this page!</p>
<p>If someone else has already chosen your username then you\'ll have to try again using a different username.</p>';
$string['loginto'] = 'Log in to {$a}';
$string['logoof'] = 'Logo of {$a}';
$string['logout'] = 'Log out';
$string['logoutconfirm'] = 'Do you really want to log out?';
$string['logs'] = 'Logs';
+20 -6
View File
@@ -4122,12 +4122,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'];
@@ -4203,6 +4197,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);
}