Index: image_gallery.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/image/contrib/image_gallery/image_gallery.module,v
retrieving revision 1.20.2.1
diff -u -r1.20.2.1 image_gallery.module
--- image_gallery.module	6 Jan 2008 23:00:53 -0000	1.20.2.1
+++ image_gallery.module	10 Jan 2008 10:37:44 -0000
@@ -49,11 +49,12 @@
       'type' => MENU_LOCAL_TASK,
     );
     $items[] = array(
       'path' => 'admin/settings/image_gallery',
       'title' => t('Image gallery'),
       'access' => user_access('administer site configuration'),
-      'callback' => 'drupal_get_form',
+      'callback' => image_gallery_is_using_views() ? 'image_gallery_admin_settings_empty' : 'drupal_get_form',
       'callback arguments' => array('image_gallery_admin_settings'),
       'description' => t('Configure appearance of image galleries.'),
     );
   }
@@ -73,6 +74,31 @@
   return $items;
 }
 
+/*
+ * Test whether we're using Views to generate galleries or not
+ */
+function image_gallery_is_using_views() {
+  $views_status = variable_get('views_defaults', array());
+  return (
+    module_exists('views') && (
+      // taken from views.module code
+      $views_status['image_gallery'] == 'enabled' || 
+      (!$view->disabled && $views_status['image_gallery'] != 'disabled')
+    )
+  );
+}
+
+function image_gallery_admin_settings_empty() {
+  $text = 'Image galleries are being provided by the Views module.';
+  if (module_exists('views_ui')) {
+    $text .= t(' To change the way galleries are displayed, override the default image_gallery view at '). l(t('Administer views.'), 'admin/build/views');
+  }
+  else {
+    $text .= t(' To change the way galleries are displayed, enable the <strong>Views UI</strong> module and override the default image_gallery view.');
+  }
+  return $text;
+}
+
 function image_gallery_admin_settings() {
   _image_check_settings();
 
@@ -164,7 +190,7 @@
      * - Embed a view to show the image gallery, appending it to the themed 
      *   child gallery list.
      */
-    if (module_exists('views')) {
+    if (image_gallery_is_using_views()) {
       $view = views_get_view('image_gallery');
     }
     else {
@@ -385,7 +411,7 @@
   }
 
   // Skip this if using Views, as $images is always empty
-  if (!module_exists('views') && count($images) + count($galleries) == 0) {
+  if (!image_gallery_is_using_views() && count($images) + count($galleries) == 0) {
     $content .= '<p class="count">'. format_plural(0, 'There is 1 image in this gallery', 'There are @count images in this gallery') ."</p>\n";
   }
 
