--- www/sites/all/modules/custom/node_form_rearrange/node_form_rearrange.module	2009-05-04 16:12:28.000000000 +0200
+++ www/sites/all/modules/original/node_form_rearrange/node_form_rearrange.module	2008-11-17 23:55:04.000000000 +0100
@@ -4,85 +4,45 @@
 /**
  * @file
  * Implements three hooks. This allows for form elements provided by the taxonomy
- * module to be rearranged individually in node add/edit forms.
+ * module to be rearranged individually in node add/edit forms. 
  */
 
-function node_form_rearrange_menu() {
-  $items = array();
-  $items['admin/settings/node-form-rearrange'] = array(
-    'title' => 'Node Form Rearrange Settings',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('node_form_rearrange_settings'),
-    'access arguments' => array('administer nodes'),
-    'type' => MENU_NORMAL_ITEM,
-  );
-  return $items;
-}
-
-/**
- * Form builder
- * Menu callback for the Future Express settings: Taxonomy.
- *
- * @ingroup forms
- * @see system_settings_form().
- */
-function node_form_rearrange_settings() {
-  $form = array();
-  $types = node_get_types('names');
-  /*foreach (taxonomy_get_vocabularies() as $vocabulary) {
-   $options[$vocabulary->vid] = $vocabulary->name;
-   }*/
-  $form['node_form_rearrange_content_types'] = array(
-    '#type' => 'checkboxes',
-    '#description' => 'Check the content types for which you want to use the Form Rearrange Functions',
-    '#title' => t('Rearrange Content Types'),
-    '#options' => $types,
-    '#default_value' => variable_get('node_form_rearrange_content_types', array(0)),
-    '#required' => TRUE,
-  );
-
-  return system_settings_form($form);
-}
-
-
 /**
  * Implementation of hook_form_alter().
  */
