You are here

function getdirections_is_mobile in Get Directions 7.3

Same name and namespace in other branches
  1. 7.2 getdirections.module \getdirections_is_mobile()
1 call to getdirections_is_mobile()
theme_getdirections_direction_form in ./getdirections.module
Themes the getdirections form.

File

./getdirections.module, line 1959
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;
}