editmenu_devel.module 765 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * @file
  4. * Prepend the devel menu to Editmenu.
  5. */
  6. /**
  7. * Implementation of hook_editmenu_tree_alter()
  8. */
  9. function editmenu_devel_editmenu_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. 'access' => TRUE,
  17. 'title' => t('Devel module'),
  18. 'href' => 'admin/settings/devel',
  19. 'in_active_trail' => FALSE,
  20. 'has_children' => TRUE,
  21. 'localized_options' => array(
  22. 'attributes' => array('id' => 'editmenu_devel'),
  23. ),
  24. ),
  25. 'below' => editmenu_menu_tree('devel:0'),
  26. );
  27. array_unshift($tree, $devel);
  28. }
  29. }
  30. // vim: ts=2 sw=2 et syntax=php