Index: field_copy.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/field_copy/field_copy.info,v
retrieving revision 1.2
diff -u -r1.2 field_copy.info
--- field_copy.info	4 Oct 2008 11:11:54 -0000	1.2
+++ field_copy.info	8 Feb 2009 22:22:40 -0000
@@ -1,5 +1,6 @@
-; $Id $
+; $Id$
 name = Field Copy
-description = "Allows copying one field's data to another field for all instances of a content type."
-dependencies = content
-package = CCK
\ No newline at end of file
+description = Allows copying one field's data to another field for all instances of a content type.
+dependencies[] = content
+package = CCK
+core = 6.x
\ No newline at end of file
Index: field_copy.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/field_copy/field_copy.module,v
retrieving revision 1.3
diff -u -r1.3 field_copy.module
--- field_copy.module	4 Oct 2008 11:12:06 -0000	1.3
+++ field_copy.module	8 Feb 2009 22:23:37 -0000
@@ -1,14 +1,14 @@
 <?php
-//$Id: field_copy.module,v 1.3 2008/10/04 11:12:06 regx Exp $
+// $Id: field_copy.module,v 1.3 2008/10/04 11:12:06 regx Exp $
 
 /**
-* @file: field_copy.module
-* cck copy body module for Drupal 5.x
-* Allows copying one field's data to another field for all instances of a content type..
-* ----------------------------------------------------------------------------
-* @author: regx (gvarnell@osoft.com)
-* @copyright: 2007-2008 Gary Varnell
-*/
+ * @file: field_copy.module
+ * cck copy body module for Drupal 6.x
+ * Allows copying one field's data to another field for all instances of a content type.
+ *
+ * @author: regx (gvarnell@osoft.com)
+ * @copyright: 2007-2008 Gary Varnell
+ */
 
 /** @annotation: @todo - Write Test */
 /** @annotation: @todo - Remove CCK dependancy */
@@ -25,39 +25,31 @@
 /**
  * Implementation of hook_menu().
  */
- 
-
-function field_copy_menu($may_cache) {
-if($may_cache){
-  $items[] = array(
-    'path' => 'admin/settings/field_copy',
-    'title' => t('Field Copy'),
-    'description' => t('Allows copying cck node body contents to another cck field.'),
-    'callback' => 'drupal_get_form',
-    'callback arguments' => array('field_copy_form'),
-    'access' => user_access('administer site configuration'),
-    'type' => MENU_NORMAL_ITEM, // optional
+function field_copy_menu() {
+  $items['admin/settings/field_copy'] = array(
+    'title' => 'Field Copy',
+    'description' => 'Allows copying cck node body contents to another cck field.',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('field_copy_form'),
+    'access arguments' => array('administer site configuration'),
   );
-  $items[] = array(
-    'path' => 'admin/content/field_copy',
-    'title' => t('Field Copy'),
-    'description' => t('Allows copying cck node body contents to another cck field.'),
-    'callback' => 'drupal_get_form',
-    'callback arguments' => array('field_copy_form'),
-    'access' => user_access('administer content'),
-    'type' => MENU_NORMAL_ITEM, // optional
+  $items['admin/content/field_copy'] = array(
+    'title' => 'Field Copy',
+    'description' => 'Allows copying cck node body contents to another cck field.',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('field_copy_form'),
+    'access arguments' => array('administer content'),
   );
+  return $items;
 }
- return $items;
-}
-//----------------------------------------------------------------------
 
 /**
-* @name field_copy_form()
-* Implementation of hook_menu().
-* @return array field_copy_form
-*/
-function field_copy_form(){
+ * Implementation of hook_menu().
+ *
+ * @name field_copy_form()
+ * @return array field_copy_form
+ */
+function field_copy_form() {
   # get the content types
   $content_types = field_copy_get_content_types();
   //field_copy_debug($content_types);
@@ -157,19 +149,20 @@
 
 
 /**
-* @name field_copy_form_validate
-* @desc implementation of hook_validate
-* Checks that source and Target fields are defined and have the same field type
-*/
-function field_copy_form_validate($formid,$form_values) {
+ * Implementation of hook_validate().
+ *
+ * @name field_copy_form_validate
+ * Checks that source and Target fields are defined and have the same field type
+ */
+function field_copy_form_validate($form, &$form_state) {
   # get the content types
   
-  if($form_values['op'] == t('Reset')){
+  if($form_state['values']['op'] == t('Reset')){
     drupal_goto('admin/content/field_copy');
   }
   $content_types = field_copy_get_content_types();
   field_copy_debug($content_types);
-  foreach($form_values['field'] as $fv_c_type => $fv_c_data){
+  foreach($form_state['values']['field'] as $fv_c_type => $fv_c_data){
     #make sure both target and source are defined
     $source = $fv_c_data['source'];
     $target = $fv_c_data['target'];
@@ -200,8 +193,8 @@
 }
 
 
-function field_copy_form_submit($formid,$form_values){
-  foreach($form_values['field'] as $fv_c_type => $fv_c_data){
+function field_copy_form_submit($form, &$form_state) {
+  foreach($form_state['values']['field'] as $fv_c_type => $fv_c_data){
     $source = $fv_c_data['source'];
     $target = $fv_c_data['target'];
     $nullify = $fv_c_data['nullify'];
@@ -219,9 +212,9 @@
 */ 
 function field_copy_get_content_types($content_type = NULL){
   # get the content types
-  include_once('./'. drupal_get_path('module', 'node') .'/content_types.inc');
-  include_once('./'. drupal_get_path('module', 'content') .'/content_admin.inc');
-  include_once('./'. drupal_get_path('module', 'content') .'/content_crud.inc');
+  include_once(drupal_get_path('module', 'node') .'/content_types.inc');
+  include_once(drupal_get_path('module', 'content') .'/includes/content.admin.inc');
+  include_once(drupal_get_path('module', 'content') .'/includes/content.crud.inc');
   $content_types = content_types($content_type);
   //field_copy_debug($content_types);
   return $content_types;
@@ -313,8 +306,9 @@
 
 
 
-/** Begin Helper Functions
--------------------------------------------------------------------------------------------------  **/
+/**
+ * Helper functions.
+ */
 function field_copy_debug($msg){
   if(FIELD_COPY_DEBUG){
     if(is_array($msg) || is_object($msg)){
@@ -324,5 +318,4 @@
       drupal_set_message('field_copy: ' . $msg,'debug');
     }
   }
-}
-?>
\ No newline at end of file
+}
\ No newline at end of file

