$device .= "Smartphone"; } // Any tablet device. if ($detect->isTablet()) { $device .= "Tablet"; } if (!$detect->isTablet() && !$detect->isMobile()) { $device .= "Laptop/Computer"; } // Check for a specific platform with the help of the magic methods: if ($detect->isiOS()) { $device .= " running Apple's iOS"; } if ($detect->isAndroidOS()) { $device .= " running Android"; } if ($detect->isChrome()) { $device .= " with the Browser 'Chrome'"; } if ($detect->isOpera()) { $device .= " with the Browser 'Opera'"; } if ($detect->isIE()) { $device .= " with the Browser 'Internet Explorer'"; } if ($detect->isFirefox()) { $device .= " with the Browser 'Firefox'"; } if ($detect->isSafari()) { $device .= " with the Browser 'Safari'"; }
if (!isset($_GET) || count($_GET) == 0) { echo "<div id=\"paramlist\"><h2>Žádné parametry nebyly předány / No parameters given</h2>"; } else { echo "<div id=\"paramlist\"><h2>Seznam parametrů / List of parameters</h2>"; foreach ($_GET as $key => $value) { $gval = $_GET[$gparam]; echo "[{$key}] = [{$value}]<br>\n"; } echo "</div><div class=\"roztah\"></div>"; } } else { $mobile = false; $dumb = false; if ($detect->isMobile() || $detect->isTablet()) { $mobile = true; if ($detect->isAndroidOS() && $detect->isSafari()) { $dumb = true; } } header("X-UA-Compatible: IE=edge"); if (isset($_GET["returnIDParam"])) { $useIDParam = true; $idParam = $_GET["returnIDParam"]; } else { $useIDParam = false; } $qs = $_SERVER['QUERY_STRING']; $url = 'Location: ' . $failbackWayf . "?" . $qs; if ($dumb) { $url = $url . "&dumb=true"; header($url, true, 301);
public function beforeFilter() { parent::beforeFilter(); if (Configure::read('unloadDebugKit') == true) { $this->Components->unload('DebugKit.Toolbar'); } // language initialization $language_list = Configure::read('Config.languageList'); $this->language = $language_list[Configure::read('Config.language')]['code']; if (isset($this->params['language'])) { foreach ($language_list as $locale => $language) { if ($language['active'] && $language['code'] == $this->params['language']) { $this->language = $this->params['language']; Configure::write('Config.language', $locale); break; } } } // set language $this->set('language', $this->language); $this->set('language_list', $language_list); $this->Session->write('Config.language', $this->language); // Detect device $Mobile_Detect = new Mobile_Detect(); $this->device_info = 'Desktop'; $this->device_browser = ''; $this->device_info_type = ''; if ($Mobile_Detect->isTablet()) { $this->device_info = 'Tablet'; if ($Mobile_Detect->isiPad()) { $this->device_info_type = 'Ipad'; } else { if ($Mobile_Detect->isAndroidOS()) { $this->device_info_type = 'Android'; } else { $this->device_info_type = 'others'; } } } else { if ($Mobile_Detect->isMobile()) { $this->device_info = 'Mobile'; if ($Mobile_Detect->isiPhone()) { $this->device_info_type = 'Iphone'; } else { if ($Mobile_Detect->isAndroidOS()) { $this->device_info_type = 'Android'; } else { $this->device_info_type = 'others'; } } } } if ($Mobile_Detect->isChrome() && $Mobile_Detect->isSafari()) { $this->device_browser = 'AndroidDefault'; } else { if ($Mobile_Detect->isChrome()) { $this->device_browser = 'Chrome'; } else { if ($Mobile_Detect->isSafari()) { $this->device_browser = 'Safari'; } else { if ($Mobile_Detect->isIE()) { $this->device_browser = 'IE'; } else { if ($Mobile_Detect->isFirefox()) { $this->device_browser = 'Firefox'; } else { if ($Mobile_Detect->isOpera()) { $this->device_browser = 'Opera'; } else { $this->device_browser = 'others'; } } } } } } $this->set('device_info', $this->device_info); $this->set('device_info_type', $this->device_info_type); $this->set('device_browser', $this->device_browser); //GA account $ga_account = Configure::read('ga_account'); $this->set('ga_account', !empty($ga_account[$this->language]) ? $ga_account[$this->language] : ''); //FB_appID $FB_appID = Configure::read('FB_appID'); $this->set('FB_appID', $FB_appID); }