--- Desktop/content_taxonomy/content_taxonomy.module	2007-09-03 15:27:11.000000000 +0300
+++ /var/www/drupal-5/sites/all/modules/content_taxonomy/content_taxonomy.module	2007-12-30 16:05:17.000000000 +0200
@@ -82,6 +82,11 @@ function content_taxonomy_field_settings
       
       return $form;   
       
+    case 'callbacks':
+      return array(
+        'view' => CONTENT_CALLBACK_CUSTOM,
+      );
+      
     case 'save':
       return array('save', 'vid', 'tid', 'depth');
     
@@ -99,6 +104,18 @@ function content_taxonomy_field_settings
  */
 function content_taxonomy_field($op, &$node, $field, &$node_field, $teaser, $page) {
   switch ($op) {
+    case 'view':
+     $context = $teaser ? 'teaser' : 'full';
+     $formatter = isset($field['display_settings'][$context]['format']) ? $field['display_settings'][$context]['format'] : 'text';
+      $items = array();
+      foreach ($node_field as $delta => $item) {
+        foreach ($item as $d => $term) {
+        $items[]['view'] = content_format($field, $term, $formatter, $node);
+        }
+      }
+      $output .= theme('field', $node, $field, $items, $teaser, $page);
+      return $output;
+      
     case 'load':   
       if (isset($field['save']) && $field['save'] != 'tag') {
         $data = $node_field;
@@ -180,25 +197,17 @@ function content_taxonomy_field_formatte
     }  
   }
 
-  if (!is_array($item)) {
+  if (!is_object($item)) {
     return '';
   }
   
   if ($formatter == 'link') {
-    foreach ($item as $key => $term) {
-      if (!is_object($term) && $key == 'value' && is_numeric($term) && $term != 0) {
-        $term = taxonomy_get_term($term);
-      }
-      $output .= l($term->name, taxonomy_term_path($term), array('rel' => 'tag', 'title' => $term->description)) ." <br />";
-    }
+        $term = taxonomy_get_term($item->tid);
+      $output .= l($term->name, taxonomy_term_path($term), array('rel' => 'tag', 'title' => $term->description));
   }
   else {
-    foreach ($item as $key => $term) {
-      if (!is_object($term) && $key == 'value' && is_numeric($term) && $term != 0) {
-        $term = taxonomy_get_term($term);
-      }
-      $output .= check_plain($term->name) ." <br />";
-    }
+        $term = taxonomy_get_term($item->tid);
+      $output .= check_plain($term->name);
   }
   return $output;
 }
