Index: alternate_hs_content_taxonomy.patch
===================================================================
Index: modules/hs_taxonomy.module
===================================================================
--- modules/hs_taxonomy.module	(revision 2829)
+++ modules/hs_taxonomy.module	(working copy)
@@ -190,36 +190,19 @@
   forum_form_container($form, $form_state);
 }
 
-function hs_taxonomy_form($vid, $value = 0, $help = NULL) {
+function hs_taxonomy_form($vid,$form_item) {
   require_once(drupal_get_path('module', 'hierarchical_select') .'/includes/common.inc');
-
-  $vocabulary = taxonomy_vocabulary_load($vid);
-  if (module_exists('i18ntaxonomy')) {
-    $title = check_plain(tt("taxonomy:vocabulary:$vid:name", $vocabulary->name));
-    $description = ($help) ? $help : tt("taxonomy:vocabulary:$vid:help", $vocabulary->help);
-  }
-  else {
-    $title = check_plain($vocabulary->name);
-    $description = ($help) ? $help : $vocabulary->help;
-  }
-
-  $form_item = array(
-    '#type'          => 'hierarchical_select',
-    '#config'        => array(
+    /*change settings to heirarchical select*/
+    $form_item['#type'] = 'hierarchical_select';
+    $form_item['#config'] = array(
       'module' => 'hs_taxonomy',
       'params' => array(
         'vid'         => $vid,
         'exclude_tid' => NULL,
         'root_term'   => NULL,
       ),      
-    ),
-    '#title'         => $title,
-    '#default_value' => $value,
-    '#options'       => $options,
-    '#description'   => $description,
-    '#weight'        => -15,
-  );
-
+    );
+    unset($form_item['#theme']);
   hierarchical_select_common_config_apply($form_item, "taxonomy-$vid");
 
   return $form_item;
@@ -231,76 +214,12 @@
 function hs_taxonomy_form_alter(&$form, &$form_state, $form_id) {
   // Change the term selection of nodes. Only affects hierarchical
   // vocabularies.
-  if (isset($form['type']) && isset($form['#node']) && (variable_get('taxonomy_override_selector', FALSE)) && $form['type']['#value'] .'_node_form' == $form_id)) {
-    $node = $form['#node'];
-
-    if (!isset($node->taxonomy)) {
-      $terms = empty($node->nid) ? array() : taxonomy_node_get_terms($node);
-    }
-    else {
-      // After preview the terms must be converted to objects.
-      if (isset($form_state['node_preview'])) {
-        $node->taxonomy = taxonomy_preview_terms($node);
+  if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'] .'_node_form' == $form_id && is_array($form['taxonomy'])) {
+    foreach($form['taxonomy'] as $vid =>$info) {
+      if (is_numeric($vid) && variable_get("taxonomy_hierarchical_select_$vid", 0) ) {
+          $form['taxonomy'][$vid] = hs_taxonomy_form($vid,$form['taxonomy'][$vid]);
       }
-      $terms = $node->taxonomy;
     }
-
-    $c = 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);
-
-    while ($vocabulary = db_fetch_object($c)) {
-      if ($vocabulary->tags) {
-        if (isset($form_state['node_preview'])) {
-          // Typed string can be changed by the user before preview,
-          // so we just insert the tags directly as provided in the form.
-          $typed_string = $node->taxonomy['tags'][$vocabulary->vid];
-        }
-        else {
-          $typed_string = taxonomy_implode_tags($terms, $vocabulary->vid) . (array_key_exists('tags', $terms) ? $terms['tags'][$vocabulary->vid] : NULL);
-        }
-        if ($vocabulary->help) {
-          $help = $vocabulary->help;
-        }
-        else {
-          $help = t('A comma-separated list of terms describing this content. Example: funny, bungee jumping, "Company, Inc.".');
-        }
-        $form['taxonomy']['tags'][$vocabulary->vid] = array('#type' => 'textfield',
-          '#title' => $vocabulary->name,
-          '#description' => $help,
-          '#required' => $vocabulary->required,
-          '#default_value' => $typed_string,
-          '#autocomplete_path' => 'taxonomy/autocomplete/'. $vocabulary->vid,
-          '#weight' => $vocabulary->weight,
-          '#maxlength' => 255,
-        );
-      }
-      else {
-        // Extract terms belonging to the vocabulary in question.
-        $default_terms = array();
-        foreach ($terms as $term) {
-          // Free tagging has no default terms and also no vid after preview.
-          if (isset($term->vid) && $term->vid == $vocabulary->vid) {
-            $default_terms[$term->tid] = $term;
-          }
-        }
-        $form_function = variable_get("taxonomy_hierarchical_select_$vocabulary->vid", 0) ? 'hs_taxonomy_form' : 'taxonomy_form';
-        $form['taxonomy'][$vocabulary->vid] = $form_function($vocabulary->vid, array_keys($default_terms), $vocabulary->help);
-        $form['taxonomy'][$vocabulary->vid]['#weight'] = $vocabulary->weight;
-        $form['taxonomy'][$vocabulary->vid]['#required'] = $vocabulary->required;
-      }
-    }
-    if (!empty($form['taxonomy']) && is_array($form['taxonomy'])) {
-      if (count($form['taxonomy']) > 1) {
-        // Add fieldset only if form has more than 1 element.
-        $form['taxonomy'] += array(
-          '#type' => 'fieldset',
-          '#title' => t('Vocabularies'),
-          '#collapsible' => TRUE,
-          '#collapsed' => FALSE,
-        );
-      }
-      $form['taxonomy']['#weight'] = -3;
-      $form['taxonomy']['#tree'] = TRUE;
-    }
   }
 }
 
Index: modules/hs_taxonomy.install
===================================================================
--- modules/hs_taxonomy.install	(revision 2829)
+++ modules/hs_taxonomy.install	(working copy)
@@ -25,7 +25,6 @@
  * Implementation of hook_enable().
  */
 function hs_taxonomy_enable() {
-  variable_set('taxonomy_override_selector', TRUE);
   drupal_set_message(t("Drupal core's taxonomy selects are now overridden on the
                         Taxonomy Term form. They've been replaced by
                         Hierarchical Selects for better scalability.<br />
@@ -41,7 +40,6 @@
  * Implementation of hook_disable().
  */
 function hs_taxonomy_disable() {
-  variable_set('taxonomy_override_selector', FALSE);
   drupal_set_message(t("Drupal core's taxonomy selects are now restored.
                         Please remember that they're not scalable!."),
                     'warning');
@@ -60,3 +58,9 @@
 
   return $ret;
 }
+
+
+function hs_taxonomy_update_2() {
+  variable_set('taxonomy_override_selector', FALSE);  
+  return array();
+}
\ No newline at end of file
