You are here

function mobile_tools_devicecapability in Mobile Tools 6.2

Same name and namespace in other branches
  1. 5 mobile_tools.module \mobile_tools_devicecapability()
  2. 6.3 mobile_tools.module \mobile_tools_devicecapability()
  3. 6 mobile_tools.module \mobile_tools_devicecapability()
  4. 7.2 mobile_tools.module \mobile_tools_devicecapability()

Inspect a certain capability of the current user agent.

Parameters

string: The capability to check for. Example: 'is_wireless_device' or 'resolution_width'.

Return value

mixed The value of the capability. Example: FALSE or 500px.

File

./mobile_tools.module, line 494
Primarily Drupal hooks.

Code

function mobile_tools_devicecapability($capability) {
  static $device_capability;
  if (!isset($device_capability)) {
    $module = variable_get('mobile-tools-device-capabilities', NULL);
    if (isset($module)) {
      drupal_load('module', $module);
      $device_capability = module_invoke($module, 'determine_device_capability', $capability);
    }
    else {
      $device_capability = array();
    }
  }
  return $device_capability;
}