Index: content.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cck/content.install,v
retrieving revision 1.42
diff -u -r1.42 content.install
--- content.install	4 Jul 2007 20:40:35 -0000	1.42
+++ content.install	6 Jul 2007 11:27:07 -0000
@@ -3,13 +3,19 @@
 
 /**
  * Implementation of hook_install().
- *
- * The 4.7 install file had creation text for a node_type table that is now created by core.
- * The install script for that table has been removed from the 5.x branch install file.
- * Refer to the 4.7 install file to see the original database configuration script.
  */
 function content_install() {
   variable_set('content_schema_version', 1003);
+  drupal_install_schema('content');
+}
+
+
+/**
+ * Implementation of hook_uninstall().
+ */
+function content_uninstall() {
+  variable_del('content_schema_version');
+  drupal_uninstall_schema('content');
 }
 
 /**
Index: content.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cck/content.module,v
retrieving revision 1.131
diff -u -r1.131 content.module
--- content.module	4 Jul 2007 23:47:54 -0000	1.131
+++ content.module	6 Jul 2007 12:01:30 -0000
@@ -13,8 +13,8 @@
 define('CONTENT_CALLBACK_DEFAULT', 0x0002);
 define('CONTENT_CALLBACK_CUSTOM', 0x0004);
 
-function content_help($section) {
-  if (preg_match('!^admin/content/types/.*/display$!', $section)) {
+function content_help($path, $arg) {
+  if (preg_match('!^admin/content/types/.*/display$!', $path)) {
     return t("Configure how this content type's fields and field labels should be displayed when it's viewed in teaser and full-page mode.");
   }
 }
@@ -33,13 +33,13 @@
 function content_init() {
   drupal_add_css(drupal_get_path('module', 'content') .'/content.css');
   if (arg(0) == 'admin') {
-    include_once('./'. drupal_get_path('module', 'content') .'/content_admin.inc');
+    module_load_include('inc', 'content', 'content_admin');
   }
   if (module_exists('views')) {
-    include_once('./'. drupal_get_path('module', 'content') .'/content_views.inc');
+    module_load_include('inc', 'content', 'content_views');
   }
   if (module_exists('pathauto')) {
-    include_once('./'. drupal_get_path('module', 'content') .'/content_pathauto.inc');
+    module_load_include('inc', 'content', 'content_pathauto');
   }
 }
 
