=== 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-16 12:44:11 +0000
+++ sites/all/modules/node_gallery/contrib/node_gallery_access/node_gallery_access.install	2009-09-16 13:49:26 +0000
@@ -50,6 +50,32 @@
 }
 
 /**
+ * Implementation of hook_requirements()
+ */
+function node_gallery_access_requirements($phase) {
+  $requirements = array();
+  $t = get_t();
+
+  switch ($phase) {
+    case 'install':
+      $error = FALSE;
+      // node_gallery_requirements() will abort enabling node_gallery based upon the presence of imagecache.
+      // If we don't abort here, node_gallery_access will be enabled but node_gallery is disabled (AND locked!) - which results in a broken system.
+      // (Check imagecache, not node_gallery, because otherwise you might get two errors in two different runs => more annoying for the user.)
+      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,
+        );
+      }
+    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-16 13:45:07 +0000
@@ -0,0 +1,35 @@
+<?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;
+      // node_gallery_requirements() will abort enabling node_gallery based upon the presence of imagecache.
+      // If we don't abort here, node_gallery_lightbox2 will be enabled but node_gallery is disabled (AND locked!) - which results in a broken system.
+      // (Check imagecache, not node_gallery, because otherwise you might get two errors in two different runs => more annoying for the user.)
+      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 Access 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-16 12:44:11 +0000
+++ sites/all/modules/node_gallery/node_gallery.install	2009-09-16 13:47:54 +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()
  *
  */

