You are here

function mobile_tools_is_mobile_device in Mobile Tools 6

Same name and namespace in other branches
  1. 5 mobile_tools.module \mobile_tools_is_mobile_device()
  2. 6.3 mobile_tools.module \mobile_tools_is_mobile_device()
  3. 6.2 mobile_tools.module \mobile_tools_is_mobile_device()

Detect the device

Return value

$device The $device object. Other modules can implement the hook_is_mobile_device()

2 calls to mobile_tools_is_mobile_device()
mobile_tools_get_device in ./mobile_tools.module
Get $device object. Check if the 'device' argument is present or a cookie is set to overwrite the device:
mobile_tools_is_mobile_ctools_access_check in plugins/access/is_mobile.inc
Check for access.

File

./mobile_tools.module, line 309
Mobile Tools provides a range of functionality assisting in creating a mobile Drupal site . this functionality contains:

Code

function mobile_tools_is_mobile_device() {
  $device_detection = variable_get('mobile-tools-device-detection', 'mobile_tools');
  drupal_load('module', $device_detection);
  if ($device_detection != 'mobile_tools') {
    return module_invoke($device_detection, 'is_mobile_device');
  }
  else {
    return _mobile_tools_is_mobile_device();
  }
}