Index: popups.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/popups/popups.module,v
retrieving revision 1.11.4.6
diff -u -p -r1.11.4.6 popups.module
--- popups.module	12 Jan 2009 20:24:11 -0000	1.11.4.6
+++ popups.module	17 Mar 2009 17:28:00 -0000
@@ -27,64 +27,68 @@
  *
  * @return array of new menu items.
  */
-function popups_menu() {
-   
-  // Themable page save dialog.
-  $items[] = array(
-    'path' => 'popups/save_dialog',
-    'callback' => 'theme',
-    'callback arguments' => array('popup_save_dialog'),
-    'access' => TRUE,
-    'type' => MENU_CALLBACK,
-  );  
+function popups_menu($may_cache) {
+  $items = array();
+
+  if ($may_cache) {
+    // Themable page save dialog.
+    $items[] = array(
+      'path' => 'popups/save_dialog',
+      'callback' => 'theme',
+      'callback arguments' => array('popup_save_dialog'),
+      'access' => TRUE,
+      'type' => MENU_CALLBACK,
+    );  
   
-  // Admin Settings.
-  $items[] = array(
-    'path' => 'admin/settings/popups',
-    'callback' => 'drupal_get_form',
-    'callback arguments' => array('popups_admin_settings'),
-    'title' => t('Popups'),
-    'access' => user_access('administer site configuration'),
-    'description' => 'Configure the page-in-a-dialog behavior.',
-  ); 
+    // Admin Settings.
+    $items[] = array(
+      'path' => 'admin/settings/popups',
+      'callback' => 'drupal_get_form',
+      'callback arguments' => array('popups_admin_settings'),
+      'title' => t('Popups'),
+      'access' => user_access('administer site configuration'),
+      'description' => 'Configure the page-in-a-dialog behavior.',
+    ); 
   
-  // Items for testing.
-  $items[] = array(
-    'path' => 'popups/test',
-    'title' => t('Popup Test'),
-    'callback' => '_popups_test_popups',
-    'type' => MENU_CALLBACK,
-    'access' => TRUE,
-  );
-  $items[] = array(
-    'path' => 'popups/test/response',
-    'title' => t('Popup Test'),
-    'callback' => '_popups_test_response',
-    'type' => MENU_CALLBACK,
-    'access' => TRUE,
-  );
-  $items[] = array(
-    'path' => 'popups/test/namechange',
-    'callback' => 'drupal_get_form',
-    'callback arguments' => array('_popups_test_namechange'),
-    'type' => MENU_CALLBACK,
-    'access callback' => TRUE,
-  );
-    
+    // Items for testing.
+    $items[] = array(
+      'path' => 'popups/test',
+      'title' => t('Popup Test'),
+      'callback' => '_popups_test_popups',
+      'type' => MENU_CALLBACK,
+      'access' => TRUE,
+    );
+    $items[] = array(
+      'path' => 'popups/test/response',
+      'title' => t('Popup Test'),
+      'callback' => '_popups_test_response',
+      'type' => MENU_CALLBACK,
+      'access' => TRUE,
+    );
+    $items[] = array(
+      'path' => 'popups/test/namechange',
+      'callback' => 'drupal_get_form',
+      'callback arguments' => array('_popups_test_namechange'),
+      'type' => MENU_CALLBACK,
+      'access callback' => TRUE,
+    );
+  }
+  else {
+    // Look at the page path and see if popup behavior has been requested for
+    // any links on the page.
+    $popups = popups_get_popups();
+    if (isset($popups[$_GET['q']])) {
+      popups_add_popups($popups[$_GET['q']]);
+    }
+  }
+
   return $items;
 }
 
 /**
  * hook_init
- * 
- * Look at the page path and see if popup behavior has been requested for any links in this page.
  */
 function popups_init() {  
-  $popups = popups_get_popups();
-  if (isset($popups[$_GET['q']])) {
-    popups_add_popups($popups[$_GET['q']]);
-  }
-  
   if (isset($_SERVER['HTTP_X_DRUPAL_RENDER_MODE'])) {
     $render_mode = $_SERVER['HTTP_X_DRUPAL_RENDER_MODE'];
   }
