function getdirections_is_mobile in Get Directions 7.2
Same name and namespace in other branches
- 7.3 getdirections.module \getdirections_is_mobile()
1 call to getdirections_is_mobile()
File
- ./
getdirections.module, line 1860 - Fetches google map directions.
Code
function getdirections_is_mobile() {
$getdirections_misc_defaults = getdirections_misc_defaults();
if (!$getdirections_misc_defaults['geolocation_mobile_check']) {
return TRUE;
}
$getdirections_ua = getdirections_ua_get();
$str = "/" . $getdirections_ua['ua_string'] . "/i";
$is_mobile = FALSE;
$ua = $_SERVER['HTTP_USER_AGENT'];
if (preg_match($str, $ua)) {
$is_mobile = TRUE;
}
return $is_mobile;
}