From aeee621abec6bcf9a2fac2d18560c6c26d81b3a4 Mon Sep 17 00:00:00 2001 From: mattpiwik <matthieu.aubry@gmail.com> Date: Mon, 12 Sep 2011 09:23:33 +0000 Subject: [PATCH] Allowing one plugin to define 2 top bar menus git-svn-id: http://dev.piwik.org/svn/trunk@5161 59fd770c-687e-43c8-a1e3-f5a4ff64c105 --- core/View.php | 1 + plugins/CoreHome/templates/top_bar.tpl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/View.php b/core/View.php index 5888ecb3bc..42f28c85b7 100644 --- a/core/View.php +++ b/core/View.php @@ -80,6 +80,7 @@ class Piwik_View implements Piwik_iView { try { $this->currentModule = Piwik::getModule(); + $this->currentAction = Piwik::getAction(); $userLogin = Piwik::getCurrentUserLogin(); $this->userLogin = $userLogin; diff --git a/plugins/CoreHome/templates/top_bar.tpl b/plugins/CoreHome/templates/top_bar.tpl index b97d0b85a8..f18c4e7b64 100644 --- a/plugins/CoreHome/templates/top_bar.tpl +++ b/plugins/CoreHome/templates/top_bar.tpl @@ -5,7 +5,7 @@ {if isset($menu._html)} {$menu._html} - {elseif $menu._url.module == $currentModule} + {elseif $menu._url.module == $currentModule && (empty($menu._url.action) || $menu._url.action == $currentAction)} <span class="topBarElem"><b>{$label|translate}</b></span> | {else} <span class="topBarElem"><a id="topmenu-{$menu._url.module|strtolower}" href="index.php{$menu._url|@urlRewriteWithParameters}">{$label|translate}</a></span> | -- GitLab