Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@gmail.com>2015-01-07 00:56:12 +0300
committerThomas Steur <thomas.steur@gmail.com>2015-01-07 03:18:08 +0300
commit0d0022160be8a4e7ef24fad7708c610bdf38d1f4 (patch)
treeadaa55e899eb938ca9bc1f1a4259092332a010e4 /plugins/CoreHome/Menu.php
parent974f548b85ec26ba27c615741b94bd125d4767dd (diff)
added a administration link in top menu, moved logout to user menu (tbd), renamend some settings links in admin
Diffstat (limited to 'plugins/CoreHome/Menu.php')
-rw-r--r--plugins/CoreHome/Menu.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/plugins/CoreHome/Menu.php b/plugins/CoreHome/Menu.php
new file mode 100644
index 0000000000..3351d2b5a1
--- /dev/null
+++ b/plugins/CoreHome/Menu.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\CoreHome;
+
+use Piwik\Db;
+use Piwik\Menu\MenuTop;
+use Piwik\Menu\MenuUser;
+use Piwik\Piwik;
+
+class Menu extends \Piwik\Plugin\Menu
+{
+ public function configureUserMenu(MenuUser $menu)
+ {
+ if (!Piwik::isUserIsAnonymous()) {
+ $module = $this->getLoginModule();
+ $menu->addItem('General_Logout', null, array('module' => $module, 'action' => 'logout'), 999);
+ }
+ }
+
+ public function configureTopMenu(MenuTop $menu)
+ {
+ if (Piwik::isUserIsAnonymous()) {
+ $module = $this->getLoginModule();
+ $menu->addItem('Login_LogIn', null, array('module' => $module), 999);
+ }
+ }
+
+ private function getLoginModule()
+ {
+ return Piwik::getLoginPluginName();
+ }
+
+}