Index: admin_warning.admin.inc
===================================================================
RCS file: admin_warning.admin.inc
diff -N admin_warning.admin.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ admin_warning.admin.inc	3 Feb 2009 00:45:46 -0000
@@ -0,0 +1,71 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Code that is only expected to run when administrators are viewing the site.
+ */
+
+/**
+ * Menu callback; returns the page for configuring the administrator warning
+ * settings.
+ */
+function admin_warning_settings_page() {
+  return drupal_get_form('admin_warning_settings_form');
+}
+
+/**
+ * Returns a form for configuring the administrator warning settings.
+ */
+function admin_warning_settings_form() {
+  $form = array();
+  $form['admin_warning_message_text'] = array(
+    '#type' => 'textarea',
+    '#title' => t('Text of the warning message'),
+    '#description' => t('Enter the text that site administrators will see at the top of most forms on the site.'),
+    '#default_value' => admin_warning_settings('admin_warning_message_text'),
+  );
+  $form['admin_warning_excluded_form_ids'] = array(
+    '#type' => 'textarea',
+    '#title' => t('Form IDs to exclude the warning message from (advanced)'),
+    '#description' => t('Enter a list of form IDs for which the site administrator warning will <em>not</em> be shown. Put each form ID on a separate line. The site administrator warning will be shown at the top of all forms except those listed here.'),
+    '#default_value' => admin_warning_settings('admin_warning_excluded_form_ids'),
+  );
+  return system_settings_form($form);
+}
+
+/**
+ * Themes the warning message that is shown to administrators at the top of
+ * most forms on the site.
+ *
+ * @param $message
+ *   The text of the warning message.
+ * @return
+ *   Themed HTML output.
+ *
+ * @ingroup themeable
+ */
+function theme_admin_warning_message($message) {
+  // Since this CSS will potentially be shown to a few users but on many
+  // different pages, it is probably a bad idea to cache it.
+  drupal_add_css(drupal_get_path('module', 'admin_warning') .'/admin_warning.css', 'module', 'all', FALSE);
+  return '<div class="admin-warning-message">'. $message .'</div>';
+}
+
+/**
+ * Themes the help text on this module's administration page.
+ *
+ * @param $help_text
+ *   An array containing help text.
+ * @return
+ *   Themed HTML output.
+ *
+ * @ingroup themeable
+ */
+function theme_admin_warning_help($help_text) {
+  $output = '';
+  foreach ($help_text as $text) {
+    $output .= '<p>'. $text .'</p>';
+  }
+  return $output;
+}
Index: admin_warning.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/admin_warning/admin_warning.info,v
retrieving revision 1.1
diff -u -p -r1.1 admin_warning.info
--- admin_warning.info	2 Feb 2009 21:07:58 -0000	1.1
+++ admin_warning.info	3 Feb 2009 00:45:46 -0000
@@ -1,3 +1,4 @@
 ; $Id: admin_warning.info,v 1.1 2009/02/02 21:07:58 drothstein Exp $
 name = Administrator Warning
 description = Provides a warning to site administrators reminding them that they are logged in to the live site as administrators, not regular users.
+core = 6.x
Index: admin_warning.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/admin_warning/admin_warning.module,v
retrieving revision 1.1
diff -u -p -r1.1 admin_warning.module
--- admin_warning.module	2 Feb 2009 21:07:58 -0000	1.1
+++ admin_warning.module	3 Feb 2009 00:45:46 -0000
@@ -10,12 +10,12 @@
 /**
  * Implementation of hook_help().
  */
