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:
Diffstat (limited to 'plugins/API/Menu.php')
-rw-r--r--plugins/API/Menu.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/API/Menu.php b/plugins/API/Menu.php
index 0020ecf1c4..b01c686ac0 100644
--- a/plugins/API/Menu.php
+++ b/plugins/API/Menu.php
@@ -26,7 +26,7 @@ class Menu extends \Piwik\Plugin\Menu
public function configureUserMenu(MenuUser $menu)
{
- $apiUrlParams = array('module' => 'API', 'action' => 'listAllAPI', 'segment' => false);
+ $apiUrlParams = $this->urlForAction('listAllAPI', array('segment' => false));
$tooltip = Piwik::translate('API_TopLinkTooltip');
$menu->addPlatformItem('General_API', $apiUrlParams, 6, $tooltip);
@@ -45,8 +45,14 @@ class Menu extends \Piwik\Plugin\Menu
$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);
+
+ $url = $this->urlForModuleAction('Proxy', 'redirect', array('url' => 'http://piwik.org/mobile/'));
+
+ if ($url) {
+ $menu->addItem('Piwik Mobile App', null, $url, 4);
+ }
}
}