=== added file 'includes/token.inc'
--- includes/token.inc	1970-01-01 00:00:00 +0000
+++ includes/token.inc	2008-12-02 05:19:51 +0000
@@ -0,0 +1,38 @@
+<?php
+
+define('TOKEN_SAFE_FOR_ALL', 0);
+
+define('TOKEN_USER_INPUT_WITHOUT_FORMAT', 1);
+
+define('TOKEN_USER_INPUT_WITH_FORMAT', 2);
+
+function drupal_token($type, $keys, $object) {
+  $return = array();
+  foreach ($keys as $key) {
+    // We have something like .date.d-m-y.token:node_changed
+    if (!preg_match('/[0-9a-zA-Z_]/', $key[0])) {
+      $args = explode($key, $key[0]);
+      // Remove the empty first piece.
+      array_shift($args);
+      $function = array_shift($args);
+      if (drupal_function_exists($function)) {
+        foreach ($args as &$arg) {
+          if (substr($arg, 0, 6) == 'token:') {
+            $arg = drupal_token($type, array(substr($arg, 6)), $object);
+          }
+        }
+        $return[$key] = call_user_func_array($function, $args);
+      }
+    }
+    else {
+      $function = 'token_' . $type . '_' . $key;
+      if (drupal_function_exists($function)) {
+        $return[$key] = $function($object);
+      }
+      elseif (property_exists(get_class($object), $key)) {
+        $return[$key] = array('context' => TOKEN_USER_INPUT_WITHOUT_FORMAT, 'value' => $object->$key);
+      }
+    }
+  }
+  return $return;
+}

=== modified file 'modules/node/node.info'
--- modules/node/node.info	2008-10-12 01:23:01 +0000
+++ modules/node/node.info	2008-12-02 04:57:41 +0000
@@ -9,4 +9,5 @@ files[] = content_types.inc
 files[] = node.admin.inc
 files[] = node.pages.inc
 files[] = node.install
+files[] = node.token.inc
 required = TRUE

=== added file 'modules/node/node.token.inc'
--- modules/node/node.token.inc	1970-01-01 00:00:00 +0000
+++ modules/node/node.token.inc	2008-12-02 05:20:45 +0000
@@ -0,0 +1,29 @@
+<?php
+
+function token_node_nid($node) {
+  return array('context' => TOKEN_SAFE_FOR_ALL, 'value' => $node->nid);
+}
+
+function token_node_type($node) {
+  return array('context' => TOKEN_SAFE_FOR_ALL, 'value' => $node->type);
+}
+
+function token_node_type_name($node) {
+  return array('context' => TOKEN_USER_INPUT_WITHOUT_FORMAT, 'value' => $node->name);
+}
+
+function token_node_title($node) {
+  return array('context' => TOKEN_USER_INPUT_WITHOUT_FORMAT, 'value' => $node->title);
+}
+
+function token_node_uid($node) {
+  return array('context' => TOKEN_SAFE_FOR_ALL, 'value' => $node->uid);
+}
+
+function token_node_body($node) {
+  return array('context' => TOKEN_USER_INPUT_WITH_FORMAT, 'value' => $node->body, 'format' => $node->format);
+}
+
+function token_node_teaser($node) {
+  return array('context' => TOKEN_USER_INPUT_WITH_FORMAT, 'value' => $node->teaser, 'format' => $node->format);
+}
\ No newline at end of file

