--- tabs.module	Thu Jun 19 18:58:32 2008
+++ tabs.module	Mon Oct 20 16:39:04 2008
@@ -9,28 +9,24 @@
 /**
  * Implementation of hook_menu().
  */
-function tabs_menu() {
+function tabs_menu($may_cache) {
   $items = array();
-
-  $items['admin/settings/tabs'] = array(
-    'title' => 'Tabs',
-    'description' => 'Configuration for tabs',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('tabs_admin_settings'),
-    'access arguments' => array('administer site configuration'),
-  );
-
+  if ($may_cache) {
+    $items[] = array(
+      'path' => 'admin/settings/tabs',
+      'title' => t('Tabs'),
+      'description' => t('Configuration for tabs'),
+      'callback' => 'drupal_get_form',
+      'callback arguments' => array('tabs_admin_settings')
+    );
+  }
+  else {
+    tabs_load();
+  }
   return $items;
 }
 
 /**
- * Implementation of hook_init().
- */
-function tabs_init() {
-  tabs_load();
-}
-
-/**
  * Implementation of hook_theme()
  */
 function tabs_theme() {
@@ -125,7 +121,7 @@
       $element[$key]['#weight'] = $count/1000;
     }
   }
-  uasort($element, 'element_sort');
+  uasort($element, '_element_sort');
   foreach (element_children($element) as $key) {
     if (isset($element[$key]['#type']) && $element[$key]['#type'] == 'tabpage') {
       // Display any #description before the #content.
@@ -189,17 +185,15 @@
  * Render a tabset 'manually' (when not rendering as part of a regular form render).
  */
 function tabs_render($form) {
-  $form_state = array();
-  return drupal_render(form_builder('tabset', $form, $form_state));
+  return drupal_render(form_builder('tabset', $form));
 }
 
 /**
- * Implementation of hook_elements().
+ * Implementation of hook_elements(). 
  */
 function tabs_elements() {
   $type = array();
-  // #input is needed to trigger the #process callback.
-  $type['tabset'] = array('#input' => TRUE, '#tabs_navigation' => variable_get('tabs_navigation', 0) ? TRUE : FALSE, '#process' => array('tabs_process_tabset'));
+  $type['tabset'] = array('#tabs_navigation' => variable_get('tabs_navigation', 0) ? TRUE : FALSE, '#process' => array('tabs_process_tabset' => array()));
   $type['tabpage'] = array('#content' => '');
   return $type;
 }
