You are here

function themekey_ui_author2theme in ThemeKey 7.3

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

This function implements the interface of a ThemeKey mapping function but doesn't set a ThemeKey property's value. It sets the Drupal static themekey_custom_theme which will cause ThemeKey to use this theme.

Parameters

$uid: the user's id

Return value

string "static" if global custom theme has been set or NULL if no theme has been assigned to the contact form

3 calls to themekey_ui_author2theme()
themekey_blog_author2theme in modules/themekey.blog.inc
This function implements the interface of a ThemeKey mapping function but doesn't set a ThemeKey property's value. It sets the Drupal static themekey_custom_theme which will cause ThemeKey to use this theme.
themekey_contact_uid2theme in modules/themekey.contact.inc
This function implements the interface of a ThemeKey mapping function but doesn't set a ThemeKey property's value. It sets the Drupal static themekey_custom_theme which will cause ThemeKey to use this theme.
themekey_user_profile2theme in modules/themekey.user.inc
This function implements the interface of a ThemeKey mapping function but doesn't set a ThemeKey property's value. It sets the Drupal static themekey_custom_theme which will cause ThemeKey to use this theme.

File

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

Code

function themekey_ui_author2theme($uid) {
  $custom_theme =& drupal_static('themekey_custom_theme', '');
  $query = db_select('themekey_ui_author_theme', 'tuat')
    ->fields('tuat', array(
    'theme',
  ))
    ->condition('tuat.uid', $uid);
  if ($theme = $query
    ->execute()
    ->fetchField()) {
    if ('default' != $theme && themekey_check_theme_enabled($theme)) {
      $custom_theme = $theme;
      return 'static';
    }
  }
  return NULL;
}