comparison core/modules/contextual/contextual.api.php @ 0:c75dbcec494b

Initial commit from drush-created site
author Chris Cannam
date Thu, 05 Jul 2018 14:24:15 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:c75dbcec494b
1 <?php
2
3 /**
4 * @file
5 * Hooks provided by Contextual module.
6 */
7
8 /**
9 * @addtogroup hooks
10 * @{
11 */
12
13 /**
14 * Alter a contextual links element before it is rendered.
15 *
16 * This hook is invoked by contextual_pre_render_links(). The renderable array
17 * of #type 'contextual_links', containing the entire contextual links data that
18 * is passed in by reference. Further links may be added or existing links can
19 * be altered.
20 *
21 * @param $element
22 * A renderable array representing the contextual links.
23 * @param $items
24 * An associative array containing the original contextual link items, as
25 * generated by
26 * \Drupal\Core\Menu\ContextualLinkManagerInterface::getContextualLinksArrayByGroup(),
27 * which were used to build $element['#links'].
28 *
29 * @see hook_contextual_links_alter()
30 * @see hook_contextual_links_plugins_alter()
31 * @see contextual_pre_render_links()
32 */
33 function hook_contextual_links_view_alter(&$element, $items) {
34 // Add another class to all contextual link lists to facilitate custom
35 // styling.
36 $element['#attributes']['class'][] = 'custom-class';
37 }
38
39 /**
40 * @} End of "addtogroup hooks".
41 */