-function node_form_rearrange_form_alter(&$form, $form_state, $form_id) {
 
+function node_form_rearrange_form_alter(&$form, $form_state, $form_id) {
   if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'] .'_node_form' == $form_id) {
-    $types = variable_get('node_form_rearrange_content_types', array(0));
-    if(isset($types[$form['type']['#value']]) && ($types[$form['type']['#value']] != '0')) {
-      //retrieve all vocabularies for this node's content type
-      $vocabularies = db_query(db_rewrite_sql("SELECT v.* FROM {vocabulary} v INNER JOIN {vocabulary_node_types} n ON v.vid = n.vid WHERE n.type = '%s'
+    //retrieve all vocabularies for this node's content type
+    $vocabularies = db_query(db_rewrite_sql("SELECT v.* FROM {vocabulary} v INNER JOIN {vocabulary_node_types} n ON v.vid = n.vid WHERE n.type = '%s'
 ORDER BY v.weight, v.name", 'v', 'vid'), $form['type']['#value']);
-      //loop through vocabularies, moving their form element out of the taxonomy fieldset
-      while ($vocabulary = db_fetch_object($vocabularies)) {
-        //check to see if non-tag vocabularies exist
-        if ($form['taxonomy'][$vocabulary->vid]) {
-          $field = $form['taxonomy'][$vocabulary->vid];
-          unset($form['taxonomy'][$vocabulary->vid]);
-          $form["taxonomy_field_$vocabulary->vid"] = $field;
-        }
-        //check to see if tag vocabularies exist
-        if ($form['taxonomy']['tags'][$vocabulary->vid]) {
-          $field = $form['taxonomy']['tags'][$vocabulary->vid];
-          unset($form['taxonomy']['tags'][$vocabulary->vid]);
-          $form["taxonomy_field_tags_$vocabulary->vid"] = $field;
-        }
-        // Direct copy from content.module, for setting the weight of fields based on arrangement in admin/content/node-type/[content type]/fields
-        $type = content_types($form['type']['#value']);
-        foreach ($type['extra'] as $key => $value) {
-          if (isset($form[$key])) {
-            $form[$key]['#weight'] = $value['weight'];
-          }
-        }
+    //loop through vocabularies, moving their form element out of the taxonomy fieldset
+    while ($vocabulary = db_fetch_object($vocabularies)) {
+    //check to see if non-tag vocabularies exist 
+    if ($form['taxonomy'][$vocabulary->vid]) {
+        $field = $form['taxonomy'][$vocabulary->vid];
+        unset($form['taxonomy'][$vocabulary->vid]);
+        $form["taxonomy_field_$vocabulary->vid"] = $field;
       }
-      //Removing now empty taxonomy fieldset
-      if (isset($form['taxonomy'])) {
-        unset($form['taxonomy']);
+      //check to see if tag vocabularies exist
+      if ($form['taxonomy']['tags'][$vocabulary->vid]) {
+        $field = $form['taxonomy']['tags'][$vocabulary->vid];
+        unset($form['taxonomy']['tags'][$vocabulary->vid]);
+        $form["taxonomy_field_tags_$vocabulary->vid"] = $field;
       }
+      // Direct copy from content.module, for setting the weight of fields based on arrangement in admin/content/node-type/[content type]/fields
+      $type = content_types($form['type']['#value']);
+      foreach ($type['extra'] as $key => $value) {
+        if (isset($form[$key])) {
+          $form[$key]['#weight'] = $value['weight'];
+        }
+      }
+    }
+    //Removing now empty taxonomy fieldset
+    if (isset($form['taxonomy'])) {
+      unset($form['taxonomy']);
     }
+    
   }
 }
 
@@ -93,26 +53,22 @@ ORDER BY v.weight, v.name", 'v', 'vid'),
 function node_form_rearrange_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
   switch ($op) {
     case 'presave':
-      $types = variable_get('node_form_rearrange_content_types', array(0));
-      if(isset($types[$node->type]) && ($types[$node->type] != '0')) {
-
-        $vocabularies = db_query(db_rewrite_sql("SELECT v.* FROM {vocabulary} v INNER JOIN {vocabulary_node_types} n ON v.vid = n.vid WHERE n.type = '%s'
+      $vocabularies = db_query(db_rewrite_sql("SELECT v.* FROM {vocabulary} v INNER JOIN {vocabulary_node_types} n ON v.vid = n.vid WHERE n.type = '%s'
 ORDER BY v.weight, v.name", 'v', 'vid'), $node->type);
-        //loop through vocabularies, resetting the original data arrangement (fields in taxonomy fieldset) so the taxonomy is saved
-        while ($vocabulary = db_fetch_object($vocabularies)) {
-          $fieldname = 'taxonomy_field_'. $vocabulary->vid;
-          if (isset($node->$fieldname) && $node->$fieldname) {
-            $node->taxonomy[$vocabulary->vid] = $node->$fieldname;
-            unset($node->$fieldname);
-          }
-          $fieldname = 'taxonomy_field_tags_'. $vocabulary->vid;
-          if (isset($node->$fieldname) && $node->$fieldname) {
-            $node->taxonomy['tags'][$vocabulary->vid] = $node->$fieldname;
-            unset($node->$fieldname);
-          }
+      //loop through vocabularies, resetting the original data arrangement (fields in taxonomy fieldset) so the taxonomy is saved
+      while ($vocabulary = db_fetch_object($vocabularies)) {
+        $fieldname = 'taxonomy_field_'. $vocabulary->vid; 
+        if (isset($node->$fieldname) && $node->$fieldname) {
+          $node->taxonomy[$vocabulary->vid] = $node->$fieldname;
+          unset($node->$fieldname);
+        }
+        $fieldname = 'taxonomy_field_tags_'. $vocabulary->vid;
+        if (isset($node->$fieldname) && $node->$fieldname) {
+          $node->taxonomy['tags'][$vocabulary->vid] = $node->$fieldname;
+          unset($node->$fieldname);
         }
-        break;
       }
+      break; 
   }
 }
 
@@ -122,7 +78,7 @@ ORDER BY v.weight, v.name", 'v', 'vid'),
 
 function node_form_rearrange_content_extra_fields($type_name) {
   $extra = array();
-  $vocabularies = db_query(db_rewrite_sql("SELECT v.* FROM {vocabulary} v INNER JOIN {vocabulary_node_types} n ON v.vid = n.vid WHERE n.type = '%s'
+  $vocabularies = db_query(db_rewrite_sql("SELECT v.* FROM {vocabulary} v INNER JOIN {vocabulary_node_types} n ON v.vid = n.vid WHERE n.type = '%s' 
 ORDER BY v.weight, v.name", 'v', 'vid'), $type_name);
   //add rows for each vocabulary
   while ($vocabulary = db_fetch_object($vocabularies)) {
@@ -138,7 +94,7 @@ ORDER BY v.weight, v.name", 'v', 'vid'),
         'description' => t('Individual field for %vocabularyname vocabulary, disables Taxonomy group', array('%vocabularyname' => $vocabulary->name)),
         'weight' => -5);
     }
-  }
-  return $extra;
+  }  
+  return $extra; 
 }
 
