Index: vertical_tabs.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/vertical_tabs/vertical_tabs.info,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 vertical_tabs.info
--- vertical_tabs.info	16 Dec 2008 06:53:16 -0000	1.1.2.1
+++ vertical_tabs.info	19 May 2009 23:35:28 -0000
@@ -1,3 +1,3 @@
 name = Vertical Tabs
 description = Provides vertical tabs for the node form.
-core = 6.x
\ No newline at end of file
+dependencies = jstools
\ No newline at end of file
Index: vertical_tabs.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/vertical_tabs/vertical_tabs.install,v
retrieving revision 1.1.2.7
diff -u -p -r1.1.2.7 vertical_tabs.install
--- vertical_tabs.install	19 May 2009 05:36:24 -0000	1.1.2.7
+++ vertical_tabs.install	19 May 2009 23:35:28 -0000
@@ -14,7 +14,7 @@ function vertical_tabs_install() {
 /**
  * Reduce the module weight and remove the form settings variable.
  */
-function vertical_tabs_update_6100() {
+function vertical_tabs_update_5100() {
   $ret = array();
   $ret[] = update_sql("UPDATE {system} SET weight = 300 WHERE name = 'vertical_tabs'");
   variable_del('vertical_tabs_settings_form');
@@ -24,7 +24,7 @@ function vertical_tabs_update_6100() {
 /**
  * Color-enable the module if using Garland.
  */
-function vertical_tabs_update_6101() {
+function vertical_tabs_update_5101() {
   vertical_tabs_install_color_generate();
   return array();
 }
@@ -32,7 +32,7 @@ function vertical_tabs_update_6101() {
 /**
  * Regenerate the stylesheets if using Garland to accomidate for CSS changes.
  */
-function vertical_tabs_update_6102() {
+function vertical_tabs_update_5102() {
   vertical_tabs_install_color_generate();
   return array();
 }
Index: vertical_tabs.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/vertical_tabs/vertical_tabs.js,v
retrieving revision 1.3.2.12
diff -u -p -r1.3.2.12 vertical_tabs.js
--- vertical_tabs.js	19 May 2009 01:39:32 -0000	1.3.2.12
+++ vertical_tabs.js	19 May 2009 23:35:28 -0000
@@ -33,7 +33,8 @@ Drupal.behaviors.verticalTabs = function
       }
 
       // Remove the legend from the fieldset.
-      fieldset.children('legend').remove();
+      // @TODO - Fix commented out code.
+      //fieldset.children('legend').remove();
 
       // Add the fieldset contents to the toggled fieldsets.
       fieldset.appendTo(fieldsets)
@@ -47,7 +48,7 @@ Drupal.behaviors.verticalTabs = function
       $('.vertical-tabs-' + k).remove();
     });
 
-    $('div.vertical-tabs').html(ul).append(fieldsets);
+    $('div.vertical-tabs').html('').append(ul).append(fieldsets);
 
     // Activate the first tab.
     $('fieldset.vertical-tabs-pane').hide();
Index: vertical_tabs.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/vertical_tabs/vertical_tabs.module,v
retrieving revision 1.1.2.19
diff -u -p -r1.1.2.19 vertical_tabs.module
--- vertical_tabs.module	19 May 2009 01:39:32 -0000	1.1.2.19
+++ vertical_tabs.module	19 May 2009 23:35:30 -0000
@@ -6,23 +6,9 @@
  */
 
 /**
- * Implementation of hook_theme().
- */
-function vertical_tabs_theme() {
-  return array(
-    'vertical_tabs' => array(
-      'arguments' => array('form_element' => NULL),
-    ),
-    'vertical_tabs_js_css' => array(
-      'arguments' => array('js' => NULL, 'css' => NULL, 'settings' => NULL, 'form_id' => NULL),
-    ),
-  );
-}
-
-/**
  * Implementation of hook_form_alter.
  */
-function vertical_tabs_form_alter(&$form, $form_state, $form_id) {
+function vertical_tabs_form_alter($form_id, &$form) {
   // Check to see which form we are in. Since the node form's form id is not
   // just node_form, we can't implement a function for all node forms, so we are
   // stuck implementing the global form_alter and checking if there is the
@@ -70,16 +56,14 @@ function vertical_tabs_form_alter(&$form
 
       // Add Garland specific theming.
       if ($GLOBALS['theme'] == 'garland') {
-        $garland_stylesheets = variable_get('color_garland_stylesheets', array());
-        if (count($garland_stylesheets) == 0 || !module_exists('color')) {
+        $garland_stylesheet = variable_get('color_garland_stylesheet', NULL);
+        if ($garland_stylesheet == NULL || !module_exists('color')) {
           $css[] = drupal_get_path('module', 'vertical_tabs') .'/garland/vertical_tabs.garland.css';
         }
         else {
-          foreach ($garland_stylesheets as $path) {
-            if (strstr($path, 'vertical_tabs.garland.css')) {
-              $css[] = $path;
-            }
-          }
+          //if (strstr($path, 'vertical_tabs.garland.css')) {
+          //  $css[] = $path;
+          //}
         }
       }
 
@@ -114,16 +98,14 @@ function vertical_tabs_form_alter(&$form
   // TODO: We could handle other color-enabled themes other than Garland, but
   // at the same time, these themes could simply include the CSS from
   // vertical_tabs.garland.css in their style.css files.
-  if ($form_id == 'system_theme_settings' && $form['#parameters'][2] == 'garland' && function_exists('gd_info')) {
+  if ($form_id == 'system_theme_settings' && $form['#parameters'][1] == 'garland' && function_exists('gd_info')) {
     if (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC) {
-      $form['#submit'][] = 'vertical_tabs_color_submit';
+      //$form['#submit']['vertical_tabs_color_submit'] = array();
     }
   }
 }
 
 function vertical_tabs_node_type_form($node_type) {
-  module_load_include('inc', 'node', 'node.pages');
-
   // Build a psuedo-node for a sample node form.
   $node = (object) array(
     'type' => $node_type,
@@ -131,16 +113,13 @@ function vertical_tabs_node_type_form($n
   );
 
   // Build a sample node form to find fieldsets.
-  $node_form_state = array('values' => array());
   $node_form_id = $node_type .'_node_form';
   $args = array(
     $node_form_id,
-    $node_form_state,
     $node
   );
   $node_form = call_user_func_array('drupal_retrieve_form', $args);
-  $node_form['#post'] = $node_form_state['values'];
-  drupal_prepare_form($node_form_id, $node_form, $node_form_state);
+  drupal_prepare_form($node_form_id, $node_form);
   uasort($node_form, 'element_sort');
 
   // Find all fieldsets.
@@ -172,14 +151,14 @@ function vertical_tabs_node_type_form($n
 /**
  * Submit handler for the theme settings page.
  */
-function vertical_tabs_color_submit($form, &$form_state) {
-  $theme = $form_state['values']['theme'];
-  $info = $form_state['values']['info'];
+function vertical_tabs_color_submit($form_id, $form_values) {
+  $theme = $form_values['theme'];
+  $info = $form_values['info'];
 
   // Resolve palette
-  $palette = $form_state['values']['palette'];
-  if ($form_state['values']['scheme'] != '') {
-    $scheme = explode(',', $form_state['values']['scheme']);
+  $palette = $form_values['palette'];
+  if ($form_values['scheme'] != '') {
+    $scheme = explode(',', $form_values['scheme']);
     foreach ($palette as $k => $color) {
       $palette[$k] = array_shift($scheme);
     }
@@ -261,10 +240,10 @@ function theme_vertical_tabs_js_css($js,
   static $js_added = array();
   if (!isset($js_added[$form_id])) {
     drupal_add_js(array('verticalTabs' => $settings), 'setting');
-    drupal_add_js(drupal_get_path('module', 'vertical_tabs') .'/vertical_tabs.js');
+    jstools_add_js(drupal_get_path('module', 'vertical_tabs') .'/vertical_tabs.js');
     drupal_add_css(drupal_get_path('module', 'vertical_tabs') .'/vertical_tabs.css');
     foreach ($js as $path) {
-      drupal_add_js($path);
+      jstools_add_js($path);
     }
     foreach ($css as $path) {
       drupal_add_css($path);
Index: vertical_tabs.node_form.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/vertical_tabs/Attic/vertical_tabs.node_form.js,v
retrieving revision 1.1.2.5
diff -u -p -r1.1.2.5 vertical_tabs.node_form.js
--- vertical_tabs.node_form.js	6 Jan 2009 02:47:47 -0000	1.1.2.5
+++ vertical_tabs.node_form.js	19 May 2009 23:35:31 -0000
@@ -57,7 +57,7 @@ Drupal.verticalTabs.menu = function() {
 }
 
 Drupal.verticalTabs.comment_settings = function() {
-  return $('.vertical-tabs-comment_settings input[checked]').parent().text().replace(/^\s*(.*)\s*$/, '$1');
+  return $('.vertical-tabs-comment_settings input:checked').parent().text().replace(/^\s*(.*)\s*$/, '$1');
 }
 
 Drupal.verticalTabs.attachments = function() {
@@ -72,7 +72,7 @@ Drupal.verticalTabs.attachments = functi
 
 Drupal.verticalTabs.path = function() {
   var path = $('#edit-path').val();
-  var automatic = $('#edit-pathauto-perform-alias').attr('checked');
+  var automatic = $('#edit-pathauto-perform-alias').length == 1 ? $('#edit-pathauto-perform-alias').attr('checked') : 0;
 
   if (automatic) {
     return Drupal.t('Automatic alias');
@@ -136,4 +136,65 @@ Drupal.verticalTabs.taxonomy = function(
   else {
     return Drupal.t('No terms');
   }
-}
\ No newline at end of file
+}
+
+/**
+ * Backported from Drupal 6.x
+ */
+Drupal.checkPlain = function(str) {
+  str = String(str);
+  var replace = { '&': '&amp;', '"': '&quot;', '<': '&lt;', '>': '&gt;' };
+  for (var character in replace) {
+    var regex = new RegExp(character, 'g');
+    str = str.replace(regex, replace[character]);
+  }
+  return str;
+};
+
+Drupal.t = function(str, args) {
+  // Fetch the localized version of the string.
+  //if (Drupal.locale.strings && Drupal.locale.strings[str]) {
+  //  str = Drupal.locale.strings[str];
+  //}
+
+  if (args) {
+    // Transform arguments before inserting them
+    for (var key in args) {
+      switch (key.charAt(0)) {
+        // Escaped only
+        case '@':
+          args[key] = Drupal.checkPlain(args[key]);
+        break;
+        // Pass-through
+        case '!':
+          break;
+        // Escaped and placeholder
+        case '%':
+        default:
+          args[key] = Drupal.theme('placeholder', args[key]);
+          break;
+      }
+      str = str.replace(key, args[key]);
+    }
+  }
+  return str;
+};
+
+Drupal.formatPlural = function(count, singular, plural, args) {
+  var args = args || {};
+  args['@count'] = count;
+  // Determine the index of the plural form.
+  var index = /*Drupal.locale.pluralFormula ? Drupal.locale.pluralFormula(args['@count']) : */((args['@count'] == 1) ? 0 : 1);
+
+  if (index == 0) {
+    return Drupal.t(singular, args);
+  }
+  else if (index == 1) {
+    return Drupal.t(plural, args);
+  }
+  else {
+    args['@count['+ index +']'] = args['@count'];
+    delete args['@count'];
+    return Drupal.t(plural.replace('@count', '@count['+ index +']'));
+  }
+};
\ No newline at end of file
