function toolbar_preprocess_html in Drupal 10
Same name and namespace in other branches
- 8 core/modules/toolbar/toolbar.module \toolbar_preprocess_html()
- 7 modules/toolbar/toolbar.module \toolbar_preprocess_html()
- 9 core/modules/toolbar/toolbar.module \toolbar_preprocess_html()
Implements hook_preprocess_HOOK() for HTML document templates.
File
- core/
modules/ toolbar/ toolbar.module, line 251 - Administration toolbar for quick access to top level administration items.
Code
function toolbar_preprocess_html(&$variables) {
if (!\Drupal::currentUser()
->hasPermission('access toolbar')) {
return;
}
$variables['attributes']['class'][] = 'toolbar-tray-open';
$variables['attributes']['class'][] = 'toolbar-horizontal';
$variables['attributes']['class'][] = 'toolbar-fixed';
$variables['attributes']['class'][] = 'toolbar-loading';
}