--- tokenize.info.org	2008-10-17 01:13:24.000000000 +0100
+++ tokenize.info	2008-10-20 15:42:11.029000000 +0100
@@ -1,9 +1,10 @@
 ; $Id: tokenize.info,v 1.1 2007/08/03 01:17:29 morrissinger Exp $
 name = Tokenize
 description = Provides configurable, automatic tokenization of CCK widgets.
-dependencies = token content
+core = 6.x
+dependencies[] = token
+dependencies[] = content
 ; Information added by drupal.org packaging script on 2008-10-17
-version = "5.x-1.x-dev"
+version = "6.x-1.x-dev"
 project = "tokenize"
-datestamp = "1224202403"
 
--- tokenize.module.org	2008-10-20 16:09:38.161000000 +0100
+++ tokenize.module	2008-10-20 16:22:32.929000000 +0100
@@ -1,5 +1,5 @@
 <?php
-// $Id: tokenize.module,v 1.8 2008/10/16 22:24:22 greggles Exp $
+// $Id$
 
 /**
  * @file
@@ -14,18 +14,17 @@
  * Adds a checkbox to the field settings form to allow tokenization.
  * Captures form submission to handle the checkbox.
  */
-function tokenize_form_alter($form_id, &$form) {
+function tokenize_form_alter(&$form, &$form_state, $form_id) {
   if (isset($form['#node'])) {
     $node = $form['#node'];
-  } 
-  else {
+  } else {
     //This may seem pretty pointless, but it allows for some splicity down below.
     $node = new stdClass();
     $node->type = '';
   }
 
   switch ($form_id) {
-    case '_content_admin_field':
+    case 'content_field_edit_form':
       $tokenize_widget = tokenize_get_settings($form['field_name']['#value'], $form['type_name']['#value'], TRUE);
 
       // Add a new checkbox for tokenization
@@ -49,7 +48,7 @@
       );
       
       // Make sure we capture form submission to deal with our new checkbox.
-      $form['#submit']['tokenize_content_admin_field_submit'] = array();
+      $form['#submit'][] = 'tokenize_content_admin_field_submit';
       
       break;
     case $node->type .'_node_form':
@@ -79,7 +78,7 @@
  */
 function tokenize_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
   switch ($op) {
-    case 'submit':
+    case 'presave':
       $fields = array();
       $fields = tokenize_get_settings(NULL, $node->type);
       foreach ((array)$fields as $field => $method) {
@@ -108,11 +107,11 @@
 /**
  * Form callback to capture submission of the field settings form
  */
-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']);
+function tokenize_content_admin_field_submit($form, &$form_state) {
+  db_query("DELETE FROM {tokenize} WHERE field_name = '%s' AND type_name = '%s'", $form_state['field_name'],  $form_state['type_name']);
 
-  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']);
+  if ($form_state['tokenize'] > 0) {
+    db_query("INSERT INTO {tokenize} (field_name, type_name, method) VALUES ('%s', '%s', %d)", $form_state['field_name'], $form_state['type_name'], $form_state['tokenize']);
   }
 }
 
@@ -124,7 +123,7 @@
   
   if (!$reset && $cached = cache_get('tokenize')) {
     // See if there's cached data. If so, use that. 
-    $data = unserialize($cached->data);
+    $data = $cached->data;
   }
   else {
     $data = array(
@@ -145,7 +144,7 @@
     if (!empty($cached)) {
       cache_clear_all('tokenize', 'cache');
     }
-    cache_set('tokenize', 'cache', serialize($data), CACHE_PERMANENT);
+    cache_set('tokenize', $data);
   }
 
   if (empty($field_name) && empty($type_name)) {
--- tokenize.install.org	2008-10-16 23:28:28.000000000 +0100
+++ tokenize.install	2008-10-20 16:02:35.651000000 +0100
@@ -1,25 +1,57 @@
 <?php
-// $Id: tokenize.install,v 1.3 2008/10/16 22:28:27 greggles Exp $
+// $Id$
+/**
+ * @file
+ * The install and update code for the tokenize module.
+ *
+ * @ingroup tokenize
+ */
+
 /**
  * Implementation of hook_install().
  */
 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;
-    case 'pgsql':
-      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'
-        )");
-      break;
-  }
-  drupal_set_message(t("Tokenize table created successfully."));
-}
\ No newline at end of file
+    drupal_install_schema('tokenize');
+    drupal_set_message(t("Tokenize table created successfully."));
+}
+
+/**
+ * Implementation of hook_install().
+ */
+function tokenize_schema() {
+  $schema = array();
+  $schema['tokenize'] = array(
+    'description' => t('The base table for tokenize module.'),
+    'fields' => array(
+      'field_name' => array(
+        'type' => 'varchar',
+        'length' => 32,
+        'not null' => TRUE,
+        'default' => '0',
+        'description' => t('Content type name (node, page, panel, view).'),
+      ),
+      'type_name' => array(
+        'type' => 'varchar',
+        'length' => 32,
+        'not null' => TRUE,
+        'default' => '0',
+        'description' => t('Unique content id within content type or blank for frontpage.'),
+      ),
+      'method' => array(
+        'type' => 'varchar',
+        'length' => 1,
+        'not null' => TRUE,
+        'default' => '0',
+        'description' => t('Meta tag name.'),
+      ),
+    ),
+  );
+  return $schema;
+}
+
+/**
+ * Implementation of hook_uninstall().
+ */
+function tokenize_uninstall() {
+    drupal_uninstall_schema('tokenize');
+}
