You are here

function themekey_compat_themekey_properties in ThemeKey 7

Same name and namespace in other branches
  1. 7.3 themekey_compat.module \themekey_compat_themekey_properties()
  2. 7.2 themekey_compat.module \themekey_compat_themekey_properties()

Implements hook_themekey_properties().

Provides additional properties for the ThemeKey module: themekey_compat:module_MODULE_triggers_theme

Return value

array of themekey properties

File

./themekey_compat.module, line 42
Integration of different theme switching modules into ThemeKey and it's theme switching rule chain.

Code

function themekey_compat_themekey_properties() {

  // Attributes for properties
  $attributes = array();

  // Mapping functions
  $maps = array();
  foreach (variable_get('themekey_compat_modules_enabled', array()) as $module) {
    $attributes['themekey_compat:module_' . $module . '_triggers_theme'] = array(
      'description' => t("The property, themekey_compat:module_' . {$module} . '_triggers_theme, could not be selected from the property drop-down. You get this static property by activating !link. Afterwards, you can move the property to any position in the rule chain. When done, it triggers the switch to the theme assigned to the current node using ThemeKey UI.", array(
        '!link' => l(t('Show theme option in create/edit node forms'), 'admin/config/user-interface/themekey/settings/ui'),
      )),
      'page cache' => THEMEKEY_PAGECACHE_SUPPORTED,
      'static' => TRUE,
    );
    $maps[] = array(
      'src' => 'system:dummy',
      'dst' => 'themekey_compat:module_' . $module . '_triggers_theme',
      'callback' => 'themekey_compat_dummy2theme',
      'args' => array(
        'module' => $module,
      ),
    );
  }
  return array(
    'attributes' => $attributes,
    'maps' => $maps,
  );
}