--- I:/temp/TCV0b23.tmp/term_display.1.6.module	Wed Feb 11 11:32:26 2009
+++ D:/xampp/htdocs/drupal-cvs-teaser/sites/all/modules/term_display/term_display.module	Wed Feb 11 11:28:06 2009
@@ -5,6 +5,7 @@
 define('TERM_DISPLAY_LIST', 'list');
 define('TERM_DISPLAY_CUSTOM', 'custom');
 define('TERM_DISPLAY_NONE', 'none');
+define('TERM_DISPLAY_LOAD', 'load');
 
 /**
  * Implementation of hook_form_alter().
@@ -25,6 +26,7 @@
     TERM_DISPLAY_DEFAULT => t('default'),
     TERM_DISPLAY_LIST => t('list'),
     TERM_DISPLAY_CUSTOM => t('custom (defaults to comma separated)'),
+    TERM_DISPLAY_LOAD => t('Load into $node object'),    
     TERM_DISPLAY_NONE => t('none (hidden)'),
   );
 
@@ -133,6 +135,7 @@
             if ($term->vid == $vocabulary->vid) {
               switch ($term_display_data['style']) {
                 case TERM_DISPLAY_LIST:
+                case TERM_DISPLAY_LOAD:
                 case TERM_DISPLAY_CUSTOM:
                   $terms[] = $term;
                   // Fall through.
@@ -143,10 +146,16 @@
             }
           }
           if (!empty($terms)) {
-            $node->content['term_display_'. $vocabulary->vid] = array(
-              '#weight' => $term_display_data['weight'],
-              '#value' => theme('term_display_'. $term_display_data['style'], $vocabulary, $terms),
-            );
+            if ($term_display_data['style'] != TERM_DISPLAY_LOAD) {
+              $node->content['term_display_'. $vocabulary->vid] = array(
+                '#weight' => $term_display_data['weight'],
+                '#value' => theme('term_display_'. $term_display_data['style'], $vocabulary, $terms),
+              );
+            }
+            else {
+              $node->term_display[$vocabulary->vid]['vocabulary_name'] = check_plain($vocabulary->name);
+              $node->term_display[$vocabulary->vid]['terms'] = $terms;
+            }
           }
         }
       }
