1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-17 22:45:54 +02:00

MDL-63040 core_my: Remove page header

* Remove user name and image from the page header
* Modify header template to accept new fields
This commit is contained in:
Peter 2018-10-09 13:00:42 +08:00
parent 129783b98c
commit f9d156ca5a
5 changed files with 26 additions and 6 deletions
lib
theme
boost
bootstrapbase

@ -4245,6 +4245,11 @@ EOD;
*/
protected function render_context_header(context_header $contextheader) {
$showheader = empty($this->page->layout_options['nocontextheader']);
if (!$showheader) {
return '';
}
// All the html stuff goes here.
$html = html_writer::start_div('page-context-header');

@ -82,7 +82,7 @@ $THEME->layouts = [
'file' => 'columns2.php',
'regions' => array('side-pre'),
'defaultregion' => 'side-pre',
'options' => array('nonavbar' => true, 'langmenu' => true),
'options' => array('nonavbar' => true, 'langmenu' => true, 'nocontextheader' => true),
),
// My public page.
'mypublic' => array(

@ -2140,4 +2140,4 @@ div.editor_atto_toolbar button .icon {
.dir-ltr-hide {
display: none;
}
}
}

@ -15,16 +15,31 @@
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template boost/header
This template renders the header.
Example context (json):
{
"contextheader": "context_header_html",
"settingsmenu": "settings_html",
"hasnavbar": false,
"navbar": "navbar_if_available",
"courseheader": "course_header_html"
}
Page header.
}}
<header id="page-header" class="row">
<div class="col-12 pt-3 pb-3">
<div class="card">
<div class="card-body">
<div class="card {{^contextheader}}border-0{{/contextheader}}">
<div class="card-body {{^contextheader}}p-2{{/contextheader}}">
<div class="d-flex">
{{#contextheader}}
<div class="mr-auto">
{{{contextheader}}}
{{{contextheader}}}
</div>
{{/contextheader}}
{{#settingsmenu}}
<div class="context-header-settings-menu">

@ -88,7 +88,7 @@ $THEME->layouts = array(
'file' => 'columns3.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-pre',
'options' => array('langmenu' => true),
'options' => array('langmenu' => true, 'nocontextheader' => true),
),
// My public page.
'mypublic' => array(