function tour_toolbar
tour_toolbar()
Implements hook_toolbar().
File
- core/modules/tour/tour.module, line 33
- Main functions of the module.
Code
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'), 'role' => 'button', 'aria-pressed' => 'false', ), ), '#wrapper_attributes' => array( 'class' => array('tour-toolbar-tab', 'hidden'), 'id' => 'toolbar-tab-tour', ), '#attached' => array( 'library' => array( 'tour/tour', ), ), ); return $items; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!tour!tour.module/function/tour_toolbar/8.1.x