function quickbar_is_enabled in Quickbar 7
Same name and namespace in other branches
- 6 quickbar.module \quickbar_is_enabled()
- 7.2 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 182
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')) {
$data = unserialize($user->data);
if (isset($data['admin_select'])) {
if ($data['admin_select'] !== 'quickbar') {
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'] !== 0) {
return TRUE;
}
return FALSE;
}