You are here

function jquery_carousel_examples_toolbar in jQuery carousel 8

Implements hook_toolbar().

File

jquery_carousel_examples/jquery_carousel_examples.module, line 13
Provide jquery carousel style plugin for views.

Code

function jquery_carousel_examples_toolbar() {
  $items = array();

  // Load the menu.
  $jquery_carousel_example_menu_tree = Drupal::service('toolbar.menu_tree')
    ->load('jquery-carousel-examples', new Drupal\Core\Menu\MenuTreeParameters());

  // Build the menu render array.
  $jquery_carousel_example_menu = Drupal::service('toolbar.menu_tree')
    ->build($jquery_carousel_example_menu_tree);
  $items['jquery_carousel_examples'] = array(
    '#type' => 'toolbar_item',
    'tab' => array(
      '#type' => 'link',
      '#title' => t('jQuery Carousel Examples'),
      '#url' => Url::fromRoute('<front>'),
    ),
    'tray' => array(
      '#heading' => t('jQuery Carousel Examples'),
      'jquery_carousel_examples_menu' => $jquery_carousel_example_menu,
    ),
    '#weight' => 100,
  );
  return $items;
}