jquery_carousel_examples.module in jQuery carousel 8
Provide jquery carousel style plugin for views.
File
jquery_carousel_examples/jquery_carousel_examples.moduleView source
<?php
/**
* @file
* Provide jquery carousel style plugin for views.
*/
use Drupal\Core\Url;
/**
* Implements hook_toolbar().
*/
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;
}
Functions
Name | Description |
---|---|
jquery_carousel_examples_toolbar | Implements hook_toolbar(). |