? .DS_Store
? example.patch
Index: imagecache.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imagecache/imagecache.module,v
retrieving revision 1.112
diff -u -p -r1.112 imagecache.module
--- imagecache.module	7 May 2009 15:15:04 -0000	1.112
+++ imagecache.module	3 Jun 2009 20:55:28 -0000
@@ -658,7 +658,7 @@ function imagecache_field_formatter_info
 
 function theme_imagecache_formatter_default($element) {
   // Inside a view $element may contain NULL data. In that case, just return.
-  if (empty($element['#item']['fid'])) {
+  if (empty($element['#item']['fid']) || !imagecache_file_listed($element)) {
     return '';
   }
 
@@ -675,9 +675,26 @@ function theme_imagecache_formatter_defa
   return theme('imagecache', $presetname, $item['filepath'], $item['data']['alt'], $item['data']['title'], array('class' => $class));
 }
 
+/**
+ * Return whether a file should be listed when viewing the node.
+ *
+ * @param $file
+ *   A populated FileField item.
+ * @param $field
+ *   A CCK field instance array.
+ */
+function imagecache_file_listed($element) {
+  $field = content_fields($element['#field_name']);
+  $file = $element['#item'];
+  if (isset($field['list_field']) && $field['list_field']) {
+    return (bool)$file['list'];
+  }
+  return TRUE;
+}
+
 function theme_imagecache_formatter_linked($element) {
   // Inside a view $element may contain NULL data. In that case, just return.
-  if (empty($element['#item']['fid'])) {
+  if (empty($element['#item']['fid']) || !imagecache_file_listed($element)) {
     return '';
   }
 
@@ -697,7 +714,7 @@ function theme_imagecache_formatter_link
 
 function theme_imagecache_formatter_imagelink($element) {
   // Inside a view $element may contain NULL data. In that case, just return.
-  if (empty($element['#item']['fid'])) {
+  if (empty($element['#item']['fid']) || !imagecache_file_listed($element)) {
     return '';
   }
 
@@ -717,7 +734,7 @@ function theme_imagecache_formatter_imag
 
 function theme_imagecache_formatter_path($element) {
   // Inside a view $element may contain NULL data. In that case, just return.
-  if (empty($element['#item']['fid'])) {
+  if (empty($element['#item']['fid']) || !imagecache_file_listed($element)) {
     return '';
   }
 
@@ -729,7 +746,7 @@ function theme_imagecache_formatter_path
 
 function theme_imagecache_formatter_url($element) {
   // Inside a view $element may contain NULL data. In that case, just return.
-  if (empty($element['#item']['fid'])) {
+  if (empty($element['#item']['fid']) || !imagecache_file_listed($element)) {
     return '';
   }
 
