function quickbar_is_enabled in Quickbar 7.2
Same name and namespace in other branches
- 6 quickbar.module \quickbar_is_enabled()
- 7 quickbar.module \quickbar_is_enabled()
Wrapper to check whether various quickbar features are accessible to the current user and compatible with the current theme.
2 calls to quickbar_is_enabled()
- quickbar_available in ./
quickbar.module - Helper for returning whether a quickbar toolbar should be displayed based on uid and settings.
- quickbar_init in ./
quickbar.module - Implements hook_init().
File
- ./
quickbar.module, line 184
Code
function quickbar_is_enabled() {
global $user;
// If admin_select module exists respect it's settings to determine if the
// toolbar is shown.
if (module_exists('admin_select') && !empty($user->data['admin_select']) && $user->data['admin_select'] !== 'quickbar') {
// anonymous user / drush doesn't have a data array
return FALSE;
}
global $theme_info;
// If the theme does not specify some flag for this feature, assume
// it is compatible.
if (!isset($theme_info->info['quickbar']) || $theme_info->info['quickbar']) {
return TRUE;
}
return FALSE;
}