Index: admin_menu.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/admin_menu/admin_menu.inc,v
retrieving revision 1.11.2.5
diff -u -p -r1.11.2.5 admin_menu.inc
--- admin_menu.inc	14 Jun 2008 23:29:55 -0000	1.11.2.5
+++ admin_menu.inc	16 Jun 2008 15:33:11 -0000
@@ -242,9 +242,9 @@ function admin_menu_admin_menu(&$deleted
     }
   }
   // Add developer modules toggle link.
-  $current_state = variable_get('admin_menu_devel_modules_enabled', NULL);
+  $saved_state = variable_get('admin_menu_devel_modules_enabled', NULL);
   $links[] = array(
-    'title' => isset($current_state) ? t('Re-enable developer modules') : t('Disable developer modules'),
+    'title' => isset($saved_state) ? t('Re-enable developer modules') : t('Disable developer modules'),
     'path' => 'admin_menu/toggle-modules',
     'weight' => 88,
     'parent_path' => $icon_path,
@@ -357,12 +357,14 @@ function admin_menu_theme_settings() {
  * on larger Drupal sites this is actually a 10% performance increase.
  */
 function admin_menu_toggle_modules() {
+  $rebuild = FALSE;
   $saved_state = variable_get('admin_menu_devel_modules_enabled', NULL);
   if (isset($saved_state)) {
     // Re-enable modules that were enabled before.
     module_enable($saved_state);
     variable_del('admin_menu_devel_modules_enabled');
-    drupal_set_message(t('Re-enabled these modules: !module_list', array('!module_list' => implode(', ', $saved_state))));
+    drupal_set_message(t('Re-enabled these modules: !module-list.', array('!module-list' => implode(', ', $saved_state))));
+    $rebuild = TRUE;
   }
   else {
     // Allow site admins to override this variable via settings.php.
@@ -373,14 +375,25 @@ function admin_menu_toggle_modules() {
       variable_set('admin_menu_devel_modules_enabled', $devel_modules);
       // Disable developer modules.
       module_disable($devel_modules);
-      drupal_set_message(t('Disabled these modules: !module_list', array('!module_list' => implode(', ', $devel_modules))));
+      drupal_set_message(t('Disabled these modules: !module-list.', array('!module-list' => implode(', ', $devel_modules))));
+      $rebuild = TRUE;
     }
     else {
-      drupal_set_message(t('No developer modules are active'));
+      drupal_set_message(t('No developer modules are enabled.'));
     }
   }
-  // Rebuild the admin menu.
-  variable_set('admin_menu_rebuild_links', TRUE);
+  if ($rebuild) {
+    // Make sure everything is rebuilt, basically a combination of the calls
+    // from system_modules() and system_modules_submit().
+    drupal_rebuild_theme_registry();
+    menu_rebuild();
+    cache_clear_all('schema', 'cache');
+    cache_clear_all();
+    drupal_clear_css_cache();
+    drupal_clear_js_cache();
+    // Synchronize to catch any actions that were added or removed.
+    actions_synchronize();
+  }
   drupal_goto('');
 }
 
Index: admin_menu.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/admin_menu/admin_menu.install,v
retrieving revision 1.4.2.2
diff -u -p -r1.4.2.2 admin_menu.install
--- admin_menu.install	14 Jun 2008 23:29:55 -0000	1.4.2.2
+++ admin_menu.install	16 Jun 2008 15:33:11 -0000
@@ -11,6 +11,8 @@ function admin_menu_uninstall() {
   // Delete variables.
   variable_del('admin_menu_rebuild_links');
   variable_del('admin_menu_devel_modules_enabled');
+  variable_del('admin_menu_margin_top');
+  variable_del('admin_menu_tweak_modules');
 }
 
 /**
@@ -24,7 +26,7 @@ function admin_menu_update_6000() {
   // Drop the {admin_menu} table in admin_menu_update_6000() on sites that used
   // one of the later patches in #132524.
   if (db_table_exists('admin_menu')) {
-    $ret = update_sql("DROP TABLE {admin_menu}");
+    $ret[] = update_sql("DROP TABLE {admin_menu}");
   }
   return $ret;
 }
Index: admin_menu.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/admin_menu/admin_menu.module,v
retrieving revision 1.43.2.3
diff -u -p -r1.43.2.3 admin_menu.module
--- admin_menu.module	14 Jun 2008 23:29:55 -0000	1.43.2.3
+++ admin_menu.module	16 Jun 2008 15:37:21 -0000
@@ -56,28 +56,6 @@ function admin_menu_theme() {
 }
 
 /**
- * Implementation of hook_init().
- *
- * We can't move this into admin_menu_footer(), because PHP-only based themes
- * like chameleon load and output scripts and stylesheets in front of
- * theme_closure(), so we ensure Admin menu's styles and scripts are loaded on
- * all pages via hook_init().
- */
-function admin_menu_init() {
-  if (user_access('access administration menu')) {
-    $path = drupal_get_path('module', 'admin_menu');
-    drupal_add_css($path .'/admin_menu.css', 'module', 'all', FALSE);
-    // Performance: Defer execution.
-    drupal_add_js($path .'/admin_menu.js', 'module', 'header', TRUE);
-
-    drupal_add_js(array('admin_menu' => array('margin_top' => variable_get('admin_menu_margin_top', 1))), 'setting');
-    if ($_GET['q'] == 'admin/build/modules') {
-      drupal_add_js(array('admin_menu' => array('tweak_modules' => variable_get('admin_menu_tweak_modules', 1))), 'setting');
-    }
-  }
-}
-
-/**
  * Implementation of hook_menu().
  */
 function admin_menu_menu() {
@@ -100,6 +78,28 @@ function admin_menu_menu() {
 }
 
 /**
+ * Implementation of hook_init().
+ *
+ * We can't move this into admin_menu_footer(), because PHP-only based themes
+ * like chameleon load and output scripts and stylesheets in front of
+ * theme_closure(), so we ensure Admin menu's styles and scripts are loaded on
+ * all pages via hook_init().
+ */
+function admin_menu_init() {
+  if (user_access('access administration menu')) {
+    $path = drupal_get_path('module', 'admin_menu');
+    drupal_add_css($path .'/admin_menu.css', 'module', 'all', FALSE);
+    // Performance: Defer execution.
+    drupal_add_js($path .'/admin_menu.js', 'module', 'header', TRUE);
+
+    drupal_add_js(array('admin_menu' => array('margin_top' => variable_get('admin_menu_margin_top', 1))), 'setting');
+    if ($_GET['q'] == 'admin/build/modules') {
+      drupal_add_js(array('admin_menu' => array('tweak_modules' => variable_get('admin_menu_tweak_modules', 1))), 'setting');
+    }
+  }
+}
+
+/**
  * Implementation of hook_footer().
  *
  * Admin menu was previously output via hook_block(), but suffered from
@@ -113,7 +113,7 @@ function admin_menu_menu() {
 function admin_menu_footer($main = 0) {
   // Check for the flag indicating that we need to rebuild.
   if (variable_get('admin_menu_rebuild_links', FALSE)) {
-    include_once(drupal_get_path('module', 'admin_menu') . '/admin_menu.inc');
+    module_load_include('inc', 'admin_menu');
     _admin_menu_rebuild_links();
     variable_del('admin_menu_rebuild_links');
   }
@@ -191,7 +191,7 @@ function theme_admin_menu_item($link, $h
  * Extends Devel module with Administration Menu developer settings.
  */
 function admin_menu_form_devel_admin_settings_alter(&$form, $form_state) {
-  include_once(drupal_get_path('module', 'admin_menu') .'/admin_menu.inc');
+  module_load_include('inc', 'admin_menu');
   _admin_menu_devel_settings_form_alter($form, $form_state);
 }
 
