diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2015-01-12 03:10:52 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2015-01-15 05:59:27 +0300 |
commit | 2d3c709c6129241bea360fb83383327e1fea7154 (patch) | |
tree | ef35c98317457a8e9acf490edc1f1e1daa55243b /core/Menu | |
parent | 11b56513c260533c89fbef709817944227189e93 (diff) |
show a menu in the user area, lots of improvements to be more consistent
Diffstat (limited to 'core/Menu')
-rw-r--r-- | core/Menu/MenuAdmin.php | 25 | ||||
-rwxr-xr-x | core/Menu/MenuUser.php | 14 |
2 files changed, 15 insertions, 24 deletions
diff --git a/core/Menu/MenuAdmin.php b/core/Menu/MenuAdmin.php index 13e8480596..5335091285 100644 --- a/core/Menu/MenuAdmin.php +++ b/core/Menu/MenuAdmin.php @@ -117,7 +117,7 @@ class MenuAdmin extends MenuAbstract */ public function addManageItem($menuName, $url, $order = 50, $tooltip = false) { - $this->addItem('CoreAdminHome_MenuManage', $menuName, $url, $order, $tooltip); + $this->addItem('CoreAdminHome_Administration', $menuName, $url, $order, $tooltip); } /** @@ -144,29 +144,6 @@ class MenuAdmin extends MenuAbstract } /** - * Returns the current AdminMenu name - * - * @return boolean - */ - public function getCurrentAdminMenuName() - { - $menu = MenuAdmin::getInstance()->getMenu(); - $currentModule = Piwik::getModule(); - $currentAction = Piwik::getAction(); - foreach ($menu as $submenu) { - foreach ($submenu as $subMenuName => $parameters) { - if (strpos($subMenuName, '_') !== 0 && - $parameters['_url']['module'] == $currentModule - && $parameters['_url']['action'] == $currentAction - ) { - return $subMenuName; - } - } - } - return false; - } - - /** * @deprecated since version 2.4.0. See {@link Piwik\Plugin\Menu} for new implementation. */ public static function removeEntry($menuName, $subMenuName = false) diff --git a/core/Menu/MenuUser.php b/core/Menu/MenuUser.php index 758ac3d578..ac3bc295ab 100755 --- a/core/Menu/MenuUser.php +++ b/core/Menu/MenuUser.php @@ -40,6 +40,20 @@ class MenuUser extends MenuAbstract * @api * @since 2.5.0 */ + public function addPersonalItem($menuName, $url, $order = 50, $tooltip = false) + { + $this->addItem('UsersManager_MenuPersonal', $menuName, $url, $order, $tooltip); + } + + /** + * See {@link add()}. Adds a new menu item to the manage section of the user menu. + * @param string $menuName + * @param array $url + * @param int $order + * @param bool|string $tooltip + * @api + * @since 2.5.0 + */ public function addManageItem($menuName, $url, $order = 50, $tooltip = false) { $this->addItem('CoreAdminHome_MenuManage', $menuName, $url, $order, $tooltip); |