Index: galleryformatter.module =================================================================== RCS file: /cvs/drupal/contributions/modules/galleryformatter/galleryformatter.module,v retrieving revision 1.4.2.3 diff -u -p -r1.4.2.3 galleryformatter.module --- galleryformatter.module 20 Jun 2010 17:15:01 -0000 1.4.2.3 +++ galleryformatter.module 25 Nov 2010 16:23:39 -0000 @@ -11,7 +11,7 @@ function galleryformatter_field_formatte return array( 'galleryformatter_default' => array( 'label' => t('jQuery Gallery'), - 'field types' => array('image'), + 'field types' => array('image','media'), 'settings' => array( 'slide_style' => 'galleryformatter_slide', 'thumb_style' => 'galleryformatter_thumb', @@ -130,13 +130,22 @@ function galleryformatter_field_formatte // prepare the renderable array $renderitems = array(); $renderitems['thumbs'] = array(); + + // media module provides the items as objects while core as arrays. + if($field['type'] == 'media'){ + foreach($items as $delta => $item) { + $items_fixed[] = get_object_vars($item); + } + $items = $items_fixed; + } + foreach ($items as $delta => $item){ - /* - * prepare slides - */ + //prepare slides // Grab and sanitize image information // $renderitems['slides'][$delta]['description'] = check_plain($item['description']); // so far no description in d7 image fields - $renderitems['slides'][$delta]['title'] = check_plain($item['title']); + if(!empty($item['title'])) { + $renderitems['slides'][$delta]['title'] = check_plain($item['title']); + } // Check if alt attribute is already set, if not use the filename as alt attribute $renderitems['slides'][$delta]['alt'] = (isset($item['alt']) && !empty($item['alt'])) ? check_plain($item['alt']) : $item['filename']; @@ -190,9 +199,8 @@ function galleryformatter_field_formatte $renderitems['slides'][$delta]['image'] = l(''. t('View the full image') .''. $renderitems['slides'][$delta]['image'], $link_url, array('attributes' => $link_attributes, 'html' => TRUE,)); } // END linking to original - /* - * prepare thumbs - */ + + // prepare thumbs if($num_of_images > 1){ $renderitems['thumbs'][$delta]['image'] = theme('image_formatter', array( 'item' => $item,