80,172d79
< 
< /**
< * This module is a small helper module to fix an issue with a view.
< */
< 
< function taxonomy_image_views_tables_alter(&$data) {
<   if (module_exists('taxonomy_image_link_alter')) {
<     $vocabularies = taxonomy_get_vocabularies();
<     foreach ($vocabularies as $voc) {
<       $data["term_node_$voc->vid"] = array(
<         'name' => 'term_node',
<         'provider' => 'internal',
<         'join' => array(
<           'left' => array(
<             'table' => 'node',
<             'field' => 'nid'
<           ),
<           'right' => array(
<             'field' => 'nid'
<           )
<         ),
<         'fields' => array(
<           'name' => array(
<             'name' => t('Taxonomy: Terms for @voc-name', array('@voc-name' => $voc->name)),
<             'sortable' => false,
<             'help' => t('This will display all taxonomy terms associated with the node that are members of %voc-name. Note that this causes one extra query per row displayed, and might have a minor performance impact.', array('%voc-name' => $voc->name)),
<             'handler' => 'taxonomy_image_handler_field_allterms',
<             'vocabulary' => $voc->vid,
<             'notafield' => true,
<             'option' => array(
<                '#type' => 'select',
<                '#options' => array(
<                  'link' => 'As links',
<                  'nolink' => 'Without links',
<                  'image' => 'As Image',
<                  'imagenolink' => 'As Image NO links'
<                 ),
<             ),
<           ),
<         ),
<         'filters' => array(
<           'tid' => array(
<             'name' => t('Taxonomy: Terms for @voc-name', array('@voc-name' => $voc->name)),
<             'value' => views_taxonomy_form($voc),
<             //views does handle this as array regardless what we state here due to the operators
<             'value-type' => 'array', 
<             'tags' => $voc->tags,
<             'operator' => 'views_handler_operator_andor',
<             'handler' => 'views_handler_filter_tid_custom',
<             'option' => 'string',
<             'vocabulary' => $voc->vid,
<             'help' => t("Only terms associated with %voc-name will appear in the select box for this filter. When filtering by taxonomy term you may specify the 'depth' as an option. Please see the taxonomy help for more information.", array('%voc-name' => $voc->name)),
<           ),
<         )
<       );
<    }
<   }
< 
< }
< 
< /**
<  ******* alter - - - -Display all the terms for a given vocabulary
<  */
< function taxonomy_image_handler_field_allterms($fieldinfo, $fielddata, $value, $data) {
<   if ($fieldinfo['vocabulary']) {
<     $terms = taxonomy_node_get_terms_by_vocabulary($data->nid, $fieldinfo['vocabulary']);
<   }
<   else {
<     $terms = taxonomy_node_get_terms($data->nid);
<   }
< 
<   if ($fielddata['options'] == 'nolink') {
<     foreach ($terms as $term) {
<       $links[] = check_plain($term->name);
<     }
<     $links = !empty($links) ? implode(' | ', $links) : '';
<   }
<     elseif ($fielddata['options'] == 'image') {
<             // $node = new stdClass();
<             // load node to get type which is needed  by taxonomy_image_link_alter to check that the type is activated to replace links by images. 
<             $node = node_load($data->nid);
<             // copy terms, but should not be needed
<             $node->taxonomy = $terms;
<             // taxonomy_image_link_alter will hook on the taxonomy_link call
<             $links = theme('links', taxonomy_link('taxonomy terms', $node));
<   }
<   else {
<     $node = new stdClass();
<     $node->taxonomy = $terms;
<     $links = theme('links', taxonomy_link('taxonomy terms', $node));
<   }
<   return $links;
< }
\ No newline at end of file