@@ -48,10 +48,8 @@
  */
 function content_menu() {
   $items = array();
-  $access = user_access('administer content types');
-
   $items['admin/content/types/fields'] = array(
-    'title' => t('Fields'),
+    'title' => 'Fields',
     'page callback' => '_content_admin_type_fields',
     'access arguments' => array('administer content types'),
     'type' => MENU_LOCAL_TASK,
@@ -62,52 +60,84 @@
     $type_url_str = $content_type['url_str'];
 
     $items['admin/content/types/'. $type_url_str .'/fields'] = array(
-      'title' => t('Manage fields'),
+      'title' => 'Manage fields',
       'page callback' => 'drupal_get_form',
       'page arguments' => array('content_admin_field_overview_form', $type_name),
       'access arguments' => array('administer content types'),
+      'file' => 'content_admin.inc',
+      'file path' => drupal_get_path('module', 'content'),
       'type' => MENU_LOCAL_TASK,
       'weight' => 0,
     );
     $items['admin/content/types/'. $type_url_str .'/display'] = array(
-      'title' => t('Display fields'),
+      'title' => 'Display fields',
       'page callback' => 'drupal_get_form',
       'page arguments' => array('content_admin_display_overview_form', $type_name),
       'access arguments' => array('administer content types'),
+      'file' => 'content_admin.inc',
+      'file path' => drupal_get_path('module', 'content'),
       'type' => MENU_LOCAL_TASK,
       'weight' => 1,
     );
     $items['admin/content/types/'. $type_url_str .'/add_field'] = array(
-      'title' => t('Add field'),
+      'title' => 'Add field',
       'page callback' => '_content_admin_field_add',
       'page arguments' => array($type_name),
       'access arguments' => array('administer content types'),
+      'file' => 'content_admin.inc',
+      'file path' => drupal_get_path('module', 'content'),
       'type' => MENU_LOCAL_TASK,
       'weight' => 2,
     );
     foreach ($content_type['fields'] as $field) {
       $field_name = $field['name'];
       $items['admin/content/types/'. $type_url_str .'/fields/'. $field_name] = array(
-        'title' => t($field['widget']['label']),
+        'title' => $field['widget']['label'],
         'page callback' => 'drupal_get_form',
         'page arguments' => array('_content_admin_field', $type_name, $field_name),
+        'file' => 'content_admin.inc',
+        'file path' => drupal_get_path('module', 'content'),
         'access arguments' => array('administer content types'),
         'type' => MENU_CALLBACK,
       );
       $items['admin/content/types/'. $type_url_str .'/fields/'. $field_name .'/remove'] = array(
-        'title' => t('Remove field'),
+        'title' => 'Remove field',
         'page callback' => 'drupal_get_form',
         'page arguments' => array('_content_admin_field_remove', $type_name, $field_name),
         'access arguments' => array('administer content types'),
+        'file' => 'content_admin.inc',
+        'file path' => drupal_get_path('module', 'content'),
         'type' => MENU_CALLBACK,
       );
     }
   }
-
   return $items;
 }
 
 /**
+ * Implementation of hook_theme().
+ */
+function content_theme() {
+  return array(
+    'content_field' => array(
+      'arguments' => array('node', 'field', 'items', 'teaser', 'page'),
+      ),
+    'content_admin_field_overview_form' => array(
+      'arguments' => array('form'),
+      ),
+    'content_admin_display_overview_form' => array(
+      'arguments' => array('form'),
+      ),
+    'content_admin_field_add_new_field_widget_type' => array(
+      'arguments' => array('form'),
+      ),
+    'content_view_multiple_field' => array(
+      'arguments' => array('items', 'field', 'data'),
+      ),
+    );
+}
+
+/**
  * Load data for a node type's fields.
  *
  * When loading one of the content.module nodes, we need to let each field handle
@@ -117,7 +147,7 @@
 function content_load($node) {
   $cid = 'content:'. $node->nid .':'. $node->vid;
   if ($cached = cache_get($cid, 'cache_content')) {
-    return unserialize($cached->data);
+    return $cached->data;
   }
   else {
     $default_additions = _content_field_invoke_default('load', $node);
@@ -132,7 +162,7 @@
         $default_additions[$key] = $value;
       }
     }
-    cache_set($cid, 'cache_content', serialize($default_additions));
+    cache_set($cid, $default_additions, 'cache_content');
     return $default_additions;
   }
 }
@@ -302,8 +332,8 @@
  *  any time the content module is enabled.
  */
 function content_enable() {
-  include_once('./'. drupal_get_path('module', 'content') .'/content_admin.inc');
-  include_once('./'. drupal_get_path('module', 'content') .'/content_crud.inc');
+  module_load_include('inc', 'content', 'content_admin');
+  module_load_include('inc', 'content', 'content_crud');
   content_types_rebuild();
 }
 
@@ -693,7 +723,7 @@
 
   if ($reset || !isset($info)) {
     if ($cached = cache_get('content_type_info', 'cache_content')) {
-      $info = unserialize($cached->data);
+      $info = $cached->data;
     }
     else {
       $info = array(
@@ -774,7 +804,7 @@
         $info['content types'][$type['type']] = $type;
       }
 
-      cache_set('content_type_info', 'cache_content', serialize($info));
+      cache_set('content_type_info', $info, 'cache_content');
     }
   }
   return $info;
