tour_toolbar()
Implements hook_toolbar().
File
- core/modules/tour/tour.module, line 34
- Main functions of the module.
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | function tour_toolbar() { $items = []; $items [ 'tour' ] = [ '#cache' => [ 'contexts' => [ 'user.permissions' , ], ], ]; if (!\Drupal::currentUser()->hasPermission( 'access tour' )) { return $items ; } $items [ 'tour' ] += array ( '#type' => 'toolbar_item' , 'tab' => array ( '#type' => 'html_tag' , '#tag' => 'button' , '#value' => t( 'Tour' ), '#attributes' => array ( 'class' => array ( 'toolbar-icon' , 'toolbar-icon-help' ), 'aria-pressed' => 'false' , ), ), '#wrapper_attributes' => array ( 'class' => array ( 'tour-toolbar-tab' , 'hidden' ), 'id' => 'toolbar-tab-tour' , ), '#attached' => array ( 'library' => array ( 'tour/tour' , ), ), ); return $items ; } |
Please login to continue.