--- /Users/chellman/Downloads/admin_menu/admin_menu.module 2009-10-13 08:00:57.000000000 -0500 +++ /Users/chellman/Sites/drupal6/sites/default/modules/admin_menu/admin_menu.module 2009-10-20 10:49:13.000000000 -0500 @@ -253,14 +253,11 @@ function admin_menu_menu_link_alter(&$it } /** - * Implementation of hook_init(). + * Implementation of hook_preprocess_page(). * - * 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(). + * Moved from hook_init() to prevent undesired loading and other issues. */ -function admin_menu_init() { +function admin_menu_preprocess_page(&$variables) { if (!user_access('access administration menu') || admin_menu_suppress(FALSE)) { return; } @@ -314,6 +311,9 @@ function admin_menu_init() { } drupal_add_js(array('admin_menu' => $settings), 'setting'); + + $variables['scripts'] = drupal_get_js(); + $variables['styles'] = drupal_get_css(); } /**