/[drupal]/contributions/modules/taxonomy_image/contributed/taxonomy_image_node_display/taxonomy_image_node_display.module
ViewVC logotype

Diff of /contributions/modules/taxonomy_image/contributed/taxonomy_image_node_display/taxonomy_image_node_display.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.4.16, Mon Mar 16 00:07:11 2009 UTC revision 1.1.4.17, Tue Mar 17 14:47:18 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: taxonomy_image_node_display.module,v 1.1.4.15 2009/03/15 17:43:50 nancyw Exp $  // $Id: taxonomy_image_node_display.module,v 1.1.4.16 2009/03/16 00:07:11 nancyw Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 116  function taxonomy_image_node_display_nod Line 116  function taxonomy_image_node_display_nod
116      $preset = $preset;      $preset = $preset;
117      $valid_nodes = array_filter($view);      $valid_nodes = array_filter($view);
118      if (isset($valid_nodes[$node->type]) && isset($node->taxonomy)) {      if (isset($valid_nodes[$node->type]) && isset($node->taxonomy)) {
119        $images = NULL;        $images = array();
120        foreach ($node->taxonomy as $tid => $term) {        foreach ($node->taxonomy as $tid => $term) {
121          $image = taxonomy_image_display($tid, NULL, $preset, array('wrapper' => FALSE));          $image = taxonomy_image_display($tid, NULL, $preset, array('wrapper' => FALSE));
122          if ($view_link && $image) {          if ($view_link && $image) {
123            $image = theme('taxonomy_image_display', $image, $term);            $image = theme('taxonomy_image_display', $image, $term);
124          }          }
125          $images .= $image;          $images[] = $image;
126        }        }
127        $node->content['taxonomy_image'] = array(        $node->content['taxonomy_image'] = array(
128          '#value' => $images,          '#value' => theme('taxonomy_image_display_images', $images),
129          '#weight' => variable_get('taxonomy_image_node_view_weight', -5),          '#weight' => variable_get('taxonomy_image_node_view_weight', -5),
130          );          );
       if (!$view_link) {  
         $node->content['taxonomy_image']['#prefix'] = '<div class="taxonomy-images">';  
         $node->content['taxonomy_image']['#suffix'] = '</div>';  
       }  
131      }      }
132    }    }
133  }  }
# Line 144  function taxonomy_image_node_display_the Line 140  function taxonomy_image_node_display_the
140      'taxonomy_image_display' => array(      'taxonomy_image_display' => array(
141        'arguments' => array('image', 'term'),        'arguments' => array('image', 'term'),
142      ),      ),
143        'taxonomy_image_display_images' => array(
144          'arguments' => array('images'),
145        ),
146    );    );
147  }  }
148    
# Line 154  function theme_taxonomy_image_display($i Line 153  function theme_taxonomy_image_display($i
153    $name = variable_get('taxonomy_image_node_show_name', TRUE) ? taxonomy_image_tt("taxonomy:term:$term->tid:name", $term->name) : NULL;    $name = variable_get('taxonomy_image_node_show_name', TRUE) ? taxonomy_image_tt("taxonomy:term:$term->tid:name", $term->name) : NULL;
154    return l($image, 'taxonomy/term/'. $term->tid, array('html' => TRUE, 'attributes' => array('class' => 'taxonomy-image-links'))) . $name;    return l($image, 'taxonomy/term/'. $term->tid, array('html' => TRUE, 'attributes' => array('class' => 'taxonomy-image-links'))) . $name;
155  }  }
156    
157    function theme_taxonomy_image_display_images($images) {
158      if (!is_array($images) || count($images) == 0)
159        return NULL;
160    
161      $output = '<div class="taxonomy-images">';
162      $output .= implode('', $images);
163      $output .= '</div>';
164      return $output;
165    }

Legend:
Removed from v.1.1.4.16  
changed lines
  Added in v.1.1.4.17

  ViewVC Help
Powered by ViewVC 1.1.2