You are here

function themekey_blog_themekey_properties in ThemeKey 7.2

Same name and namespace in other branches
  1. 7.3 modules/themekey.blog.inc \themekey_blog_themekey_properties()

Implements hook_themekey_properties().

Provides additional properties for the ThemeKey module: themekey_ui:node_triggers_theme themekey_ui:node_author_triggers_theme

Return value

array of themekey properties

File

modules/themekey.blog.inc, line 27
@author Markus Kalkbrenner | bio.logis GmbH

Code

function themekey_blog_themekey_properties() {

  // Attributes for properties
  $attributes = array();
  $attributes['blog:uid'] = array(
    'description' => t('Blog: User ID - The id of the user (uid) who owns the blog.'),
    'validator' => 'themekey_validator_ctype_digit',
    'page cache' => THEMEKEY_PAGECACHE_SUPPORTED,
  );
  if (module_exists('themekey_ui')) {
    $attributes['themekey_ui:blog_author_triggers_theme'] = array(
      'description' => t("The property, themekey_ui:blog_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 her nodes in her user profile. This property is an addition to themekey_ui:node_author_triggers_theme to cover the automatically generated blog pages as well.", array(
        '!link' => l(t('Let the user select a theme for her blog pages'), 'admin/config/user-interface/themekey/settings/ui'),
      )),
      'page cache' => THEMEKEY_PAGECACHE_SUPPORTED,
      'static' => TRUE,
    );
  }

  // Mapping functions
  $maps = array();
  $maps[] = array(
    'src' => 'node:nid',
    'dst' => 'blog:uid',
    'callback' => 'themekey_blog_nid2uid',
  );
  $maps[] = array(
    'src' => 'blog:uid',
    'dst' => 'themekey_ui:blog_author_triggers_theme',
    'callback' => 'themekey_blog_author2theme',
  );
  return array(
    'attributes' => $attributes,
    'maps' => $maps,
  );
}