Index: sites/all/modules/category/contrib/category_pathauto/category_pathauto.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/category/contrib/category_pathauto/category_pathauto.module,v
retrieving revision 1.2
diff -u -r1.2 category_pathauto.module
--- sites/all/modules/category/contrib/category_pathauto/category_pathauto.module	5 Jan 2007 15:31:16 -0000	1.2
+++ sites/all/modules/category/contrib/category_pathauto/category_pathauto.module	2 Jan 2008 13:37:38 -0000
@@ -19,6 +19,7 @@
 
 /**
  * Implementation of hook_pathauto_node().
+ * @@@ REMOVE LATER
  */
 function category_pathauto_pathauto_node($op, $node = NULL) {
   switch ($op) {
@@ -44,7 +45,67 @@
 }
 
 /**
+ * Implementation of hook_token_list().
+ */
+function category_token_list($type = 'all') {
+  $tokens = array();
+  if ($type == 'all' || $type == 'node') {
+    $tokens['node']['container'] = t('For category nodes, the container of the category.');
+    $tokens['node']['categorypath'] = t('For category or container nodes, as [title], but including its supercategories.');
+    $tokens['node']['containerfirst'] = t("The container that the page's first assigned category belongs to.");
+    $tokens['node']['categoryfirst'] = t("The page's first assigned category.");
+    $tokens['node']['categorypathfirst'] = t('As [categoryfirst], but including its supercategories.');
+  }
+  return $tokens;
+}
+
+/**
+ * Implementation of hook_token_values().
+ */
+function category_token_values($type, $object = NULL) {
+  if ($type == 'node') {
+    $tokens = array(
+      'container' => '',
+      'categorypath' => '',
+      'containerfirst' => '',
+      'categoryfirst' => '',
+      'categorypathfirst' => '',
+    );
+
+    if (category_is_cat_or_cont($object->nid)) {
+      if (!empty($object->cnid)) {
+        $cont = category_get_container($object->cnid);
+        $tokens['container'] = pathauto_cleanstring($cont->title);
+      }
+
+      $path = _category_pathauto_get_path($object);
+      $tokens['categorypath'] = implode('/', $path);
+    }
+
+    if (!empty($object->category)) {
+      $cid = reset($object->category);
+      if (!is_numeric($cid)) {
+        $cid = $cid->cid;
+      }
+      $cat = category_get_category($cid);
+      $parents = category_get_parents($cat->cid, 'cid', TRUE);
+      $cat->parent = reset($parents);
+      $cat->parent = isset($cat->parent->cid) ? $cat->parent->cid : 0;
+      $cont = category_get_container($cat->cnid);
+
+      $tokens['containerfirst'] = pathauto_cleanstring($cont->title);
+      $tokens['categoryfirst'] = pathauto_cleanstring($cat->title);
+
+      $path = _category_pathauto_get_path($cat, $object->title);
+      $tokens['categorypathfirst'] = implode('/', $path);
+    }
+    return $tokens;
+  }
+}
+
+/**
  * Generate the category placeholders.
+ * @@@ REMOVE LATER
  *
  * @param $node
  *   The node object generate placeholders for.
