action-links.theme.inc 697 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * @file
  4. * Theme function for wrapping menu local actions.
  5. */
  6. /**
  7. * Delegated implementation of hook_theme()
  8. */
  9. function ctools_action_links_theme(&$items) {
  10. $items['ctools_menu_local_actions_wrapper'] = array(
  11. 'render element' => 'links',
  12. 'file' => 'includes/action-links.theme.inc',
  13. );
  14. }
  15. /**
  16. * Render a menu local actions wrapper.
  17. *
  18. * @param $links
  19. * Local actions links.
  20. * @param $attributes
  21. * An array of attributes to append to the wrapper.
  22. */
  23. function theme_ctools_menu_local_actions_wrapper($variables) {
  24. $links = drupal_render($variables['links']);
  25. if (empty($links)) {
  26. return;
  27. }
  28. return '<ul class="action-links">' . $links . '</ul>';
  29. }