diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2016-04-04 03:10:40 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2016-04-06 13:17:27 +0300 |
commit | 3a6d626c2474b83ea5c4125fd33dfe12b9e0bf8a (patch) | |
tree | 9de2cd1d85e1f8a7211f0514f8deae2b152faa89 /plugins/CoreHome/Menu.php | |
parent | 780c09b144e048cc748429bc06d016354d44746e (diff) |
refs #9354 merge user and admin menu to one single menu
Diffstat (limited to 'plugins/CoreHome/Menu.php')
-rw-r--r-- | plugins/CoreHome/Menu.php | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/plugins/CoreHome/Menu.php b/plugins/CoreHome/Menu.php index 7009217833..cab21179a9 100644 --- a/plugins/CoreHome/Menu.php +++ b/plugins/CoreHome/Menu.php @@ -9,41 +9,15 @@ namespace Piwik\Plugins\CoreHome; use Piwik\Db; +use Piwik\Menu\MenuAdmin; use Piwik\Menu\MenuTop; -use Piwik\Menu\MenuUser; use Piwik\Piwik; use Piwik\Plugin; -use Piwik\Plugins\UsersManager\API as APIUsersManager; class Menu extends \Piwik\Plugin\Menu { public function configureTopMenu(MenuTop $menu) { - $login = Piwik::getCurrentUserLogin(); - $user = APIUsersManager::getInstance()->getUser($login); - - if (!empty($user['alias'])) { - $login = $user['alias']; - } - - if (Plugin\Manager::getInstance()->isPluginActivated('Feedback')) { - $menu->registerMenuIcon('General_Help', 'icon-help'); - $menu->addItem('General_Help', null, array('module' => 'Feedback', 'action' => 'index'), $order = 990, Piwik::translate('General_Help')); - } - - $menu->registerMenuIcon($login, 'icon-user'); - - if (Piwik::isUserIsAnonymous()) { - if (Plugin\Manager::getInstance()->isPluginActivated('ScheduledReports')) { - $menu->addItem($login, null, array('module' => 'ScheduledReports', 'action' => 'index'), 970, Piwik::translate('UsersManager_PersonalSettings')); - } else { - $menu->addItem($login, null, array('module' => 'API', 'action' => 'listAllAPI'), 970, Piwik::translate('API_ReportingApiReference')); - } - } else { - $tooltip = sprintf('%s: %s', Piwik::translate('UsersManager_PersonalSettings'), $login); - $menu->addItem($login, null, array('module' => 'UsersManager', 'action' => 'userSettings'), 970, $tooltip); - } - $module = $this->getLoginModule(); if (Piwik::isUserIsAnonymous()) { $menu->registerMenuIcon('Login_LogIn', 'icon-sign-in'); @@ -54,7 +28,7 @@ class Menu extends \Piwik\Plugin\Menu } } - public function configureUserMenu(MenuUser $menu) + public function configureAdminMenu(MenuAdmin $menu) { $menu->addPersonalItem(null, array(), 1, false); $menu->addManageItem(null, array(), 2, false); |