=== modified file 'sites/all/modules/node_gallery/contrib/node_gallery_access/node_gallery_access.install'
--- sites/all/modules/node_gallery/contrib/node_gallery_access/node_gallery_access.install	2009-09-29 23:18:48 +0000
+++ sites/all/modules/node_gallery/contrib/node_gallery_access/node_gallery_access.install	2009-09-29 23:12:28 +0000
@@ -50,6 +50,48 @@
 }
 
 /**
+ * Implementation of hook_requirements()
+ */
+function node_gallery_access_requirements($phase) {
+  $requirements = array();
+  $t = get_t();
+
+  switch ($phase) {
+    case 'install':
+      $error = FALSE;
+      // node_gallery.install will abort enabling node_gallery based upon the presence of imagecache.
+      // If so, we must abort too, otherwise node_gallery_access is enabled while node_gallery is disabled (AND locked!) - which yields a broken system.
+      // (The order in which modules are installed is undetermined.
+      // We'll test for presence of imagecache OR for node_gallery already having been aborted.
+      // Testing for presence of node_gallery is conceptually better, but inconvenient for the user who will have a much higher chance of an error message.)
+      if (!module_exists('imagecache')) {
+        $requirements['node_gallery_access'] = array(
+          'title' => $t('Node Gallery Access requires'),
+          'value' => $t(' ImageCache module to be pre-installed. If ImageCache is now installed, please enable Node Gallery Access again.'),
+          'severity' => REQUIREMENT_ERROR,
+        );
+      }
+      else {
+        $msgs = drupal_set_message();
+        if ($msgs && isset($msgs['error'])) {
+          foreach ($msgs['error'] as $msg) {
+            if (strpos($msg, 'Node Gallery requires') !== FALSE) {
+              $requirements['node_gallery_access'] = array(
+                'title' => $t('Node Gallery Access requires'),
+                'value' => $t(' ImageCache module to be pre-installed. If ImageCache is now installed, please enable Node Gallery Access again.'),
+                'severity' => REQUIREMENT_ERROR,
+              );
+            }
+          }
+        }
+      }
+    break;
+  }
+
+  return $requirements;
+}
+
+/**
  * Implementation of hook_install()
  *
  */

=== added file 'sites/all/modules/node_gallery/contrib/node_gallery_lightbox2/node_gallery_lightbox2.install'
--- sites/all/modules/node_gallery/contrib/node_gallery_lightbox2/node_gallery_lightbox2.install	1970-01-01 00:00:00 +0000
+++ sites/all/modules/node_gallery/contrib/node_gallery_lightbox2/node_gallery_lightbox2.install	2009-09-29 23:22:08 +0000
@@ -0,0 +1,47 @@
+<?php
+
+// $Id$
+
+/**
+ * @file
+ * Node gallery lightbox2 install file.
+ *
+ */
+
+/**
+ * Implementation of hook_requirements()
+ */
+function node_gallery_lightbox2_requirements($phase) {
+  $requirements = array();
+  $t = get_t();
+
+  switch ($phase) {
+    case 'install':
+      $error = FALSE;
+      // Comments: see node_gallery_access.install
+      if (!module_exists('imagecache')) {
+        $requirements['node_gallery_lightbox2'] = array(
+          'title' => $t('Node Gallery Lightbox2 requires'),
+          'value' => $t(' ImageCache module to be pre-installed. If ImageCache is now installed, please enable Node Gallery Lightbox2 again.'),
+          'severity' => REQUIREMENT_ERROR,
+        );
+      }
+      else {
+        $msgs = drupal_set_message();
+        if ($msgs && isset($msgs['error'])) {
+          foreach ($msgs['error'] as $msg) {
+            if (strpos($msg, 'Node Gallery requires') !== FALSE) {
+              $requirements['node_gallery_lightbox2'] = array(
+                'title' => $t('Node Gallery Lightbox2 requires'),
+                'value' => $t(' ImageCache module to be pre-installed. If ImageCache is now installed, please enable Node Gallery Lightbox2 again.'),
+                'severity' => REQUIREMENT_ERROR,
+              );
+            }
+          }
+        }
+      }
+    break;
+  }
+
+  return $requirements;
+}

=== modified file 'sites/all/modules/node_gallery/node_gallery.install'
--- sites/all/modules/node_gallery/node_gallery.install	2009-09-29 23:18:48 +0000
+++ sites/all/modules/node_gallery/node_gallery.install	2009-09-29 21:10:01 +0000
@@ -58,6 +58,30 @@
 }
 
 /**
+ * Implementation of hook_requirements()
+ */
+function node_gallery_requirements($phase) {
+  $requirements = array();
+  $t = get_t();
+
+  switch ($phase) {
+    case 'install':
+      $error = FALSE;
+      // If ImageCache is not installed already, node_gallery.install code will fail and the system will be in a 'broken' state.
+      if (!module_exists('imagecache')) {
+        $requirements['node_gallery'] = array(
+          'title' => $t('Node Gallery requires'),
+          'value' => $t(' ImageCache module to be pre-installed. If ImageCache is now installed, please enable Node Gallery again.'),
+          'severity' => REQUIREMENT_ERROR,
+        );
+      }
+    break;
+  }
+
+  return $requirements;
+}
+
+/**
  * Implementation of hook_install()
  *
  */

