diff --git a/core/Menu/MenuAbstract.php b/core/Menu/MenuAbstract.php index 69b48f76b1d3d36e4de3b5c0f209d78379d0d1b9..3c3fd4e01309d4a5b39f5c17703026b1290bb909 100644 --- a/core/Menu/MenuAbstract.php +++ b/core/Menu/MenuAbstract.php @@ -55,7 +55,7 @@ abstract class MenuAbstract extends Singleton * * @return \Piwik\Plugin\Menu[] */ - protected function getAvailableMenus() + protected function getAllMenus() { if (!empty(self::$menus)) { return self::$menus; @@ -82,6 +82,8 @@ abstract class MenuAbstract extends Singleton public function add($menuName, $subMenuName, $url, $displayedForCurrentUser = true, $order = 50, $tooltip = false) { if (!$displayedForCurrentUser) { + // TODO this parameter should be removed and instead menu items should be only added if it is supposed to be + // displayed. Won't do it now to stay backward compatible. For Piwik 3.0 we should do it. return; } diff --git a/core/Menu/MenuAdmin.php b/core/Menu/MenuAdmin.php index 8b11500c12f98e1e9ae4ea6cb7b82c9142098ead..106420b7122eddd7acaf01a1252c204eda7807e5 100644 --- a/core/Menu/MenuAdmin.php +++ b/core/Menu/MenuAdmin.php @@ -63,7 +63,7 @@ class MenuAdmin extends MenuAbstract */ Piwik::postEvent('Menu.Admin.addItems', array()); - foreach ($this->getAvailableMenus() as $menu) { + foreach ($this->getAllMenus() as $menu) { $menu->configureAdminMenu($this); } } diff --git a/core/Menu/MenuReporting.php b/core/Menu/MenuReporting.php index c085e7b41dc38f0076a452d47e479a6377bfe7fe..c5a3c1da1e2f096c4f7e56f06d6a025bfff457bc 100644 --- a/core/Menu/MenuReporting.php +++ b/core/Menu/MenuReporting.php @@ -74,7 +74,7 @@ class MenuReporting extends MenuAbstract } } - foreach ($this->getAvailableMenus() as $menu) { + foreach ($this->getAllMenus() as $menu) { $menu->configureReportingMenu($this); } diff --git a/core/Menu/MenuTop.php b/core/Menu/MenuTop.php index 1b3b54317920d4c5d3fd3e8011664a2d60dc54e4..e69272ce7ce7f4c5bea5666822acc5a5330706c4 100644 --- a/core/Menu/MenuTop.php +++ b/core/Menu/MenuTop.php @@ -100,7 +100,7 @@ class MenuTop extends MenuAbstract */ Piwik::postEvent('Menu.Top.addItems', array()); - foreach ($this->getAvailableMenus() as $menu) { + foreach ($this->getAllMenus() as $menu) { $menu->configureTopMenu($this); } } diff --git a/core/Menu/MenuUser.php b/core/Menu/MenuUser.php index 25048a8682fb3c4291fcbe629b39d6be8fd1bae7..318e8b3f0f0bc9462766177510f8769f87ff1137 100755 --- a/core/Menu/MenuUser.php +++ b/core/Menu/MenuUser.php @@ -39,7 +39,7 @@ class MenuUser extends MenuAbstract public function getMenu() { if (!$this->menu) { - foreach ($this->getAvailableMenus() as $menu) { + foreach ($this->getAllMenus() as $menu) { $menu->configureUserMenu($this); } }