diff options
author | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-04-22 07:02:48 +0300 |
---|---|---|
committer | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-04-22 07:02:48 +0300 |
commit | 3a69dd1d4cde6ac4ea702f3f7474f113cebe717f (patch) | |
tree | 69f6425cbf36844216fd013be8b7925649ce998e /core/Plugin/Menu.php | |
parent | a73d8071c2b54b3bfbe2a2403ec8077a3339e5fb (diff) |
Fixes #7735 The date/period is kept between pages (dashboard, all websites, admin...)
Diffstat (limited to 'core/Plugin/Menu.php')
-rw-r--r-- | core/Plugin/Menu.php | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/core/Plugin/Menu.php b/core/Plugin/Menu.php index 4d08402d88..10d7945bf5 100644 --- a/core/Plugin/Menu.php +++ b/core/Plugin/Menu.php @@ -8,6 +8,7 @@ */ namespace Piwik\Plugin; +use Piwik\Common; use Piwik\Development; use Piwik\Menu\MenuAdmin; use Piwik\Menu\MenuReporting; @@ -138,12 +139,9 @@ class Menu */ protected function urlForActionWithDefaultUserParams($controllerAction, $additionalParams = array()) { - $urlModuleAction = $this->urlForAction($controllerAction); - return array_merge( - $urlModuleAction, - $this->urlForDefaultUserParams(), - $additionalParams - ); + $module = $this->getModule(); + + return $this->urlForModuleActionWithDefaultUserParams($module, $controllerAction, $additionalParams); } /** @@ -161,9 +159,20 @@ class Menu protected function urlForModuleActionWithDefaultUserParams($module, $controllerAction, $additionalParams = array()) { $urlModuleAction = $this->urlForModuleAction($module, $controllerAction); + + $date = Common::getRequestVar('date', false); + if ($date) { + $urlModuleAction['date'] = $date; + } + $period = Common::getRequestVar('period', false); + if ($period) { + $urlModuleAction['period'] = $period; + } + + // We want the current query parameters to override the user's defaults return array_merge( - $urlModuleAction, $this->urlForDefaultUserParams(), + $urlModuleAction, $additionalParams ); } |