admin_devel.module

  1. nittany7 modules/contrib/admin_menu/admin_devel/admin_devel.module
  2. cis7 modules/contrib/admin_menu/admin_devel/admin_devel.module
  3. mooc7 modules/contrib/admin_menu/admin_devel/admin_devel.module

Administration and debugging functionality for developers and site builders.

Functions

Namesort descending Description
admin_devel_form_admin_menu_theme_settings_alter Implements hook_form_FORMID_alter().
admin_devel_form_admin_menu_theme_settings_alter_rebuild_submit Form submit handler to wipe and rebuild all 'module' = 'system' menu links.

File

modules/contrib/admin_menu/admin_devel/admin_devel.module
View source
  1. <?php
  2. /**
  3. * @file
  4. * Administration and debugging functionality for developers and site builders.
  5. */
  6. /**
  7. * Implements hook_form_FORMID_alter().
  8. */
  9. function admin_devel_form_admin_menu_theme_settings_alter(&$form, &$form_state) {
  10. $form['actions']['wipe_rebuild'] = array(
  11. '#type' => 'submit',
  12. '#value' => t('Rebuild system links'),
  13. '#submit' => array('admin_devel_form_admin_menu_theme_settings_alter_rebuild_submit'),
  14. // @todo Not necessarily ready for mass-consumption yet.
  15. '#access' => FALSE,
  16. );
  17. }
  18. /**
  19. * Form submit handler to wipe and rebuild all 'module' = 'system' menu links.
  20. */
  21. function admin_devel_form_admin_menu_theme_settings_alter_rebuild_submit($form, &$form_state) {
  22. // Delete all auto-generated menu links derived from menu router items.
  23. db_delete('menu_links')
  24. ->condition('module', 'system')
  25. ->execute();
  26. // Rebuild menu links from current menu router items.
  27. menu_rebuild();
  28. drupal_set_message(t('System links derived from menu router paths have been rebuilt.'));
  29. }