You are here

function varbase_toolbar_alter in Varbase: The Ultimate Drupal CMS Starter Kit (Bootstrap Ready) 8.5

Same name and namespace in other branches
  1. 8.8 varbase.profile \varbase_toolbar_alter()
  2. 8.4 varbase.profile \varbase_toolbar_alter()
  3. 8.6 varbase.profile \varbase_toolbar_alter()
  4. 8.7 varbase.profile \varbase_toolbar_alter()
  5. 9.0.x varbase.profile \varbase_toolbar_alter()

Implements hook_toolbar_alter().

File

./varbase.profile, line 500
Enables modules and site configuration for a Varbase site installation.

Code

function varbase_toolbar_alter(&$items) {
  if (\Drupal::currentUser()
    ->hasPermission('access toolbar') && !empty($items['admin_toolbar_tools'])) {
    $items['admin_toolbar_tools']['#attached']['library'][] = 'varbase/toolbar.icon';
  }
}