diff options
Diffstat (limited to 'plugins/Dashboard')
-rw-r--r-- | plugins/Dashboard/Menu.php | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/plugins/Dashboard/Menu.php b/plugins/Dashboard/Menu.php index 95d5a618d4..e972ae7dfd 100644 --- a/plugins/Dashboard/Menu.php +++ b/plugins/Dashboard/Menu.php @@ -15,6 +15,7 @@ use Piwik\Menu\MenuAbstract; use Piwik\Menu\MenuReporting; use Piwik\Menu\MenuTop; use Piwik\Piwik; +use Piwik\Plugins\UsersManager\UserPreferences; use Piwik\Site; /** @@ -41,16 +42,18 @@ class Menu extends \Piwik\Plugin\Menu public function configureTopMenu(MenuTop $menu) { - $tooltip = false; - try { - $idSite = Common::getRequestVar('idSite'); - $tooltip = Piwik::translate('Dashboard_TopLinkTooltip', Site::getNameFor($idSite)); - } catch (Exception $ex) { - // if no idSite parameter, show no tooltip - } + $userPreferences = new UserPreferences(); + $idSite = $userPreferences->getDefaultWebsiteId(); + + $tooltip = Piwik::translate('Dashboard_TopLinkTooltip', Site::getNameFor($idSite)); - $urlParams = array('module' => 'CoreHome', 'action' => 'index'); + $urlParams = array( + 'module' => 'CoreHome', + 'action' => 'index', + 'idSite' => $idSite, + ); $menu->add('Dashboard_Dashboard', null, $urlParams, true, 1, $tooltip); } } + |