You are here

function themekey_ui_themekey_properties in ThemeKey 7.3

Same name and namespace in other branches
  1. 6.4 themekey_ui.module \themekey_ui_themekey_properties()
  2. 6.2 themekey_ui.module \themekey_ui_themekey_properties()
  3. 6.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 the ThemeKey module: themekey_ui:node_triggers_theme themekey_ui:author_triggers_theme

Return value

array of themekey properties

File

./themekey_ui.module, line 36
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("The 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/config/user-interface/themekey/settings/ui'),
    )),
    'page cache' => THEMEKEY_PAGECACHE_SUPPORTED,
    'static' => TRUE,
  );
  $attributes['themekey_ui:author_triggers_theme'] = array(
    'description' => t("The property, themekey_ui: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 in her user profile for own content, a contact form or blog pages.", array(
      '!link' => l(t('Let the user select a theme that will be used to display all content she creates.'), 'admin/config/user-interface/themekey/settings/ui'),
    )),
    'page cache' => THEMEKEY_PAGECACHE_SUPPORTED,
    '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:author_triggers_theme',
    'callback' => 'themekey_ui_node_author2theme',
  );
  return array(
    'attributes' => $attributes,
    'maps' => $maps,
  );
}