You are here

function themekey_mobile_detect_themekey_properties in ThemeKey 7.3

Implements hook_themekey_properties().

Provides additional properties for the ThemeKey module:

  • mobile_detect:is...

Return value

array of themekey properties and mapping functions

File

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

Code

function themekey_mobile_detect_themekey_properties() {
  $properties = array(
    'attributes' => array(),
    'maps' => array(),
  );
  if (!module_exists('mobile_detect_api')) {
    if ($mobile_detect = mobile_detect_get_object()) {
      require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'themekey') . '/modules/themekey.mobile_detect_api.inc';
      $properties = themekey_mobile_detect_api_themekey_properties_helper($mobile_detect);
      foreach ($properties['maps'] as &$map) {
        $map['callback'] = 'themekey_mobile_detect_dummy2rule';
      }
    }
  }
  return $properties;
}