contextual.api.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * @file
  4. * Hooks provided by Contextual module.
  5. */
  6. /**
  7. * @addtogroup hooks
  8. * @{
  9. */
  10. /**
  11. * Alter a contextual links element before it is rendered.
  12. *
  13. * This hook is invoked by contextual_pre_render_links(). The renderable array
  14. * of #type 'contextual_links', containing the entire contextual links data that
  15. * is passed in by reference. Further links may be added or existing links can
  16. * be altered.
  17. *
  18. * @param $element
  19. * A renderable array representing the contextual links.
  20. * @param $items
  21. * An associative array containing the original contextual link items, as
  22. * generated by menu_contextual_links(), which were used to build
  23. * $element['#links'].
  24. *
  25. * @see hook_menu_contextual_links_alter()
  26. * @see contextual_pre_render_links()
  27. * @see contextual_element_info()
  28. */
  29. function hook_contextual_links_view_alter(&$element, $items) {
  30. // Add another class to all contextual link lists to facilitate custom
  31. // styling.
  32. $element['#attributes']['class'][] = 'custom-class';
  33. }
  34. /**
  35. * @} End of "addtogroup hooks".
  36. */