Merge branch 'mdl-72838-fix-master' of https://github.com/jaypha/moodle

This commit is contained in:
Sara Arjona 2022-01-18 15:19:55 +01:00
commit 7a1fdc5f15
4 changed files with 20 additions and 7 deletions

View File

@ -1256,8 +1256,9 @@ class global_navigation extends navigation_node {
return;
}
if (get_home_page() == HOMEPAGE_SITE) {
// We are using the site home for the root element
$homepage = get_home_page();
if ($homepage == HOMEPAGE_SITE) {
// We are using the site home for the root element.
$properties = array(
'key' => 'home',
'type' => navigation_node::TYPE_SYSTEM,
@ -1265,8 +1266,17 @@ class global_navigation extends navigation_node {
'action' => new moodle_url('/'),
'icon' => new pix_icon('i/home', '')
);
} else if ($homepage == HOMEPAGE_MYCOURSES) {
// We are using the user's course summary page for the root element.
$properties = array(
'key' => 'mycourses',
'type' => navigation_node::TYPE_SYSTEM,
'text' => get_string('mycourses'),
'action' => new moodle_url('/my/courses.php'),
'icon' => new pix_icon('i/course', '')
);
} else {
// We are using the users my moodle for the root element
// We are using the users my moodle for the root element.
$properties = array(
'key' => 'myhome',
'type' => navigation_node::TYPE_SYSTEM,

View File

@ -324,6 +324,7 @@ class page_requirements_manager {
$this->M_cfg = array(
'wwwroot' => $CFG->wwwroot,
'homeurl' => $page->navigation->action,
'sesskey' => sesskey(),
'sessiontimeout' => $CFG->sessiontimeout,
'sessiontimeoutwarning' => $CFG->sessiontimeoutwarning,

View File

@ -32,7 +32,8 @@
"user_menu": "<div class='dropdown'>John Doe</div>"
},
"config": {
"wwwroot": "#"
"wwwroot": "#",
"homeurl": "/my/"
},
"sitename": "Moodle Site",
"mobileprimarynav": [
@ -61,7 +62,7 @@
<span class="sr-only">{{#str}}sidepanel, core{{/str}}</span>
</button>
<a href="{{{ config.wwwroot }}}" class="navbar-brand d-none d-md-flex align-items-center m-0 mr-4 p-0 aabtn">
<a href="{{{ config.homeurl }}}" class="navbar-brand d-none d-md-flex align-items-center m-0 mr-4 p-0 aabtn">
{{# output.should_display_navbar_logo }}
<img src="{{output.get_compact_logo_url}}" class="logo mr-1" alt="{{sitename}}">

View File

@ -31,14 +31,15 @@
"user_menu": "<div class='dropdown'>John Doe</div>"
},
"config": {
"wwwroot": "#"
"wwwroot": "#",
"homeurl": "/my/"
},
"sitename": "Moodle Site"
}
}}
<nav class="fixed-top navbar navbar-bootswatch navbar-expand moodle-has-zindex">
<a href="{{{ config.wwwroot }}}" class="navbar-brand d-flex align-items-center m-1 p-0 aabtn">
<a href="{{{ config.homeurl }}}" class="navbar-brand d-flex align-items-center m-1 p-0 aabtn">
{{# output.should_display_navbar_logo }}
<img src="{{output.get_compact_logo_url}}" class="logo mr-1" alt="{{sitename}}">
{{/ output.should_display_navbar_logo }}