public function configureTopMenu(MenuTop $menu) { $userPreferences = new UserPreferences(); $idSite = $userPreferences->getDefaultWebsiteId(); $tooltip = Piwik::translate('Dashboard_TopLinkTooltip', Site::getNameFor($idSite)); $urlParams = array('module' => 'CoreHome', 'action' => 'index', 'idSite' => $idSite); $menu->add('Dashboard_Dashboard', null, $urlParams, true, 1, $tooltip); }
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 } $urlParams = array('module' => 'CoreHome', 'action' => 'index'); $menu->add('Dashboard_Dashboard', null, $urlParams, true, 1, $tooltip); }
private function addTopMenuMobileApp(MenuTop $menu) { if (empty($_SERVER['HTTP_USER_AGENT'])) { return; } if (!class_exists("DeviceDetector\\DeviceDetector")) { throw new \Exception("DeviceDetector could not be found, maybe you are using Piwik from git and need to update Composer. Execute this command: php composer.phar update"); } $ua = new OperatingSystem($_SERVER['HTTP_USER_AGENT']); $ua->setCache(new DeviceDetectorCache('tracker', 86400)); $parsedOS = $ua->parse(); if (!empty($parsedOS['short_name']) && in_array($parsedOS['short_name'], array(self::DD_SHORT_NAME_ANDROID, self::DD_SHORT_NAME_IOS))) { $menu->add('Piwik Mobile App', null, array('module' => 'Proxy', 'action' => 'redirect', 'url' => 'http://piwik.org/mobile/'), true, 4); } }
private function addTopMenuMobileApp(MenuTop $menu) { if (empty($_SERVER['HTTP_USER_AGENT'])) { return; } if (!class_exists("DeviceDetector")) { throw new \Exception("DeviceDetector could not be found, maybe you are using Piwik from git and need to have update Composer. <br>php composer.phar update"); } $ua = new \DeviceDetector($_SERVER['HTTP_USER_AGENT']); $ua->parse(); $os = $ua->getOs('short_name'); if ($os && in_array($os, array('AND', 'IOS'))) { $menu->add('Piwik Mobile App', null, array('module' => 'Proxy', 'action' => 'redirect', 'url' => 'http://piwik.org/mobile/'), true, 4); } }
public function configureTopMenu(MenuTop $menu) { $urlParams = $this->urlForActionWithDefaultUserParams('index', array('segment' => false, 'idSite' => false)); $tooltip = Piwik::translate('MultiSites_TopLinkTooltip'); $menu->add('General_MultiSitesSummary', null, $urlParams, true, 3, $tooltip); }
public function configureTopMenu(MenuTop $menu) { $urlParams = array('module' => 'MultiSites', 'action' => 'index', 'segment' => false); $tooltip = Piwik::translate('MultiSites_TopLinkTooltip'); $menu->add('General_MultiSitesSummary', null, $urlParams, true, 3, $tooltip); }
public function configureTopMenu(MenuTop $menu) { $urlParams = array('module' => 'ExampleUI', 'action' => 'notifications'); $menu->add('UI Notifications', null, $urlParams, $displayedForCurrentUser = true, $order = 3); }