You are here

function themekey_ui_themekey_properties in ThemeKey 6.2

Same name and namespace in other branches
  1. 6.4 themekey_ui.module \themekey_ui_themekey_properties()
  2. 6.3 themekey_ui.module \themekey_ui_themekey_properties()
  3. 7.3 themekey_ui.module \themekey_ui_themekey_properties()
  4. 7 themekey_ui.module \themekey_ui_themekey_properties()
  5. 7.2 themekey_ui.module \themekey_ui_themekey_properties()

Implements hook_themekey_properties()

Provides additional properties for module ThemeKey: themekey_ui:node_triggers_theme

Return value

array of themekey properties

File

./themekey_ui.module, line 35
ThemeKey UI is an extension for ThemeKey

Code

function themekey_ui_themekey_properties() {

  // Attributes for properties
  $attributes = array();
  $attributes['themekey_ui:node_triggers_theme'] = array(
    'description' => t("Property themekey_ui:node_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/settings/themekey/settings/ui'),
    )),
    'static' => TRUE,
  );
  $attributes['themekey_ui:node_author_triggers_theme'] = array(
    'description' => t("Property themekey_ui:node_author_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 the author selected for his nodes in his user profile.", array(
      '!link' => l(t('Show theme option in user profile'), 'admin/settings/themekey/settings/ui'),
    )),
    'static' => TRUE,
  );

  // Mapping functions
  $maps = array();
  $maps[] = array(
    'src' => 'node:nid',
    'dst' => 'themekey_ui:node_triggers_theme',
    'callback' => 'themekey_ui_nid2theme',
  );
  $maps[] = array(
    'src' => 'node:nid',
    'dst' => 'themekey_ui:node_author_triggers_theme',
    'callback' => 'themekey_ui_author2theme',
  );
  return array(
    'attributes' => $attributes,
    'maps' => $maps,
  );
}