You are here

function themekey_user_profile_themekey_properties in ThemeKey 7.3

Same name and namespace in other branches
  1. 7 themekey_user_profile.module \themekey_user_profile_themekey_properties()
  2. 7.2 themekey_user_profile.module \themekey_user_profile_themekey_properties()

Implements hook_themekey_properties().

Provides additional properties for module ThemeKey: user:profile_theme

Return value

array of themekey properties

File

./themekey_user_profile.module, line 114
ThemeKey User Profile allows the user to select a personal theme in her user profile. This theme will be used to render the pages instead of the theme the administrator configured as soon as the user logs in.

Code

function themekey_user_profile_themekey_properties() {

  // Attributes for properties
  $attributes = array();
  $attributes['user:profile_triggers_theme'] = array(
    'description' => t("Property user:profile_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 a user profile using ThemeKey User Profile if the current user has selected a theme in her profile.", array(
      '!link' => l(t('Add theme option to user profile'), 'admin/config/user-interface/themekey/settings/ui'),
    )),
    'page cache' => THEMEKEY_PAGECACHE_SUPPORTED,
    'static' => TRUE,
  );

  // Mapping functions
  $maps = array();
  $maps[] = array(
    'src' => 'user:uid',
    'dst' => 'user:profile_triggers_theme',
    'callback' => 'themekey_user_profile_uid2profile_theme',
  );
  return array(
    'attributes' => $attributes,
    'maps' => $maps,
  );
}