Ejemplo n.º 1
0
 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);
     }
 }