? 722000.patch
Index: nd.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/nd/Attic/nd.install,v
retrieving revision 1.1.2.4
diff -u -p -r1.1.2.4 nd.install
--- nd.install	24 Oct 2009 16:02:43 -0000	1.1.2.4
+++ nd.install	22 Feb 2010 20:48:14 -0000
@@ -26,4 +26,14 @@ function nd_install() {
 function nd_uninstall() {
   db_query("DELETE FROM {variable} WHERE name LIKE 'nd_%%'");
   variable_del('ds_build_mode_4');
+}
+
+/**
+ * Implementation of hook_update_N().
+ *
+ * We simply return an array here. We want the people to
+ * run update.php because new theming functions got introduced.
+ */
+function nd_update_1() {
+  return array();
 }
\ No newline at end of file
Index: nd.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/nd/nd.module,v
retrieving revision 1.1.2.123.2.27
diff -u -p -r1.1.2.123.2.27 nd.module
--- nd.module	10 Feb 2010 13:57:10 -0000	1.1.2.123.2.27
+++ nd.module	22 Feb 2010 20:48:15 -0000
@@ -26,7 +26,6 @@ function nd_ds_api() {
     'object' => 'node',
     'views_base' => 'node',
     'types' => 'node_get_types',
-
     'extra' => array('has_body'),
     'plugins_exclude' => array(NODE_BUILD_RSS),
     'regions_single' => array(NODE_BUILD_RSS),
@@ -211,7 +210,7 @@ function ds_views_row_node(&$vars, $buil
 function nd_theme() {
   $theme_functions = array();
 
-  // Formatter theming functions.
+  // Single theming functions.
   $formatters = array(
     'nd_bodyfield', 'nd_title_h1_nolink', 'nd_title_h1_link', 'nd_title_h2_nolink', 'nd_title_h2_link',
     'nd_title_h2_block_nolink', 'nd_title_h2_block_link', 'nd_title_p_nolink', 'nd_title_p_link',
@@ -223,6 +222,16 @@ function nd_theme() {
     );
   }
 
+  // Vocabulary.
+  $theme_functions['nd_terms_per_vocabulary_space'] = array(
+    'arguments' => array('node' => NULL),
+    'function' => 'nd_terms_per_vocabulary',
+  );
+  $theme_functions['nd_terms_per_vocabulary_comma'] = array(
+    'arguments' => array('node' => NULL),
+    'function' => 'nd_terms_per_vocabulary',
+  );
+
   return $theme_functions;
 }
 
@@ -305,11 +314,38 @@ function nd_ds_fields($type_name, $build
 
   // Taxonomy support.
   if (module_exists('taxonomy')) {
+    // All terms.
     $fields['terms'] = array(
-      'title' => t('Taxonomy'),
+      'title' => t('Taxonomy: all terms'),
       'type' => DS_FIELD_TYPE_PREPROCESS,
       'status' => DS_FIELD_STATUS_STATIC,
     );
+
+    // All vocabularies per content type.
+    $types = array();
+    $vocabularies = taxonomy_get_vocabularies();
+    foreach ($vocabularies as $vocabulary) {
+      foreach ($vocabulary->nodes as $type) {
+        if ($type === $type_name) {
+          $types[] = $vocabulary;
+        }
+      }
+    }
+    if (count($types) > 1) {
+      foreach ($types as $key => $vocabulary) {
+        $fields['terms_'. $vocabulary->vid] = array(
+          'title' => t('Taxonomy: @vocab', array('@vocab' => $vocabulary->name)),
+          'type' => DS_FIELD_TYPE_THEME,
+          'status' => DS_FIELD_STATUS_STATIC,
+          'properties' => array(
+            'formatters' => array(
+              'nd_terms_per_vocabulary_space' => t('Separated by space'),
+              'nd_terms_per_vocabulary_comma' => t('Separated by comma'),
+            ),
+          ),
+        );
+      }
+    }
   }
 
   // Upload support.
@@ -335,8 +371,6 @@ function nd_ds_fields($type_name, $build
     );
   }
 
-  // Comment support (count and add new comment link)
-
   return array('nd' => $fields);
 }
 
@@ -380,7 +414,29 @@ function theme_nd_title_p_link($field) {
 }
 
 /**
- * Book navigation.
+ * Terms per vocabulary.
+ */
+function nd_terms_per_vocabulary($field) {
+  $content = '';
+  if (isset($field['object']->taxonomy) && !empty($field['object']->taxonomy)) {
+    $terms = array();
+    list($string, $vid) = explode('_', $field['key']);
+    foreach ($field['object']->taxonomy as $tid => $term) {
+      if ($term->vid == $vid) {
+        $terms[] = $term->name;
+      }
+    }
+    if (!empty($terms)) {
+      $separators = array('space' => ' ', 'comma' => ', ');
+      $separator = $separators[end(explode('_', $field['formatter']))];
+      $content = implode($separator, $terms);
+    }
+  }
+  return $content;
+}
+
+/**
+ * Book navigation theming.
  */
 function nd_book_navigation($field) {
   $content = '';
