? 164464_tokenize_new_stdclass.patch
? 273304_tokenize_coding_standards.patch
? README.txt
Index: tokenize.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/tokenize/tokenize.install,v
retrieving revision 1.1
diff -u -p -r1.1 tokenize.install
--- tokenize.install	3 Aug 2007 01:17:29 -0000	1.1
+++ tokenize.install	21 Jun 2008 18:44:37 -0000
@@ -7,12 +7,12 @@ function tokenize_install() {
   switch ($GLOBALS['db_type']) {
     case 'mysql':
     case 'mysqli':
-			db_query("CREATE TABLE {tokenize} (
-  			field_name varchar(32) NOT NULL default '0',
-  			type_name varchar(32) NOT NULL default '0',
-  			method int(1) NOT NULL default '0'
-			) /*!40100 DEFAULT CHARACTER SET utf8 */;");
-			break;
+      db_query("CREATE TABLE {
+        field_name varchar(32) NOT NULL default '0',
+  	type_name varchar(32) NOT NULL default '0',
+  	method int(1) NOT NULL default '0'
+	) /*!40100 DEFAULT CHARACTER SET utf8 */;");
+      break;
     case 'pgsql':
       db_query("CREATE TABLE {tokenize} (
   			field_name varchar(32) NOT NULL default '0',
Index: tokenize.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/tokenize/tokenize.module,v
retrieving revision 1.5
diff -u -p -r1.5 tokenize.module
--- tokenize.module	3 Aug 2007 03:49:32 -0000	1.5
+++ tokenize.module	21 Jun 2008 18:44:37 -0000
@@ -4,6 +4,8 @@
 /**
  * @file
  *  Provides configurable, automatic tokenization of CCK widgets.
+ * 
+ * @ingroup token
  */
 
 /**
@@ -15,7 +17,8 @@
 function tokenize_form_alter($form_id, &$form) {
   if (isset($form['#node'])) {
     $node = $form['#node'];
-  } else {
+  } 
+  else {
     //This may seem pretty pointless, but it allows for some splicity down below.
     $node = stdClass;
     $node->type = '';
@@ -49,9 +52,10 @@ function tokenize_form_alter($form_id, &
       $form['#submit']['tokenize_content_admin_field_submit'] = array();
       
       break;
-    case $node->type . '_node_form':
+    case $node->type .'_node_form':
       $fields = tokenize_get_settings(NULL, $node->type);
-      foreach((array)$fields as $field => $method) {
+      dsm($fields);
+      foreach ((array)$fields as $field => $method) {
         $form[$field][0]['token_help'] = array(
           '#title' => t('Replacement patterns'),
           '#type' => 'fieldset',
@@ -79,10 +83,10 @@ function tokenize_nodeapi(&$node, $op, $
     case 'submit':
       $fields = array();
       $fields = tokenize_get_settings(NULL, $node->type);
-      foreach((array)$fields as $field => $method) {
+      foreach ((array)$fields as $field => $method) {
         if ($method == 2) {
           $new_field = array();
-          foreach($node->$field as $key => $value) {
+          foreach ($node->$field as $key => $value) {
             $value['value'] = token_replace($value['value'], $type = 'node', $node);
             $new_field[$key] = $value;          
           }
@@ -93,13 +97,12 @@ function tokenize_nodeapi(&$node, $op, $
     case 'view':
       $fields = array();
       $fields = tokenize_get_settings(NULL, $node->type);
-      foreach((array)$fields as $field => $method) {
+      foreach ((array)$fields as $field => $method) {
         if ($method == 1) {
           $node->content[$field]['#value'] = token_replace($node->content[$field]['#value'], 'node', $node);
         }
       }
       break;
-
   }
 }
  
@@ -109,7 +112,7 @@ function tokenize_nodeapi(&$node, $op, $
 function tokenize_content_admin_field_submit($form_id, $form_values) {
   db_query("DELETE FROM {tokenize} WHERE field_name = '%s' AND type_name = '%s'", $form_values['field_name'],  $form_values['type_name']);
 
-  if($form_values['tokenize'] > 0) {
+  if ($form_values['tokenize'] > 0) {
     db_query("INSERT INTO {tokenize} (field_name, type_name, method) VALUES ('%s', '%s', %d)", $form_values['field_name'], $form_values['type_name'], $form_values['tokenize']);
   }
 }
@@ -123,7 +126,8 @@ function tokenize_get_settings($field_na
   if (!$reset && $cached = cache_get('tokenize')) {
     // See if there's cached data. If so, use that. 
     $data = unserialize($cached->data);
-  } else {
+  }
+  else {
     $data = array(
       'by field' => array(),
       'by type' => array(),
@@ -132,14 +136,14 @@ function tokenize_get_settings($field_na
     $must_cache = TRUE;
     $qs = db_query("SELECT * FROM {tokenize}") ;
 
-    while($obj = db_fetch_object($qs)) {
+    while ($obj = db_fetch_object($qs)) {
       $data['by field'][$obj->field_name][$obj->type_name] = $obj->method;
       $data['by type'][$obj->type_name][$obj->field_name] = $obj->method;
     }
   }
 
-  if($must_cache) {
-    if(!empty($cached)) {
+  if ($must_cache) {
+    if (!empty($cached)) {
       cache_clear_all('tokenize', 'cache');
     }
     cache_set('tokenize', 'cache', serialize($data), CACHE_PERMANENT);