@@ -787,15 +817,15 @@
 function content_node_type($op, $info) {
   switch ($op) {
     case 'insert':
-      include_once('./'. drupal_get_path('module', 'content') .'/content_crud.inc');
+      module_load_include('inc', 'content', 'content_crud');
       content_type_create($info);
       break;
     case 'update':
-      include_once('./'. drupal_get_path('module', 'content') .'/content_crud.inc');
+      module_load_include('inc', 'content', 'content_crud');
       content_type_update($info);
       break;
     case 'delete':
-      include_once('./'. drupal_get_path('module', 'content') .'/content_crud.inc');
+      module_load_include('inc', 'content', 'content_crud');
       content_type_delete($info);
       break;
   }
Index: content.schema
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cck/content.schema,v
retrieving revision 1.2
diff -u -r1.2 content.schema
--- content.schema	5 Jul 2007 15:13:40 -0000	1.2
+++ content.schema	6 Jul 2007 11:23:29 -0000
@@ -35,55 +35,5 @@
   // Create a table for the cache.
   $schema['cache_content'] = drupal_get_schema_unprocessed('system', 'cache');
 
-  // Add a table for each content type.
-  $content_type_info = _content_type_info();
-  foreach (content_types() as $type_name => $content_type) {
-    $content_tablename = _content_tablename($type_name, CONTENT_DB_STORAGE_PER_CONTENT_TYPE);
-    $schema[$content_tablename] = array(
-      'fields' => array(
-        'nid'     => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
-        'vid'     => array('type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE, 'default' => 0),
-      ),
-      'indexes' => array(
-        'nid'     => array('nid'),
-      ),
-      'unique keys' => array(
-        'nid_vid' => array('nid', 'vid'),
-        'vid'     => array('vid')
-      ),
-      'primary key' => array('nid'),
-    );
-    // Add per content type fields to content table schema.
-    foreach ($content_type_info['content type'][$type_name]['fields'] as $field_name => $field) {
-      $db_info = content_database_info($field);
-      if ($db_info['table'] == $content_table) {
-        $schema[$content_tablename]['fields'] += $db_info['columns'];
-      }
-    }
-  }
-
-  // Add a table for each field that has its own table.
-  foreach ($content_type_info['fields'] as $field_name => $field) {
-    $field_tablename = _content_tablename($field_name, CONTENT_DB_STORAGE_PER_FIELD);
-    $db_info = content_database_info($field);
-    if ($db_info['table'] == $field_tablename) {
-      $schema[$field_tablename] = array(
-        'fields' => array(
-          'nid'     => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
-          'vid'     => array('type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE, 'default' => 0),
-        ),
-        'indexes' => array(
-          'nid'     => array('nid'),
-        ),
-        'unique keys' => array(
-          'nid_vid' => array('nid', 'vid'),
-          'vid'     => array('vid')
-        ),
-        'primary key' => array('nid'),
-      );
-      $schema[$field_tablename]['fields'] += $db_info['columns'];
-    }
-  }
-
   return $schema;
 }
\ No newline at end of file
Index: content_admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cck/content_admin.inc,v
retrieving revision 1.67
diff -u -r1.67 content_admin.inc
--- content_admin.inc	4 Jul 2007 23:47:54 -0000	1.67
+++ content_admin.inc	5 Jul 2007 23:50:34 -0000
@@ -53,11 +53,12 @@
   $dummy_node = new stdClass();
   $dummy_node->type = $type['type'];
   $dummy_node->name = '';
-  $dummy_form_id = $type['type'] .'_node_form';
-  $dummy_form = node_form($dummy_node);
+  $form_state = array();
+  $dummy_form = array();
+  $dummy_form = node_form($form_state, $dummy_form);
   foreach (module_implements('form_alter') as $module) {
     $function = $module .'_form_alter';
-    $function($dummy_form, $dummy_form_id);
+    $function($dummy_form, $form_state);
   }
 
   // Move group fields into a 'fields' subgroup to make them easier to identify.
@@ -712,7 +713,7 @@
   $field = $type['fields'][$form_values['field_name']];
 
   if ($type && $field && $form_values['confirm']) {
-    include_once('./'. drupal_get_path('module', 'content') .'/content_crud.inc');
+    module_load_include('inc', 'content', 'content_crud');
     content_field_instance_delete($form_values);
 
     drupal_set_message(t('Removed field %field from %type.', array('%field' => $field['widget']['label'], '%type' => $type['name'])));
Index: content_copy.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cck/content_copy.info,v
retrieving revision 1.4
diff -u -r1.4 content_copy.info
--- content_copy.info	4 Jul 2007 23:46:29 -0000	1.4
+++ content_copy.info	6 Jul 2007 00:00:04 -0000
@@ -1,6 +1,6 @@
 ; $Id: content_copy.info,v 1.4 2007/07/04 23:46:29 yched Exp $
 name = Content Copy
 description = Enables ability to import/export field definitions.
-dependencies = content
+dependencies[] = content
 package = CCK
 core = 6.x
\ No newline at end of file
Index: fieldgroup.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cck/fieldgroup.info,v
retrieving revision 1.4
diff -u -r1.4 fieldgroup.info
--- fieldgroup.info	4 Jul 2007 23:46:29 -0000	1.4
+++ fieldgroup.info	5 Jul 2007 23:59:52 -0000
@@ -1,6 +1,6 @@
 ; $Id: fieldgroup.info,v 1.4 2007/07/04 23:46:29 yched Exp $
 name = Fieldgroup
 description = Create field groups for CCK fields.
-dependencies = content
+dependencies[] = content
 package = CCK
 core = 6.x
\ No newline at end of file
Index: fieldgroup.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cck/fieldgroup.install,v
retrieving revision 1.16
diff -u -r1.16 fieldgroup.install
--- fieldgroup.install	4 Jul 2007 20:40:35 -0000	1.16
+++ fieldgroup.install	6 Jul 2007 11:26:36 -0000
@@ -2,6 +2,22 @@
 // $Id: fieldgroup.install,v 1.16 2007/07/04 20:40:35 yched Exp $
 
 /**
+ * Implementation of hook_install().
+ */
+function fieldgroup_install() {
+  drupal_install_schema('fieldgroup');
+}
+
+
+/**
+ * Implementation of hook_uninstall().
+ */
+function fieldgroup_uninstall() {
+  drupal_uninstall_schema('fieldgroup');
+}
+
+
+/**
  *  rename groups form "group-*" to "group_*"
  */
 function fieldgroup_update_1() {
Index: fieldgroup.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cck/fieldgroup.module,v
retrieving revision 1.31
diff -u -r1.31 fieldgroup.module
--- fieldgroup.module	4 Jul 2007 23:47:54 -0000	1.31
+++ fieldgroup.module	6 Jul 2007 12:15:36 -0000
@@ -5,48 +5,59 @@
  * @file
  * Create field groups for CCK fields.
  */
+function fieldgroup_init() {
+  drupal_add_css(drupal_get_path('module', 'fieldgroup') .'/fieldgroup.css');
+}
 
-function fieldgroup_menu($may_cache) {
-  if (!$may_cache) {
-    if (arg(0) == 'admin' && arg(1) == 'content' && arg(2) == 'types' && arg(3)) {
-
-      $content_type = content_types(arg(3));
-
-      if (!empty($content_type) && arg(3) && arg(3) == $content_type['url_str']) {
-        $items[] = array(
-          'path' => 'admin/content/types/'. arg(3) .'/add_group',
-          'title' => t('Add group'),
-          'callback' => 'fieldgroup_edit_group',
-          'access' => user_access('administer content types'),
-          'callback arguments' => array($content_type, '', 'add'),
-          'type' => MENU_LOCAL_TASK,
-          'weight' => 3,
-          );
-        if (arg(4) == 'groups' && arg(5)) {
-          $items[] = array(
-            'path' => 'admin/content/types/'. arg(3) .'/groups/'. arg(5) .'/edit',
-            'title' => t('Edit group'),
-            'callback' => 'fieldgroup_edit_group',
-            'access' => user_access('administer content types'),
-            'callback arguments' => array($content_type, arg(5), 'edit'),
-            'type' => MENU_CALLBACK_ITEM,
-            );
-          $items[] = array(
-            'path' => 'admin/content/types/'. arg(3) .'/groups/'. arg(5) .'/remove',
-            'title' => t('Edit group'),
-            'callback' => 'drupal_get_form',
-            'callback arguments' => array('fieldgroup_remove_group', $content_type, arg(5)),
-            'access' => user_access('administer content types'),
-            'type' => MENU_CALLBACK_ITEM,
-            );
-        }
-      }
-    }
+/**
+ * Implementation of hook_menu().
+ */
+function fieldgroup_menu() {
+  $items = array();
 
-    drupal_add_css(drupal_get_path('module', 'fieldgroup') .'/fieldgroup.css');
+  foreach (node_get_types() as $type) {
+    $type_name = $type->type;
+    $content_type = content_types($type_name);
+    $type_url_str = $content_type['url_str'];
+
+    $items['admin/content/types/'. $type_url_str .'/add_group'] = array(
+      'title' => 'Add group',
+      'page callback' => 'drupal_get_form',
+      'page arguments' => array($content_type, '', 'add'),
+      'access arguments' => array('administer content types'),
+      'type' => MENU_LOCAL_TASK,
+      'weight' => 3,
+    );
+    $items['admin/content/types/'. $type_url_str .'/groups/%/edit'] = array(
+      'title' => 'Edit group',
+      'page callback' => 'fieldgroup_edit_group',
+      'page arguments' => array($content_type, 5, 'edit'),
+      'access arguments' => array('administer content types'),
+      'type' => MENU_CALLBACK,
+    );
+    $items['admin/content/types/'. $type_url_str .'/groups/%/remove'] = array(
+      'title' => 'Edit group',
+      'page callback' => 'drupal_get_form',
+      'page arguments' => array('fieldgroup_remove_group', $content_type, 5),
+      'access arguments' => array('administer content types'),
+      'type' => MENU_CALLBACK,
+    );
   }
   return $items;
+}
 
+/**
+ * Implementation of hook_theme().
+ */
+function fieldgroup_theme() {
+  return array(
+    'fieldgroup_simple' => array(
+      'arguments' => array('element'),
+      ),
+    'fieldgroup_display_overview_form' => array(
+      'arguments' => array('form'),
+      ),
+  );
 }
 
 function fieldgroup_edit_group($content_type, $group_name, $action) {
@@ -253,7 +264,7 @@
 
   if (!isset($groups) || $reset) {
     if ($cached = cache_get('fieldgroup_data', 'cache_content')) {
-      $data = unserialize($cached->data);
+      $data = $cached->data;
       $groups = $data['groups'];
       $groups_sorted = $data['groups_sorted'];
     }
@@ -275,7 +286,7 @@
       while ($field = db_fetch_array($result)) {
         $groups[$field['type_name']][$field['group_name']]['fields'][$field['field_name']] = $field;
       }
-      cache_set('fieldgroup_data', 'cache_content', serialize(array('groups' => $groups, 'groups_sorted' => $groups_sorted)));
+      cache_set('fieldgroup_data', array('groups' => $groups, 'groups_sorted' => $groups_sorted), 'cache_content');
     }
   }
 
Index: fieldgroup.schema
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cck/fieldgroup.schema,v
retrieving revision 1.1
diff -u -r1.1 fieldgroup.schema
--- fieldgroup.schema	4 Jul 2007 20:40:35 -0000	1.1
+++ fieldgroup.schema	5 Jul 2007 23:07:03 -0000
@@ -24,7 +24,5 @@
     'primary key' => array('type_name', 'group_name'),
   );
 
-  $schema['cache_content'] = drupal_get_schema_unprocessed('system', 'cache');
-
   return $schema;
 }
\ No newline at end of file
Index: nodereference.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cck/nodereference.info,v
retrieving revision 1.5
diff -u -r1.5 nodereference.info
--- nodereference.info	4 Jul 2007 23:46:29 -0000	1.5
+++ nodereference.info	5 Jul 2007 23:59:46 -0000
@@ -1,6 +1,6 @@
 ; $Id: nodereference.info,v 1.5 2007/07/04 23:46:29 yched Exp $
 name = Node Reference
 description = Defines a field type for referencing one node from another.
-dependencies = content
+dependencies[] = content
 package = CCK
 core = 6.x
\ No newline at end of file
Index: nodereference.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cck/nodereference.module,v
retrieving revision 1.65
diff -u -r1.65 nodereference.module
--- nodereference.module	28 Jun 2007 14:49:24 -0000	1.65
+++ nodereference.module	5 Jul 2007 23:22:40 -0000
@@ -22,6 +22,20 @@
 }
 
 /**
+ * Implementation of hook_theme().
+ */
+function nodereference_theme() {
+  return array(
+    'nodereference_simple' => array(
+      'arguments' => array('item'),
+      ),
+    'nodereference_advanced' => array(
+      'arguments' => array('item', 'view'),
+      ),
+  );
+}
+
+/**
  * Implementation of hook_field_info().
  */
 function nodereference_field_info() {
Index: number.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cck/number.info,v
retrieving revision 1.5
diff -u -r1.5 number.info
--- number.info	4 Jul 2007 23:46:29 -0000	1.5
+++ number.info	5 Jul 2007 23:59:40 -0000
@@ -1,6 +1,6 @@
 ; $Id: number.info,v 1.5 2007/07/04 23:46:29 yched Exp $
 name = Number
 description = Defines numeric field types.
-dependencies = content
+dependencies[] = content
 package = CCK
 core = 6.x
\ No newline at end of file
Index: optionwidgets.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cck/optionwidgets.info,v
retrieving revision 1.5
diff -u -r1.5 optionwidgets.info
--- optionwidgets.info	4 Jul 2007 23:46:29 -0000	1.5
+++ optionwidgets.info	5 Jul 2007 23:59:34 -0000
@@ -1,6 +1,6 @@
 ; $Id: optionwidgets.info,v 1.5 2007/07/04 23:46:29 yched Exp $
 name = Option Widgets
 description = Defines selection, check box and radio button widgets for text and numeric fields.
-dependencies = content
+dependencies[] = content
 package = CCK
 core = 6.x
\ No newline at end of file
Index: optionwidgets.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cck/optionwidgets.module,v
retrieving revision 1.18
diff -u -r1.18 optionwidgets.module
--- optionwidgets.module	29 Mar 2007 12:52:37 -0000	1.18
+++ optionwidgets.module	5 Jul 2007 23:23:47 -0000
@@ -7,6 +7,17 @@
  */
 
 /**
+ * Implementation of hook_theme().
+ */
+function optionwidgets_theme() {
+  return array(
+    'optionwidgets_none' => array(
+      'arguments' => array('widget_type', 'field_name', 'node_type'),
+      ),
+  );
+}
+
+/**
  * Implementation of hook_widget_info().
  */
 function optionwidgets_widget_info() {
Index: text.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cck/text.info,v
retrieving revision 1.5
diff -u -r1.5 text.info
--- text.info	4 Jul 2007 23:46:29 -0000	1.5
+++ text.info	5 Jul 2007 23:59:28 -0000
@@ -1,6 +1,6 @@
 ; $Id: text.info,v 1.5 2007/07/04 23:46:29 yched Exp $
 name = Text
 description = Defines simple text field types.
-dependencies = content
+dependencies[] = content
 package = CCK
 core = 6.x
\ No newline at end of file
