diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2015-10-07 15:31:27 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2015-10-07 15:31:27 +0300 |
commit | 6f465eb01c10d578a4ad038dc003cfe194d7a218 (patch) | |
tree | 3ee00692f89cb2ba923115d74036ee3ae0144c68 /plugins/CoreHome/Menu.php | |
parent | 10d482f1d3deb4c717fbb87f523428196634a326 (diff) |
various fixes for left menu, code tweaks and documented new method to register icons
Diffstat (limited to 'plugins/CoreHome/Menu.php')
-rw-r--r-- | plugins/CoreHome/Menu.php | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/plugins/CoreHome/Menu.php b/plugins/CoreHome/Menu.php index 03c847ac97..20d9ac8eb8 100644 --- a/plugins/CoreHome/Menu.php +++ b/plugins/CoreHome/Menu.php @@ -27,24 +27,29 @@ class Menu extends \Piwik\Plugin\Menu } if (Plugin\Manager::getInstance()->isPluginActivated('Feedback')) { - $menu->addItem('icon-help', null, array('module' => 'Feedback', 'action' => 'index'), $order = 990, Piwik::translate('General_Help')); + $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('icon-user', null, array('module' => 'ScheduledReports', 'action' => 'index'), 970, $login); + $menu->addItem($login, null, array('module' => 'ScheduledReports', 'action' => 'index'), 970, $login); } else { - $menu->addItem('icon-user', null, array('module' => 'API', 'action' => 'listAllAPI'), 970, $login); + $menu->addItem($login, null, array('module' => 'API', 'action' => 'listAllAPI'), 970, $login); } } else { - $menu->addItem('icon-user', null, array('module' => 'UsersManager', 'action' => 'userSettings'), 970, $login); + $menu->addItem($login, null, array('module' => 'UsersManager', 'action' => 'userSettings'), 970, $login); } $module = $this->getLoginModule(); if (Piwik::isUserIsAnonymous()) { - $menu->addItem('icon-sign-in', null, array('module' => $module, 'action' => false), 1000, Piwik::translate('Login_LogIn')); + $menu->registerMenuIcon('Login_LogIn', 'icon-sign-in'); + $menu->addItem('Login_LogIn', null, array('module' => $module, 'action' => false), 1000, Piwik::translate('Login_LogIn')); } else { - $menu->addItem('icon-sign-out', null, array('module' => $module, 'action' => 'logout', 'idSite' => null), 1000, Piwik::translate('General_Logout')); + $menu->registerMenuIcon('General_Logout', 'icon-sign-out'); + $menu->addItem('General_Logout', null, array('module' => $module, 'action' => 'logout', 'idSite' => null), 1000, Piwik::translate('General_Logout')); } } |