Merge branch 'wip-35-MDL-62345' of https://github.com/adpe/moodle into MOODLE_35_STABLE

This commit is contained in:
Andrew Nicols
2019-02-27 14:14:35 +08:00
+2 -2
View File
@@ -1218,7 +1218,7 @@ class global_navigation extends navigation_node {
// The home element should be my moodle because the root element is the site
if (isloggedin() && !isguestuser()) { // Makes no sense if you aren't logged in
$this->rootnodes['home'] = $this->add(get_string('myhome'), new moodle_url('/my/'),
self::TYPE_SETTING, null, 'home', new pix_icon('i/dashboard', ''));
self::TYPE_SETTING, null, 'myhome', new pix_icon('i/dashboard', ''));
$this->rootnodes['home']->showinflatnavigation = true;
}
} else {
@@ -1426,7 +1426,7 @@ class global_navigation extends navigation_node {
foreach ($this->rootnodes as $node) {
// Dont remove the home node
/** @var navigation_node $node */
if ($node->key !== 'home' && !$node->has_children() && !$node->isactive) {
if (!in_array($node->key, ['home', 'myhome']) && !$node->has_children() && !$node->isactive) {
$node->remove();
}
}