function toolbar_preprocess_html
Same name in other branches
- 7.x modules/toolbar/toolbar.module \toolbar_preprocess_html()
- 8.9.x core/modules/toolbar/toolbar.module \toolbar_preprocess_html()
- 10 core/modules/toolbar/toolbar.module \toolbar_preprocess_html()
- 11.x core/modules/toolbar/toolbar.module \toolbar_preprocess_html()
Implements hook_preprocess_HOOK() for HTML document templates.
File
-
core/
modules/ toolbar/ toolbar.module, line 251
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';
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.