-function admin_warning_help($section) {
-  switch ($section) {
+function admin_warning_help($path, $arg) {
+  switch ($path) {
     case 'admin/settings/admin_warning':
       $help_text = array(
         t('The <em>Administrator Warning</em> module allows you to show site administrators a warning message above most forms on the site. It can be used to help prevent these users from accidentally making destructive changes, either because they forgot they were logged in as an administrator or because they forgot they were logged in to the live site (as opposed to a development server).'),
-        t('On this page, you can change the text of the warning message that site administrators see and configure a list of forms that you do not want the message to appear on. To configure the user roles who will see this message, assign these roles the "see the site administrator warning" permission on the <a href="@permissions_url">user permissions page</a>.', array('@permissions_url' => url('admin/user/access', NULL, 'module-admin_warning'))),
+        t('On this page, you can change the text of the warning message that site administrators see and configure a list of forms that you do not want the message to appear on. To configure the user roles who will see this message, assign these roles the "see the site administrator warning" permission on the <a href="@permissions_url">user permissions page</a>.', array('@permissions_url' => url('admin/user/permissions', array('fragment' => 'module-admin_warning')))),
       );
       return theme('admin_warning_help', $help_text);
       break;
@@ -35,52 +35,23 @@ function admin_warning_perm() {
 /**
  * Implementation of hook_menu().
  */
-function admin_warning_menu($may_cache) {
+function admin_warning_menu() {
   $items = array();
-  if ($may_cache) {
-    $items[] = array(
-      'path' => 'admin/settings/admin_warning',
-      'title' => t('Administrator warning message'),
-      'description' => t('Configure the warning message shown to site administrators.'),
-      'callback' => 'admin_warning_settings_page',
-      'access' => user_access('administer admin warning'),
-    );
-  }
-  return $items;
-}
-
-/**
- * Menu callback; returns the page for configuring the administrator warning
- * settings.
- */
-function admin_warning_settings_page() {
-  return drupal_get_form('admin_warning_settings_form');
-}
-
-/**
- * Returns a form for configuring the administrator warning settings.
- */
-function admin_warning_settings_form() {
-  $form = array();
-  $form['admin_warning_message_text'] = array(
-    '#type' => 'textarea',
-    '#title' => t('Text of the warning message'),
-    '#description' => t('Enter the text that site administrators will see at the top of most forms on the site.'),
-    '#default_value' => admin_warning_settings('admin_warning_message_text'),
-  );
-  $form['admin_warning_excluded_form_ids'] = array(
-    '#type' => 'textarea',
-    '#title' => t('Form IDs to exclude the warning message from (advanced)'),
-    '#description' => t('Enter a list of form IDs for which the site administrator warning will <em>not</em> be shown. Put each form ID on a separate line. The site administrator warning will be shown at the top of all forms except those listed here.'),
-    '#default_value' => admin_warning_settings('admin_warning_excluded_form_ids'),
+  $items['admin/settings/admin_warning'] = array(
+    'title' => 'Administrator warning message',
+    'description' => 'Configure the warning message shown to site administrators.',
+    'page callback' => 'admin_warning_settings_page',
+    'access callback' => 'user_access',
+    'access arguments' => array('administer admin warning'),
+    'file' => 'admin_warning.admin.inc',
   );
-  return system_settings_form($form);
+  return $items;
 }
 
 /**
  * Implementation of hook_form_alter().
  */
-function admin_warning_form_alter($form_id, &$form) {
+function admin_warning_form_alter(&$form, $form_state, $form_id) {
   // Only show the warning to site administrators viewing one of the
   // non-excluded forms.
   if (user_access('see the site administrator warning') && !in_array($form_id, admin_warning_excluded_forms())) {
@@ -127,6 +98,7 @@ function admin_warning_settings($variabl
         // default.
         'search_form',
         'search_block_form',
+        'search_theme_form',
       );
       $default_value = implode("\r", $default_excluded_form_ids);
       break;
@@ -137,37 +109,17 @@ function admin_warning_settings($variabl
 }
 
 /**
- * Themes the warning message that is shown to administrators at the top of
- * most forms on the site.
- *
- * @param $message
- *   The text of the warning message.
- * @return
- *   Themed HTML output.
- *
- * @ingroup themeable
- */
-function theme_admin_warning_message($message) {
-  // Since this CSS will potentially be shown to a few users but on many
-  // different pages, it is probably a bad idea to cache it.
-  drupal_add_css(drupal_get_path('module', 'admin_warning') .'/admin_warning.css', 'module', 'all', FALSE);
-  return '<div class="admin-warning-message">'. $message .'</div>';
-}
-
-/**
- * Themes the help text on this module's administration page.
- *
- * @param $help_text
- *   An array containing help text.
- * @return
- *   Themed HTML output.
- *
- * @ingroup themeable
- */
-function theme_admin_warning_help($help_text) {
-  $output = '';
-  foreach ($help_text as $text) {
-    $output .= '<p>'. $text .'</p>';
-  }
-  return $output;
+ * Implementation of hook_theme().
+ */
+function admin_warning_theme() {
+  return array(
+    'admin_warning_message' => array(
+      'arguments' => array('message' => NULL),
+      'file' => 'admin_warning.admin.inc',
+    ),
+    'admin_warning_help' => array(
+      'arguments' => array('help_text' => NULL),
+      'file' => 'admin_warning.admin.inc',
+    ),
+  );
 }
