You are here

function themekey_mobile_detect_dummy2rule in ThemeKey 7.3

ThemeKey mapping function to set a ThemeKey property's value (destination) with the aid of another ThemeKey property (source).

src: system:dummy dst: mobile_detect:is...

Parameters

$nid: a node id

$args: array, keys required:

  • 'method'

Return value

string 'true' or 'false' or NULL if mobile_detect is not available

1 string reference to 'themekey_mobile_detect_dummy2rule'
themekey_mobile_detect_themekey_properties in modules/themekey.mobile_detect.inc
Implements hook_themekey_properties().

File

modules/themekey.mobile_detect.inc, line 58
Provides mobile_detect rules as ThemeKey properties.

Code

function themekey_mobile_detect_dummy2rule($nid, $args) {
  if ($mobile_detect = mobile_detect_get_object()) {
    return $mobile_detect
      ->{$args['method']}() ? 'true' : 'false';
  }
  return NULL;
}