Index: views.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/views.info,v
retrieving revision 1.7
diff -u -p -r1.7 views.info
--- views.info	12 Aug 2007 06:52:14 -0000	1.7
+++ views.info	20 Sep 2008 00:45:51 -0000
@@ -1,5 +1,6 @@
 ; $Id: views.info,v 1.7 2007/08/12 06:52:14 merlinofchaos Exp $
 name = Views
 description = Create customized lists and queries from your database.
+dependencies[] = admin_ui
 package = Views
 core = 6.x
Index: views_ui.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/views_ui.module,v
retrieving revision 1.104
diff -u -p -r1.104 views_ui.module
--- views_ui.module	4 Sep 2008 07:10:06 -0000	1.104
+++ views_ui.module	19 Sep 2008 23:08:19 -0000
@@ -197,16 +197,6 @@ function views_ui_theme() {
       'arguments' => array('form' => NULL),
     ),
 
-    // tab themes
-    'views_tabset' => array(
-      'arguments' => array('tabs' => NULL),
-      'file' => '/includes/tabs.inc',
-    ),
-    'views_tab' => array(
-      'arguments' => array('body' => NULL),
-      'file' => '/includes/tabs.inc',
-    ),
-
     // On behalf of a plugin
     'views_ui_style_plugin_table' => array(
       'arguments' => array('form' => NULL),
Index: admin_ui/admin_ui.info
===================================================================
RCS file: admin_ui/admin_ui.info
diff -N admin_ui/admin_ui.info
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ admin_ui/admin_ui.info	20 Sep 2008 00:48:12 -0000
@@ -0,0 +1,5 @@
+; $Id$
+name = Advanced administration UI
+description = Provides helper functions for advanced administration interfaces.
+package = Administration
+core = 6.x
Index: admin_ui/admin_ui.module
===================================================================
RCS file: admin_ui/admin_ui.module
diff -N admin_ui/admin_ui.module
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ admin_ui/admin_ui.module	20 Sep 2008 00:48:02 -0000
@@ -0,0 +1,58 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Provides helper functions for advanced administration interfaces.
+ */
+
+/**
+ * Implementation of hook_theme().
+ */
+function admin_ui_theme() {
+  return array(
+    'admin_ui_tabset' => array(
+      'arguments' => array('tabs' => NULL),
+      'file' => '/includes/tabs.inc',
+    ),
+    'admin_ui_tab' => array(
+      'arguments' => array('body' => NULL),
+      'file' => '/includes/tabs.inc',
+    ),
+  );
+}
+
+/**
+ * Include admin_ui .inc files as necessary.
+ */
+function admin_ui_include($file) {
+  static $used = array();
+  if (!isset($used[$file])) {
+    require_once './' . drupal_get_path('module', 'admin_ui') . "/includes/$file.inc";
+  }
+  $used[$file] = TRUE;
+}
+
+/**
+ * Include admin_ui .css files.
+ */
+function admin_ui_add_css($file) {
+  drupal_add_css(drupal_get_path('module', 'admin_ui') . "/css/$file.css");
+}
+
+/**
+ * Include admin_ui .js files.
+ */
+function admin_ui_add_js($file) {
+  // If JavaScript has been disabled by the user, never add JS files.
+  if (variable_get('admin_ui_no_javascript', FALSE)) {
+    return;
+  }
+  static $base = FALSE;
+  if (!$base) {
+    drupal_add_js(drupal_get_path('module', 'admin_ui') . "/js/base.js");
+    $base = TRUE;
+  }
+  drupal_add_js(drupal_get_path('module', 'admin_ui') . "/js/$file.js");
+}
+
Index: admin_ui/css/admin-tabs.css
===================================================================
RCS file: admin_ui/css/admin-tabs.css
diff -N admin_ui/css/admin-tabs.css
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ admin_ui/css/admin-tabs.css	27 May 2008 23:49:36 -0000
@@ -0,0 +1,5 @@
+/* $Id */
+
+.ui-tabs-hide { 
+  display: none; 
+}
Index: admin_ui/includes/tabs.inc
===================================================================
RCS file: admin_ui/includes/tabs.inc
diff -N admin_ui/includes/tabs.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ admin_ui/includes/tabs.inc	20 Sep 2008 00:22:55 -0000
@@ -0,0 +1,193 @@
+<?php
+// $Id: tabs.inc,v 1.7 2008/05/27 23:49:37 merlinofchaos Exp $
+
+/**
+ * @file
+ * Classes and theme functions for rendering javascript UI tabs.
+ */
+
+/**
+ * Contain a set of tabs as well as the ability to render them.
+ *
+ * There are three 'areas' of a tabset.
+ * - title: The clickable link to display the tab area. These are always visible.
+ * - body: The actual HTML body of the tab. Only one body is visible at a time.
+ * - extra: An optional decorative area around the tabs.
+ */
+class admin_tabset {
+  var $tabs = array();
+  var $extra = '';
+  var $selected = NULL;
+
+  /**
+   * Add a tab to the tabset.
+   *
+   * @param $name
+   *   The name of the tab; this is the internal identifier and must be
+   *   unique within the tabset.
+   * @param $title
+   *   If given, this will be the visible title of the tab. This can also
+   *   be set via $tabset->set(). This will be the link to click on to
+   *   view the tab.
+   * @param $body
+   *   If given, this is the body of the tab itself. It will display
+   *   when the tab title is clicked on.
+   */
+  function add($name, $title = '', $body = '') {
+    if (is_object($name) && is_subclass_of($name, 'admin_tab')) {
+      $this->add_tab($name);
+    }
+    elseif (is_array($name)) {
+      foreach ($name as $real_tab) {
+        $this->add($real_tab);
+      }
+    }
+    else {
+      $this->add_tab(new admin_tab($name, $title, $body));
+    }
+  }
+
+  /**
+   * Add a fully realized tab object to the tabset.
+   *
+   * @param $tab
+   *   A fully populated views_tab object.
+   */
+  function add_tab($tab) {
+    $this->tabs[$tab->name] = $tab;
+  }
+
+  /**
+   * Set the values of a tab.
+   *
+   * @param $name
+   *   The unique identifier of the tab to set.
+   * @param $title
+   *   The title of the tab; this will be clickable.
+   * @param $body
+   *   The HTML body of the tab.
+   */
+  function set($name, $title, $body = NULL) {
+    if (empty($this->tabs[$name])) {
+      return $this->add($name, $title, $body);
+    }
+    $this->tabs[$name]->title = $title;
+    if (isset($body)) {
+      $this->tabs[$name]->body = $body;
+    }
+  }
+
+  /**
+   * Set the body of a tab.
+   */
+  function set_body($name, $body) {
+    if (empty($this->tabs[$name])) {
+      return $this->add($name, '', $body);
+    }
+    $this->tabs[$name]->body = $body;
+  }
+
+  /**
+   * Add text to the 'extra' region of the tabset.
+   */
+  function add_extra($text) {
+    $this->extra .= $text;
+  }
+
+  /**
+   * Remove a tab.
+   *
+   * @param $tab
+   *   May be the name of the tab or a views_tab object.
+   */
+  function remove($tab) {
+    if (is_string($tab)) {
+      unset($this->tabs[$tab]);
+    }
+    else {
+      unset($this->tabs[$tab->name]);
+    }
+  }
+
+  /**
+   * Control which tab will be selected when it is rendered.
+   */
+  function set_selected($name) {
+    $this->selected = $name;
+  }
+
+  /**
+   * Output the HTML for the tabs.
+   *
+   * @return
+   *   HTML representation of the tabs.
+   */
+  function render() {
+    admin_ui_add_js('tabs');
+    admin_ui_add_css('admin-tabs');
+
+    if (empty($this->selected)) {
+      $keys = array_keys($this->tabs);
+      $this->selected = array_shift($keys);
+    }
+
+    drupal_alter('admin_tabset', $this);
+    return theme('admin_ui_tabset', $this->tabs, $this->extra, $this->selected);
+  }
+}
+
+/**
+ * An object to represent an individual tab within a tabset.
+ */
+class admin_tab {
+  var $title;
+  var $body;
+  var $name;
+
+  /**
+   * Construct a new tab.
+   */
+  function admin_tab($name, $title, $body = NULL) {
+    $this->name = $name;
+    $this->title = $title;
+    $this->body = $body;
+  }
+
+  /**
+   * Generate HTML output for a tab.
+   */
+  function render() {
+    return theme('admin_ui_tab', $this->body);
+  }
+}
+
+/**
+ * Render a tabset.
+ *
+ * @todo Turn this into a template.
+ */
+function theme_admin_ui_tabset($tabs, $extra = NULL, $selected = NULL) {
+  $link_output = "<div class=\"views-tabs\"><ul id=\"views-tabset\">\n";
+  $tab_output = "<div class=\"views-tab-area\">\n";
+
+  foreach ($tabs as $name => $tab) {
+    $link_output .= '<li' . ($name == $selected ? ' class="active"': '') . '><a href="#views-tab-' . $tab->name . '" id="views-tab-title-' . $tab->name . '">' . check_plain($tab->title) . '</a></li>' . "\n";
+    $tab_output .= '<div id="views-tab-' . $tab->name . '" class="views-tab">' . $tab->render() . "</div>\n";
+  }
+  $link_output .= "</ul>\n";
+
+  if ($extra) {
+    $link_output .= "<div class=\"extra\">$extra</div>\n";
+  }
+
+  $link_output .= "</div>\n";
+  $tab_output .= "</div>\n";
+  return '<div class="views-tabset clear-block">' . $link_output . $tab_output . '</div>';
+}
+
+/**
+ * Theme a simple tab.
+ */
+function theme_admin_ui_tab($body) {
+  return $body;
+}
Index: admin_ui/js/base.js
===================================================================
RCS file: admin_ui/js/base.js
diff -N admin_ui/js/base.js
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ admin_ui/js/base.js	15 Jun 2008 22:58:23 -0000
@@ -0,0 +1,77 @@
+// $Id: base.js,v 1.8 2008/05/29 19:44:50 merlinofchaos Exp $
+/**
+ * @file base.js
+ *
+ * Some basic behaviors and utility functions for Views.
+ */
+
+Drupal.Views = {};
+
+/**
+ * jQuery UI tabs, Views integration component
+ */
+Drupal.behaviors.viewsTabs = function (context) {
+  if ($.ui && $.ui.tabs) {
+    $('#views-tabset:not(.views-processed)').addClass('views-processed').tabs({
+      selectedClass: 'active'
+    });
+  }
+
+  $('a.views-remove-link')
+    .addClass('views-processed')
+    .click(function() {
+      var id = $(this).attr('id').replace('views-remove-link-', '');
+      $('#views-row-' + id).hide();
+      $('#views-removed-' + id).attr('checked', true);
+      return false;
+    });
+}
+
+/**
+ * For IE, attach some javascript so that our hovers do what they're supposed
+ * to do.
+ */
+Drupal.behaviors.viewsHoverlinks = function() {
+  if ($.browser.msie) {
+    // If IE, attach a hover event so we can see our admin links.
+    $("div.view:not(.views-hover-processed)").addClass('views-hover-processed').hover(
+      function() {
+        $('div.views-hide', this).addClass("views-hide-hover"); return true;
+      },
+      function(){
+        $('div.views-hide', this).removeClass("views-hide-hover"); return true;
+      }
+    );
+    $("div.views-admin-links:not(.views-hover-processed)")
+      .addClass('views-hover-processed')
+      .hover(
+        function() {
+          $(this).addClass("views-admin-links-hover"); return true;
+        },
+        function(){
+          $(this).removeClass("views-admin-links-hover"); return true;
+        }
+      );
+  }
+}
+
+/**
+ * Helper function to parse a querystring.
+ */
+Drupal.Views.parseQueryString = function (query) {
+  var args = {};
+  var pos = query.indexOf('?');
+  if (pos != -1) {
+    query = query.substring(pos + 1);
+  }
+  var pairs = query.split('&');
+  for(var i in pairs) {
+    var pair = pairs[i].split('=');
+    // Ignore the 'q' path argument, if present.
+    if (pair[0] != 'q' && pair[1]) {
+      args[pair[0]] = unescape(pair[1].replace(/\+/g, ' '));
+    }
+  }
+  return args;
+};
+
Index: admin_ui/js/tabs.js
===================================================================
RCS file: admin_ui/js/tabs.js
diff -N admin_ui/js/tabs.js
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ admin_ui/js/tabs.js	15 Jun 2008 22:58:23 -0000
@@ -0,0 +1,438 @@
+// $Id: tabs.js,v 1.3 2008/03/30 15:58:26 merlinofchaos Exp $
+
+/**
+ * @file tabs.js
+ * jQuery UI Tabs (Tabs 3)
+ * 
+ * This is nothing more than the pure jquery UI tabs implementation.
+ */
+(function($) {
+ 
+   // if the UI scope is not availalable, add it
+  $.ui = $.ui || {};
+  
+  $.fn.tabs = function(initial, options) {
+    if (initial && initial.constructor == Object) { // shift arguments
+      options = initial;
+      initial = null;
+    }
+    options = options || {};
+    
+    // first get initial tab from options
+    initial = initial && initial.constructor == Number && --initial || 0;
+    
+    return this.each(function() {
+    new $.ui.tabs(this, $.extend(options, { initial: initial }));
+    });
+  };
+  
+  // chainable tabs methods
+  $.each(['add', 'remove', 'enable', 'disable', 'click', 'load'], function(i, method) {
+    $.fn[method + 'Tab'] = function() {
+      var args = arguments;
+      return this.each(function() {
+        var instance = $.ui.tabs.instances[this.UI_TABS_UUID];
+        instance[method].apply(instance, args);
+      });
+    };
+  });
+  $.fn.selectedTab = function(returnElement) {
+    var selected;
+    if (returnElement) {
+      
+    } else {
+      
+    }
+    return selected;
+  };
+
+  $.ui.tabs = function(el, options) {
+    
+    this.source = el;
+    
+    this.options = $.extend({
+      
+      // basic setup
+      initial: 0,
+      event: 'click',
+      disabled: [],
+      // TODO bookmarkable: $.ajaxHistory ? true : false,
+      unselected: false,
+      toggle: options.unselected ? true : false,
+      
+      // Ajax
+      spinner: 'Loading&#8230;',
+      cache: false,
+      hashPrefix: 'tab-',
+      
+      // animations
+      /*fxFade: null,
+      fxSlide: null,
+      fxShow: null,
+      fxHide: null,*/
+      fxSpeed: 'normal',
+      /*fxShowSpeed: null,
+      fxHideSpeed: null,*/
+      
+      // callbacks
+      add: function() {},
+      remove: function() {},
+      enable: function() {},
+      disable: function() {},
+      click: function() {},
+      hide: function() {},
+      show: function() {},
+      load: function() {},
+      
+      // CSS classes
+      navClass: 'ui-tabs-nav',
+      selectedClass: 'ui-tabs-selected',
+      disabledClass: 'ui-tabs-disabled',
+      containerClass: 'ui-tabs-container',
+      hideClass: 'ui-tabs-hide',
+      loadingClass: 'ui-tabs-loading'
+      
+    }, options);
+    
+    this.tabify(true);
+    
+    // save instance for later
+    var uuid = 'instance-' + $.ui.tabs.prototype.count++;
+    $.ui.tabs.instances[uuid] = this;
+    this.source['UI_TABS_UUID'] = uuid;
+    
+  };
+  
+  // static
+  $.ui.tabs.instances = {};
+  
+  $.extend($.ui.tabs.prototype, {
+    animating: false,
+    count: 0,
+    tabify: function(init) {
+        
+      this.$tabs = $('a:first-child', this.source);
+      this.$containers = $([]);
+      
+      var self = this, o = this.options;
+      
+      this.$tabs.each(function(i, a) {
+        // inline tab
+        if (a.hash && a.hash.replace('#', '')) { // safari 2 reports '#' for an empty hash
+          self.$containers = self.$containers.add(a.hash);
+        }
+        // remote tab
+        else {
+          var id = a.title && a.title.replace(/\s/g, '_') || o.hashPrefix + (self.count + 1) + '-' + (i + 1), url = a.href;
+          a.href = '#' + id;
+          a.url = url;
+          self.$containers = self.$containers.add(
+            $('#' + id)[0] || $('<div id="' + id + '" class="' + o.containerClass + '"></div>')
+              .insertAfter( self.$containers[i - 1] || self.source )
+          );
+        }
+      });
+      
+      if (init) {
+        
+        // Try to retrieve initial tab from fragment identifier in url if present,
+        // otherwise try to find selected class attribute on <li>.
+        this.$tabs.each(function(i, a) {
+          if (location.hash) {
+            if (a.hash == location.hash) {
+              o.initial = i;
+              // prevent page scroll to fragment
+              //if (($.browser.msie || $.browser.opera) && !o.remote) {
+              if ($.browser.msie || $.browser.opera) {
+                var $toShow = $(location.hash), toShowId = $toShow.attr('id');
+                $toShow.attr('id', '');
+                setTimeout(function() {
+                  $toShow.attr('id', toShowId); // restore id
+                }, 500);
+              }
+              scrollTo(0, 0);
+              return false; // break
+            }
+          } else if ( $(a).parents('li:eq(0)').is('li.' + o.selectedClass) ) {
+            o.initial = i;
+            return false; // break
+          }
+        });
+      
+        // attach necessary classes for styling if not present
+        $(this.source).is('.' + o.navClass) || $(this.source).addClass(o.navClass);
+        this.$containers.each(function() {
+          var $this = $(this);
+          $this.is('.' + o.containerClass) || $this.addClass(o.containerClass);
+        });
+      
+        // highlight tab accordingly
+        var $lis = $('li', this.source);
+        this.$containers.addClass(o.hideClass);
+        $lis.removeClass(o.selectedClass);
+        if (!o.unselected) {
+          this.$containers.slice(o.initial, o.initial + 1).show();
+          $lis.slice(o.initial, o.initial + 1).addClass(o.selectedClass);
+        }
+      
+        // trigger load of initial tab is remote tab
+        if (this.$tabs[o.initial].url) {
+          this.load(o.initial + 1, this.$tabs[o.initial].url);
+          if (o.cache) {
+            this.$tabs[o.initial].url = null; // if loaded once do not load them again
+          }
+        }
+      
+        // disabled tabs
+        for (var i = 0, position; position = o.disabled[i]; i++) {
+          this.disable(position);
+        }
+      
+      }
+      
+      // setup animations
+      var showAnim = {}, hideAnim = {}, showSpeed = o.fxShowSpeed || o.fxSpeed, 
+        hideSpeed = o.fxHideSpeed || o.fxSpeed;
+      if (o.fxSlide || o.fxFade) {
+        if (o.fxSlide) {
+          showAnim['height'] = 'show';
+          hideAnim['height'] = 'hide';
+        }
+        if (o.fxFade) {
+          showAnim['opacity'] = 'show';
+          hideAnim['opacity'] = 'hide';
+        }
+      } else {
+        if (o.fxShow) {
+          showAnim = o.fxShow;
+        } else { // use some kind of animation to prevent browser scrolling to the tab
+          showAnim['min-width'] = 0; // avoid opacity, causes flicker in Firefox
+          showSpeed = 1; // as little as 1 is sufficient
+        }
+        if (o.fxHide) {
+          hideAnim = o.fxHide;
+        } else { // use some kind of animation to prevent browser scrolling to the tab
+          hideAnim['min-width'] = 0; // avoid opacity, causes flicker in Firefox
+          hideSpeed = 1; // as little as 1 is sufficient
+        }
+      }
+      
+      // callbacks
+      var click = o.click, hide = o.hide, show = o.show;
+      
+      // reset some styles to maintain print style sheets etc.
+      var resetCSS = { display: '', overflow: '', height: '' };
+      if (!$.browser.msie) { // not in IE to prevent ClearType font issue
+        resetCSS['opacity'] = '';
+      }
+
+      // hide a tab, animation prevents browser scrolling to fragment
+      function hideTab(clicked, $hide, $show) {
+        $hide.animate(hideAnim, hideSpeed, function() { //
+          $hide.addClass(o.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc.            
+          hide(clicked, $show, $hide[0]);
+          if ($show) {
+            showTab(clicked, $hide, $show);
+          }
+        });
+      }
+      
+      // show a tab, animation prevents browser scrolling to fragment
+      function showTab(clicked, $hide, $show) {
+        // show next tab
+        if (!(o.fxSlide || o.fxFade || o.fxShow)) {
+          $show.css('display', 'block'); // prevent occasionally occuring flicker in Firefox cause by gap between showing and hiding the tab containers
+        }
+        $show.animate(showAnim, showSpeed, function() {
+          $show.removeClass(o.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc.
+          if ($.browser.msie) {
+            $hide[0].style.filter = '';
+            $show[0].style.filter = '';
+          }
+          show(clicked, $show[0], $hide[0]);
+          self.animating = false;
+        });
+        
+      }
+      
+      // switch a tab
+      function switchTab(clicked, $hide, $show) {
+        /*if (o.bookmarkable && trueClick) { // add to history only if true click occured, not a triggered click
+          $.ajaxHistory.update(clicked.hash);
+        }*/
+        $(clicked).parents('li:eq(0)').addClass(o.selectedClass)
+          .siblings().removeClass(o.selectedClass);
+        hideTab(clicked, $hide, $show);
+      }
+      
+      // tab click handler
+      function tabClick(e) {
+
+        //var trueClick = e.clientX; // add to history only if true click occured, not a triggered click
+        var $li = $(this).parents('li:eq(0)'), $hide = self.$containers.filter(':visible'), $show = $(this.hash);
+        
+        // if tab may be closed
+        if (o.toggle && !$li.is('.' + o.disabledClass) && !self.animating) {       
+          if ($li.is('.' + o.selectedClass)) {
+            $li.removeClass(o.selectedClass);
+            hideTab(this, $hide);
+            this.blur();
+            return false;
+          } else if (!$hide.length) {
+            $li.addClass(o.selectedClass);
+            showTab(this, $hide, $show);
+            this.blur();
+            return false;
+          }
+        }
+        
+        // If tab is already selected or disabled, animation is still running or click callback 
+        // returns false stop here.
+        // Check if click handler returns false last so that it is not executed for a disabled tab!
+        if ($li.is('.' + o.selectedClass + ', .' + o.disabledClass) 
+          || self.animating || click(this, $show[0], $hide[0]) === false) {
+          this.blur();
+          return false;
+        }
+
+        self.animating = true;
+
+        // show new tab
+        if ($show.length) {
+
+          // prevent scrollbar scrolling to 0 and than back in IE7, happens only if bookmarking/history is enabled
+          /*if ($.browser.msie && o.bookmarkable) {
+            var showId = this.hash.replace('#', '');
+            $show.attr('id', '');
+            setTimeout(function() {
+              $show.attr('id', showId); // restore id
+            }, 0);
+          }*/
+          
+          if (this.url) { // remote tab
+            var a = this;
+            self.load(self.$tabs.index(this) + 1, this.url, function() {
+              switchTab(a, $hide, $show);
+            });
+            if (o.cache) {
+              this.url = null; // if loaded once do not load them again
+            }
+          } else {
+            switchTab(this, $hide, $show);
+          }
+
+          // Set scrollbar to saved position - need to use timeout with 0 to prevent browser scroll to target of hash
+          /*var scrollX = window.pageXOffset || document.documentElement && document.documentElement.scrollLeft || document.body.scrollLeft || 0;
+          var scrollY = window.pageYOffset || document.documentElement && document.documentElement.scrollTop || document.body.scrollTop || 0;
+          setTimeout(function() {
+            scrollTo(scrollX, scrollY);
+          }, 0);*/
+
+        } else {
+          throw Drupal.t('jQuery UI Tabs: Mismatching fragment identifier.');
+        }
+
+        this.blur(); // prevent IE from keeping other link focussed when using the back button
+
+        //return o.bookmarkable && !!trueClick; // convert trueClick == undefined to Boolean required in IE
+        return false;
+        
+      }
+      
+      // attach click event, avoid duplicates from former tabifying
+      this.$tabs.unbind(o.event, tabClick).bind(o.event, tabClick);
+      
+    },
+    add: function(url, text, position) {
+      if (url && text) {
+        var o = this.options;
+        position = position || this.$tabs.length; // append by default
+        if (position >= this.$tabs.length) {
+          var method = 'insertAfter';
+          position = this.$tabs.length;
+        } else {
+          var method = 'insertBefore';
+        }
+        if (url.indexOf('#') == 0) { // ajax container is created by tabify automatically
+          var $container = $(url);
+          // try to find an existing element before creating a new one
+          ($container.length && $container || $('<div id="' + url.replace('#', '') + '" class="' + o.containerClass + ' ' + o.hideClass + '"></div>'))
+            [method](this.$containers[position - 1]);
+        }
+        $('<li><a href="' + url + '"><span>' + text + '</span></a></li>')
+          [method](this.$tabs.slice(position - 1, position).parents('li:eq(0)'));
+        this.tabify();
+        o.add(this.$tabs[position - 1], this.$containers[position - 1]); // callback
+      } else {
+        throw Drupal.t('jQuery UI Tabs: Not enough arguments to add tab.');
+      }       
+    },
+    remove: function(position) {
+      if (position && position.constructor == Number) {
+        this.$tabs.slice(position - 1, position).parents('li:eq(0)').remove();
+        this.$containers.slice(position - 1, position).remove();
+        this.tabify();
+      }
+      this.options.remove(); // callback
+    },
+    enable: function(position) {
+      var $li = this.$tabs.slice(position - 1, position).parents('li:eq(0)'), o = this.options;
+      $li.removeClass(o.disabledClass);
+      if ($.browser.safari) { // fix disappearing tab after enabling in Safari... TODO check Safari 3
+        $li.animate({ opacity: 1 }, 1, function() {
+          $li.css({ opacity: '' });
+        });
+      }
+      o.enable(this.$tabs[position - 1], this.$containers[position - 1]); // callback
+    },
+    disable: function(position) {
+      var $li = this.$tabs.slice(position - 1, position).parents('li:eq(0)'), o = this.options;      
+      if ($.browser.safari) { // fix opacity of tab after disabling in Safari... TODO check Safari 3
+        $li.animate({ opacity: 0 }, 1, function() {
+           $li.css({ opacity: '' });
+        });
+      }
+      $li.addClass(this.options.disabledClass);
+      o.disable(this.$tabs[position - 1], this.$containers[position - 1]); // callback
+    },
+    click: function(position) {
+      this.$tabs.slice(position - 1, position).trigger('click');
+    },
+    load: function(position, url, callback) {
+      var self = this,
+        o = this.options,
+        $a = this.$tabs.slice(position - 1, position).addClass(o.loadingClass),
+        $span = $('span', $a),
+        text = $span.html();
+      
+      // shift arguments
+      if (url && url.constructor == Function) {
+        callback = url;
+      }
+      
+      // set new URL
+      if (url) {
+        $a[0].url = url;
+      }
+      
+      // load
+      if (o.spinner) {
+        $span.html('<em>' + o.spinner + '</em>');
+      }
+      setTimeout(function() { // timeout is again required in IE, "wait" for id being restored
+        $($a[0].hash).load(url, function() {
+          if (o.spinner) {
+            $span.html(text);
+          }
+          $a.removeClass(o.loadingClass);
+          // This callback is needed because the switch has to take place after loading
+          // has completed.
+          if (callback && callback.constructor == Function) {
+            callback();
+          }
+          o.load(self.$tabs[position - 1], self.$containers[position - 1]); // callback
+        });
+      }, 0);      
+    }
+  });
+})(jQuery);
Index: includes/admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/includes/admin.inc,v
retrieving revision 1.133
diff -u -p -r1.133 admin.inc
--- includes/admin.inc	10 Sep 2008 21:29:15 -0000	1.133
+++ includes/admin.inc	19 Sep 2008 23:57:29 -0000
@@ -919,8 +919,8 @@ function template_preprocess_views_ui_ed
   $vars['base_table'] = !empty($table['table']['base']['title']) ?
     $table['table']['base']['title'] : t('Unknown or missing table name');
 
-  views_include('tabs');
-  $tabs = new views_tabset;
+  admin_ui_include('tabs');
+  $tabs = new admin_tabset;
 
   $vars['message'] = '<div class="message">' . t("Click on an item to edit that item's details.") . '</div>';
 
