simplemenu_devel.module 751 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * @file
  4. * Prepend the devel menu to Simplemenu.
  5. */
  6. /**
  7. * Implementation of hook_simplemenu_tree_alter()
  8. */
  9. function simplemenu_devel_simplemenu_tree_alter(&$tree) {
  10. if (user_access('access devel information')) {
  11. $devel = array(
  12. 'link' => array(
  13. 'mlid' => 0,
  14. 'menu_name' => 'devel',
  15. 'hidden' => FALSE,
  16. 'title' => t('Devel module'),
  17. 'href' => 'admin/settings/devel',
  18. 'in_active_trail' => FALSE,
  19. 'has_children' => TRUE,
  20. 'localized_options' => array(
  21. 'attributes' => array('id' => 'simplemenu_devel'),
  22. ),
  23. ),
  24. 'below' => simplemenu_menu_tree('devel:0'),
  25. );
  26. array_unshift($tree, $devel);
  27. }
  28. }
  29. // vim: ts=2 sw=2 et syntax=php