function themekey_user_profile_uid2profile_theme in ThemeKey 7.2
Same name and namespace in other branches
- 7.3 themekey_user_profile.module \themekey_user_profile_uid2profile_theme()
- 7 themekey_user_profile.module \themekey_user_profile_uid2profile_theme()
Set custom theme from given user id (uid)
Parameters
$uid user id:
Return value
null|string
1 string reference to 'themekey_user_profile_uid2profile_theme'
File
- ./
themekey_user_profile.module, line 145 - 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_uid2profile_theme($uid) {
$custom_theme =& drupal_static('themekey_custom_theme', '');
$theme = db_select('users', 'u')
->fields('u', array(
'theme',
))
->condition('uid', $uid)
->execute()
->fetchField();
if ('default' != $theme) {
if (themekey_check_theme_enabled($theme)) {
$custom_theme = $theme;
return 'static';
}
}
return NULL;
}