Index: galleria.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/galleria/Attic/galleria.admin.inc,v
retrieving revision 1.1.2.8
diff -u -p -r1.1.2.8 galleria.admin.inc
--- galleria.admin.inc	8 May 2009 12:27:09 -0000	1.1.2.8
+++ galleria.admin.inc	9 May 2009 04:56:54 -0000
@@ -13,6 +13,17 @@
  * @see system_settings_form()
  */
 function galleria_admin_settings() {
+  // Setup ImageCache preset options.
+  // Code based on Taxonomy Image's ImageCache support.
+  if (module_exists('imagecache')) {
+    $raw_presets = imagecache_presets();
+    $presets[''] = t('None');
+    foreach ($raw_presets as $preset_id => $preset_info) {
+      $preset = $preset_info['presetname'];
+      $presets[$preset] = $preset;
+    }
+  }
+
   $form['galleria_admin'] = array(
     '#type' => 'fieldset',
     '#collapsible' => TRUE,
@@ -44,21 +55,15 @@ function galleria_admin_settings() {
     '#description' => t('Show warning and error messages on Gallerias if they aren\'t configured properly.'),
   );
 
-  // Code based on from Taxonomy Image's ImageCache support
-  // If ImageCache module is found, add its presets as available options
-  // for how to display the image.
+  // ImageCache integration settings.
+  $form['galleria_imagecache'] = array(
+    '#type' => 'fieldset',
+    '#collapsible' => TRUE,
+    '#title' => t('ImageCache integration'),
+  );
+
   if (module_exists('imagecache')) {
-    $raw_presets = imagecache_presets();
-    $presets[''] = t('None');
-    foreach ($raw_presets as $preset_id => $preset_info) {
-      $preset = $preset_info['presetname'];
-      $presets[$preset] = $preset;
-    }
-    $form['galleria_imagecache'] = array(
-      '#type' => 'fieldset',
-      '#collapsible' => TRUE,
-      '#title' => t('ImageCache integration')
-    );
+    $form['galleria_imagecache']['#description'] = t('Galleria can integrate with the ImageCache module to control the appearance of uploaded images and their thumbnails.');
 
     $form['galleria_imagecache']['galleria_imagecache_preset'] = array(
       '#type' => 'select',
@@ -75,16 +80,18 @@ function galleria_admin_settings() {
     );
   }
   else {
-    drupal_set_message(t('If you install the imagecache module, you will get extra options here for integration.'), 'status');
+    $form['galleria_imagecache']['#description'] = t('<em>Install the ImageCache module to control the appearance of uploaded images and their thumbnails.</em>');
   }
 
   // jCarousel integration settings.
+  $form['galleria_jcarousel'] = array(
+    '#type' => 'fieldset',
+    '#collapsible' => TRUE,
+    '#title' => t('jCarousel integration'),
+  );
+
   if (module_exists('jcarousel')) {
-    $form['galleria_jcarousel'] = array(
-      '#type' => 'fieldset',
-      '#collapsible' => TRUE,
-      '#title' => t('jCarousel integration')
-    );
+    $form['galleria_jcarousel']['#description'] = t('Galleria can integrate with the jCarousel module to display thumbnails in a scrolling carousel.');
 
     $form['galleria_jcarousel']['galleria_jcarousel'] = array(
       '#type' => 'select',
@@ -144,7 +151,47 @@ function galleria_admin_settings() {
     );
   }
   else {
-    drupal_set_message(t('If you install the jCarousel module, you will get extra options here for integration.'), 'status');
+    $form['galleria_jcarousel']['#description'] = t('<em>Install the jCarousel module to display Galleria thumbnails in a scrolling carousel.</em>');
+  }
+
+  // Lightbox2 / jQuery Lightbox integration settings.
+  $form['galleria_lightbox'] = array(
+    '#type' => 'fieldset',
+    '#collapsible' => TRUE,
+    '#title' => t('Lightbox integration'),
+  );
+
+  if (module_exists('lightbox2') || module_exists('jlightbox')) {
+    $form['galleria_lightbox']['#description'] = t('Galleria can integrate with the Lightbox2 and jQuery Lightbox modules to let users open Galleria images in a Lightbox.');
+
+    $form['galleria_lightbox']['galleria_lightbox'] = array(
+      '#type' => 'select',
+      '#title' => t('Lightbox module'),
+      '#options' => array(
+        'none' => t('None'),
+      ),
+      '#default_value' => variable_get('galleria_lightbox', 'none'),
+      '#description' => t('Select the Lightbox module that you would like to integrate with Galleria.'),
+    );
+    if (module_exists('lightbox2')) {
+      $form['galleria_lightbox']['galleria_lightbox']['#options']['lightbox2'] = t('Lightbox2');
+    }
+    if (module_exists('jlightbox')) {
+      $form['galleria_lightbox']['galleria_lightbox']['#options']['jlightbox'] = t('jQuery Lightbox');
+    }
+
+    if (module_exists('imagecache')) {
+      $form['galleria_lightbox']['galleria_lightbox_preset'] = array(
+        '#type' => 'select',
+        '#title' => t('Lightbox ImageCache preset'),
+        '#options' => $presets,
+        '#default_value' => variable_get('galleria_lightbox_preset', ''),
+        '#description' => t('Select the ImageCache preset to display in Galleria Lightboxes.'),
+      );
+    }
+  }
+  else {
+    $form['galleria_lightbox']['#description'] = t('<em>Install the Lightbox2 or jQuery Lightbox module to let users open Galleria images in a Lightbox.</em>');
   }
 
   drupal_set_message(t('To customize Galleria position on a page (e.g. if you want to have Galleria placed below the node body), install the CCK module and rearrange fields for the content type that has Galleria enabled.'), 'status');
Index: galleria.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/galleria/Attic/galleria.install,v
retrieving revision 1.1.2.6
diff -u -p -r1.1.2.6 galleria.install
--- galleria.install	5 May 2009 10:47:37 -0000	1.1.2.6
+++ galleria.install	9 May 2009 04:50:12 -0000
@@ -21,6 +21,8 @@ function galleria_uninstall() {
   variable_del('galleria_jcarousel_scroll');
   variable_del('galleria_jcarousel_animation');
   variable_del('galleria_jcarousel_wrap');
+  variable_del('galleria_lightbox');
+  variable_del('galleria_lightbox_preset');
   $node_types = node_get_types('names');
   foreach ($node_types as $type) {
     variable_del("galleria_$type");
Index: galleria.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/galleria/galleria.module,v
retrieving revision 1.1.2.23
diff -u -p -r1.1.2.23 galleria.module
--- galleria.module	8 May 2009 12:33:45 -0000	1.1.2.23
+++ galleria.module	9 May 2009 04:27:01 -0000
@@ -21,6 +21,7 @@ function galleria_includes() {
 
     $settings = array(
       'thumb_opacity' => variable_get('galleria_thumb_opacity', 0.3),
+      'galleria_lightbox' => (module_exists('lightbox2') || module_exists('jlightbox')) ? variable_get('galleria_lightbox', 'none') : 'none',
     );
     drupal_add_js($settings, 'setting');
     $included = TRUE;
@@ -284,13 +285,15 @@ function template_preprocess_galleria(&$
   $imagecache_exists = module_exists('imagecache');
   $img_preset = variable_get('galleria_imagecache_preset', '');
   $thumb_preset = variable_get('galleria_thumb_imagecache_preset', '');
+  $lightbox_preset = variable_get('galleria_lightbox_preset', '');
 
   foreach ($images as $image) {
     $caption = ($image->description != $image->filename) ? $image->description : '';
     $filepath = $image->filepath;
+    $lightbox_url = ($imagecache_exists && $lightbox_preset) ? imagecache_create_url($lightbox_preset, $filepath) : url($filepath, array('absolute' => TRUE));
 
     if ($imagecache_exists && $thumb_preset) {
-      $thumb = theme('imagecache', $thumb_preset, $filepath, $caption, $caption);
+      $thumb = theme('imagecache', $thumb_preset, $filepath, $lightbox_url, $caption);
     }
 
     if ($imagecache_exists && $img_preset) {
@@ -300,7 +303,7 @@ function template_preprocess_galleria(&$
       }
       else {
         // Preset for only the gallery image
-        $image = theme('imagecache', $img_preset, $filepath, $caption, $caption);
+        $image = theme('imagecache', $img_preset, $filepath, $lightbox_url, $caption);
       }
     }
     else {
@@ -310,7 +313,7 @@ function template_preprocess_galleria(&$
       }
       else {
         // No presets selected
-        $image = theme('image', $filepath, $caption, $caption);
+        $image = theme('image', $filepath, $lightbox_url, $caption);
       }
     }
 
cvs diff: Diffing inc
Index: inc/galleria.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/galleria/inc/galleria.js,v
retrieving revision 1.1.2.7
diff -u -p -r1.1.2.7 galleria.js
--- inc/galleria.js	5 May 2009 10:47:37 -0000	1.1.2.7
+++ inc/galleria.js	9 May 2009 03:43:59 -0000
@@ -11,6 +11,15 @@ Drupal.galleria = {};
 Drupal.galleria.options = {
   insert : '#main-image',
   onImage : function(image, caption, thumb) {
+    // Lightbox support
+    if (Drupal.settings.galleria_lightbox != 'none') {
+      // surround the displayed image with a Lightbox link
+      image.wrap('<a href="' + thumb.siblings('a').attr('href') + '" rel="lightbox[galleria]" title="' + caption.text() + '"></a>');
+      // keep Galleria from adding a click event to the image
+      $.galleria.clickNext = false; 
+      image.attr('title','View full-size');
+    }
+
     // let's add some image effects for demonstration purposes
     // fade in the image & caption
     if(!($.browser.mozilla && navigator.appVersion.indexOf("Win")!=-1) ) { // FF/Win fades large images terribly slow
@@ -34,14 +43,26 @@ Drupal.galleria.options = {
       // fade in active thumbnail
       thumb.fadeTo('fast',1).addClass('selected');
 
-      // add a title for the clickable image
-      image.attr('title','Next image >>');
+      if (Drupal.settings.galleria_lightbox == 'none') {
+        // add a title for the clickable image
+        image.attr('title','Next image >>');
+      }
 
       $('.galleria-nav').show();
 
       // trigger the jCarousel to scroll to the current image's thumbnail
       $('#main-image').trigger('img_change', [thumb.parent().attr('jcarouselindex')]);
     }
+
+    // scan the page for new Lightbox links
+    switch (Drupal.settings.galleria_lightbox) {
+      case 'lightbox2':
+        Lightbox.initList();
+        break;
+      case 'jlightbox':
+        Lightbox.updateImageList();
+        break;
+    }
   },
 
   onThumb : function(thumb) {
@@ -60,6 +81,23 @@ Drupal.galleria.options = {
       function() { thumb.fadeTo('fast', 1); },
       function() { _li.not('.active').children('img').fadeTo('fast', Drupal.settings.thumb_opacity); } // don't fade out if the parent is active
     )
+
+    // Lightbox support
+    if (Drupal.settings.galleria_lightbox != 'none') {
+      // add a Lightbox link after each thumbnail
+      thumb.after('<a href="' + thumb.attr('alt') + '" rel="lightbox[galleria]" title="' + thumb.attr('title') + '"></a>');
+      if (_li.hasClass('last')) {
+        // scan the page for new Lightbox links once the last thumnail is loaded
+        switch (Drupal.settings.galleria_lightbox) {
+          case 'lightbox2':
+            Lightbox.initList();
+            break;
+          case 'jlightbox':
+            Lightbox.updateImageList();
+            break;
+        }
+      }
+    }
   },
 
   history : false