Index: content_taxonomy.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/content_taxonomy/content_taxonomy.module,v
retrieving revision 1.2
diff -u -p -r1.2 content_taxonomy.module
--- content_taxonomy.module	16 Feb 2007 09:10:34 -0000	1.2
+++ content_taxonomy.module	17 May 2007 18:21:42 -0000
@@ -334,5 +334,42 @@ function content_taxonomy_save(&$node, $
   }
 }
 
+if (module_exists('token')) {
+  /**
+   * Implementation of hook_token_list().
+   */
+  function content_taxonomy_token_list($type = 'all') {
+    if ($type == 'field' || $type == 'all') {
+      $tokens = array();
+
+      $tokens['content_taxonomy']['term']  = t('Name of top taxonomy term');
+      $tokens['content_taxonomy']['tid']   = t('ID of top taxonomy term');
+      $tokens['content_taxonomy']['vocab'] = t('Name of top terms vocabulary');
+      $tokens['content_taxonomy']['vid']   = t('ID of top terms vocabulary');
+
+      return $tokens;
+    }
+  }
+
+  /**
+   * Implementation of hook_token_values().
+   */
+  function content_taxonomy_token_values($type, $object = NULL) {
+    if ($type == 'field') {
+      $keys = array_keys($object);
+      $tid = $keys[0];
+
+      $term = taxonomy_get_term($tid);
+      $vocabulary = taxonomy_get_vocabulary($term->vid);
+
+      $tokens['term']  = $term->name;
+      $tokens['tid']   = $tid;
+      $tokens['vocab'] = $vocabulary->name;
+      $tokens['vid']   = $term->vid;
+
+      return $tokens;
+    }
+  }
+}
 
 ?>
\ No newline at end of file
