MDL-45774 Navigation: Hide the second dashboard node from the navbar
authorDamyon Wiese <damyon@moodle.com>
Wed, 8 Apr 2015 08:43:25 +0000 (16:43 +0800)
committerAdrian Greeve <adrian@moodle.com>
Fri, 10 Apr 2015 09:18:23 +0000 (17:18 +0800)
lib/navigationlib.php
lib/outputrenderers.php
theme/bootstrapbase/renderers/core_renderer.php

index 4771a1d..71e8e3e 100644 (file)
@@ -4192,10 +4192,13 @@ class settings_navigation extends navigation_node {
 
         // Add a user setting branch.
         if ($gstitle == 'usercurrentsettings') {
-            $dashboard = $this->add('Dashboard', new moodle_url('/my/'), self::TYPE_CONTAINER, null, 'dashboard');
+            $dashboard = $this->add(get_string('myhome'), new moodle_url('/my/'), self::TYPE_CONTAINER, null, 'dashboard');
             // This should be set to false as we don't want to show this to the user. It's only for generating the correct
             // breadcrumb.
             $dashboard->display = false;
+            if (get_home_page() == HOMEPAGE_MY) {
+                $dashboard->mainnavonly = true;
+            }
 
             $iscurrentuser = ($user->id == $USER->id);
 
index ca4e70a..b40cd96 100644 (file)
@@ -3388,11 +3388,6 @@ EOD;
             return '';
         }
 
-        // Remove the Dashboard node from the breadcrumb. This saves doubling up of the same link.
-        if (get_home_page()) {
-            array_shift($items);
-        }
-
         $htmlblocks = array();
         // Iterate the navarray and display each node
         $separator = get_separator();
index 84b625f..fc14854 100644 (file)
@@ -37,11 +37,6 @@ class theme_bootstrapbase_core_renderer extends core_renderer {
             return '';
         }
 
-        // Remove the Dashboard node from the breadcrumb. This saves doubling up of the same link.
-        if (get_home_page()) {
-            array_shift($items);
-        }
-
         $breadcrumbs = array();
         foreach ($items as $item) {
             $item->hideicon = true;