function themekey_blog_author2theme in ThemeKey 7.2
Same name and namespace in other branches
- 7.3 modules/themekey.blog.inc \themekey_blog_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: a uid, current value of ThemeKey property blog:uid
Return value
string "static" if global custom theme has been set or NULL if no theme has been assigned to the node
1 string reference to 'themekey_blog_author2theme'
- themekey_blog_themekey_properties in modules/
themekey.blog.inc - Implements hook_themekey_properties().
File
- modules/
themekey.blog.inc, line 115 - @author Markus Kalkbrenner | bio.logis GmbH
Code
function themekey_blog_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;
}