function themekey_mobile_detect_api_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_api_dummy2rule'
- themekey_mobile_detect_api_themekey_properties_helper in modules/
themekey.mobile_detect_api.inc - Re-usable helper function to create the mobile_detect:is... properties.
File
- modules/
themekey.mobile_detect_api.inc, line 91 - Provides mobile_detect rules as ThemeKey properties.
Code
function themekey_mobile_detect_api_dummy2rule($nid, $args) {
if ($mobile_detect = mobile_detect_api_get_instance()) {
return $mobile_detect
->{$args['method']}() ? 'true' : 'false';
}
return NULL;
}