Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.925
diff -u -p -r1.925 common.inc
--- includes/common.inc	18 Jun 2009 21:19:01 -0000	1.925
+++ includes/common.inc	29 Jun 2009 00:54:31 -0000
@@ -2779,15 +2779,6 @@ function drupal_add_js($data = NULL, $op
           'scope' => 'header',
           'weight' => JS_LIBRARY,
         ),
-        'misc/jquery.js' => array(
-          'data' => 'misc/jquery.js',
-          'type' => 'file',
-          'scope' => 'header',
-          'weight' => JS_LIBRARY - 2,
-          'cache' => TRUE,
-          'defer' => FALSE,
-          'preprocess' => TRUE,
-        ),
         'misc/drupal.js' => array(
           'data' => 'misc/drupal.js',
           'type' => 'file',
@@ -2798,6 +2789,8 @@ function drupal_add_js($data = NULL, $op
           'preprocess' => TRUE,
         ),
       );
+      // jQuery itself is registered as a library.
+      drupal_add_library('system', 'jquery');
     }
 
     switch ($options['type']) {
@@ -2954,6 +2947,162 @@ function drupal_get_js($scope = 'header'
 }
 
 /**
+ * Adds multiple JavaScript or CSS files at the same time.
+ *
+ * A library defines a set of JavaScript and/or CSS files, optionally using
+ * settings, and optionally requiring another library.  For example, a library
+ * can be a jQuery plugin, a JavaScript framework, or a CSS framework. This
+ * function allows modules to load a library defined/shipped by itself or a
+ * depending module; without having to add all files of the library separately.
+ *
+ * @see drupal_get_library()
+ *
+ * Each library is only loaded once. However, drupal_add_library() may be
+ * invoked multiple times to pass further settings to any defined
+ * 'add callbacks' of a library.
+ *
+ * @param $module
+ *   The name of the module that registered the library.
+ * @param $name
+ *   The name of the library to add.
+ * @param ...
+ *   Additional arguments to pass to 'add callbacks' that have been registered
+ *   for the library.
+ * @return
+ *   An array containing the results from calling all the add handlers. The key
+ *   of the array is the add handler name, while the value is what was returned
+ *   from the call. Or FALSE if the library or one of its dependencies could not
+ *   be added.
+ *
+ * @see hook_library()
+ * @see hook_library_alter()
+ */
+function drupal_add_library($module, $name) {
+  $added = &drupal_static(__FUNCTION__, array());
+
+  $library = drupal_get_library($module, $name);
+  if (!$library) {
+    watchdog('system', 'Missing JavaScript/CSS library %library (%module module).', array('%library' => $name, '%module' => $module), WATCHDOG_WARNING);
+    return FALSE;
+  }
+
+  if (!isset($added[$module][$name])) {
+    // drupal_get_library() statically caches libraries already, so we simply
+    // store a marker here.
+    $added[$module][$name] = TRUE;
+
+    // Add dependent libraries (first), JavaScript, and stylesheets.
+    foreach (array('dependencies', 'js', 'css') as $type) {
+      if (isset($library[$type]) && is_array($library[$type])) {
+        foreach ($library[$type] as $data => $options) {
+          if (!is_array($options)) {
+            continue;
+          }
+          // Dependencies recursively invoke drupal_add_library(). $options form
+          // the arguments for drupal_add_library().
+          if ($type == 'dependencies') {
+            if (isset($options[0], $options[1])) {
+              // Directly invoke drupal_add_library(), because any additional
+              // arguments are only valid for 'add callbacks' of this library.
+              if (drupal_add_library($options[0], $options[1]) === FALSE) {
+                // If any dependent library could not be added, this library
+                // will break; stop here.
+                return FALSE;
+              }
+            }
+          }
+          else {
+            // For JS settings, $data must be an array. Arrays cannot be keys in
+            // PHP, so we transform $options['data'] into $data.
+            if (isset($options['type'], $options['data']) && $options['type'] == 'setting') {
+              $data = $options['data'];
+              unset($options['data']);
+            }
+            // All JavaScript contained within the libraries are given a default
+            // weight of JS_LIBRARY.
+            elseif (!isset($options['weight'])) {
+              $options['weight'] = JS_LIBRARY;
+            }
+            call_user_func('drupal_add_' . $type, $data, $options);
+          }
+        }
+      }
+    }
+  }
+
+  // Always invoke all 'add callbacks' associated with this library.
+  $return = array();
+  if (isset($library['add callbacks']) && is_array($library['add callbacks'])) {
+    // Invoke the callbacks, passing along all parameters.
+    $args = func_get_args();
+    foreach ($library['add callbacks'] as $function) {
+      if (drupal_function_exists($function))  {
+        $return[$function] = call_user_func_array($function, $args);
+      }
+    }
+  }
+  return $return;
+}
+
+/**
+ * Retrieves information from the JavaScript/CSS library registry.
+ *
+ * The library registry information is cached. Libraries are keyed by module for
+ * several reasons:
+ * - Libraries are not unique. Multiple modules might ship with the same library
+ *   in a different version or variant. This registry does not attempt and
+ *   cannot prevent library conflicts.
+ * - Modules implementing and thereby depending on a library that is registered
+ *   by another module can only rely on that module's library.
+ * - Two (or more) modules can still register the same library and use it
+ *   without conflicts in case the libraries are loaded on certain pages only.
+ *
+ * @param $module
+ *   (optional) The name of a module that registered a library.
+ * @param $library
+ *   (optional) The name of a registered library.
+ * @return
+ *   Depending on the passed arguments, an array containing all registered
+ *   libraries, or an array of registered libraries of a given module, or only a
+ *   requested library.
+ *
+ * @see drupal_add_library()
+ * @see hook_library()
+ * @see hook_library_alter()
+ */
+function drupal_get_library($module = NULL, $library = NULL) {
+  $libraries = &drupal_static(__FUNCTION__);
+
+  if (!isset($libraries)) {
+    if ($cache = cache_get('library')) {
+      $libraries = $cache->data;
+    }
+    else {
+      $libraries = array();
+      foreach (module_implements('library') as $module_name) {
+        $libraries[$module_name] = module_invoke($module_name, 'library');
+      }
+      // Allow modules to alter registered libraries.
+      drupal_alter('library', $libraries);
+
+      // Cache the registry.
+      cache_set('library', $libraries);
+    }
+  }
+
+  // Return a specific library.
+  if (isset($module) && isset($library)) {
+    return isset($libraries[$module][$library]) ? $libraries[$module][$library] : FALSE;
+  }
+  // Return all libraries of a given module.
+  elseif (isset($module)) {
+    return isset($libraries[$module]) ? $libraries[$module] : FALSE;
+  }
+  // Return all libraries.
+  return $libraries;
+}
+
+/**
  * Assist in adding the tableDrag JavaScript behavior to a themed table.
  *
  * Draggable tables should be used wherever an outline or list of sortable items
Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.343
diff -u -p -r1.343 form.inc
--- includes/form.inc	20 Jun 2009 15:17:38 -0000	1.343
+++ includes/form.inc	28 Jun 2009 19:26:58 -0000
@@ -2002,7 +2002,7 @@ function form_process_ahah($element) {
   // Adding the same javascript settings twice will cause a recursion error,
   // we avoid the problem by checking if the javascript has already been added.
   if ((isset($element['#ahah']['callback']) || isset($element['#ahah']['path'])) && isset($element['#ahah']['event']) && !isset($js_added[$element['#id']])) {
-    drupal_add_js('misc/jquery.form.js', array('weight' => JS_LIBRARY));
+    drupal_add_library('system', 'form');
     drupal_add_js('misc/ahah.js');
 
     $ahah_binding = array(
Index: modules/color/color.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/color/color.module,v
retrieving revision 1.59
diff -u -p -r1.59 color.module
--- modules/color/color.module	27 May 2009 18:33:55 -0000	1.59
+++ modules/color/color.module	28 Jun 2009 20:43:22 -0000
@@ -169,8 +169,7 @@ function color_scheme_form(&$form_state,
   $info = color_get_info($theme);
 
   // Add Farbtastic color picker.
-  drupal_add_css('misc/farbtastic/farbtastic.css', array('preprocess' => FALSE));
-  drupal_add_js('misc/farbtastic/farbtastic.js', array('weight' => JS_LIBRARY));
+  drupal_add_library('system', 'farbtastic');
 
   // Add custom CSS and JS.
   drupal_add_css($base . '/color.css', array('preprocess' => FALSE));
Index: modules/simpletest/tests/common.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/common.test,v
retrieving revision 1.46
diff -u -p -r1.46 common.test
--- modules/simpletest/tests/common.test	12 Jun 2009 08:39:39 -0000	1.46
+++ modules/simpletest/tests/common.test	28 Jun 2009 23:11:44 -0000
@@ -425,7 +425,7 @@ class JavaScriptTestCase extends DrupalW
   /**
    * Store configured value for JavaScript preprocessing.
    */
-  var $preprocess_js = NULL;
+  protected $preprocess_js = NULL;
 
   public static function getInfo() {
     return array(
@@ -437,14 +437,15 @@ class JavaScriptTestCase extends DrupalW
 
   function setUp() {
     // Enable Locale and SimpleTest in the test environment.
-    parent::setUp('locale', 'simpletest');
+    parent::setUp('locale', 'simpletest', 'common_test');
 
     // Disable preprocessing
     $this->preprocess_js = variable_get('preprocess_js', 0);
     variable_set('preprocess_js', 0);
 
-    // Reset drupal_add_js() before each test.
+    // Reset drupal_add_js() and the library registry before each test.
     drupal_static_reset('drupal_add_js');
+    drupal_static_reset('drupal_get_library');
   }
 
   function tearDown() {
@@ -552,7 +553,7 @@ class JavaScriptTestCase extends DrupalW
    * Test rendering the JavaScript with a file's weight above jQuery's.
    */
   function testRenderDifferentWeight() {
-    drupal_add_js('misc/collapse.js', array('weight' => JS_LIBRARY - 10));
+    drupal_add_js('misc/collapse.js', array('weight' => JS_LIBRARY - 21));
     $javascript = drupal_get_js();
     $this->assertTrue(strpos($javascript, 'misc/collapse.js') < strpos($javascript, 'misc/jquery.js'), t('Rendering a JavaScript file above jQuery.'));
   }
@@ -573,6 +574,55 @@ class JavaScriptTestCase extends DrupalW
     $javascript = drupal_get_js();
     $this->assertTrue(strpos($javascript, 'simpletest.js') < strpos($javascript, 'misc/tableselect.js'), t('Altering JavaScript weight through the alter hook.'));
   }
+
+  /**
+   * Checks to make sure that library registry is built correctly.
+   */
+  function testLibraryRegistry() {
+    $libraries = drupal_get_library();
+    $this->assertTrue(isset($libraries['system']['farbtastic']) && isset($libraries['system']['form']), t('The library registry is built correctly.'));
+  }
+
+  /**
+   * Adds a library to the page and tests for both its JavaScript and its CSS.
+   */
+  function testLibraryRender() {
+    $result = drupal_add_library('system', 'farbtastic');
+    $this->assertTrue($result !== FALSE, t('Library was added without errors.'));
+    $scripts = drupal_get_js();
+    $styles = drupal_get_css();
+    $this->assertTrue(strpos($scripts, 'misc/farbtastic/farbtastic.js'), t('JavaScript of library was added to the page.'));
+    $this->assertTrue(strpos($styles, 'misc/farbtastic/farbtastic.css'), t('Stylesheet of library was added to the page.'));
+  }
+
+  /**
+   * Adds a JavaScript library to the page and alters it.
+   *
+   * @see common_test_library_alter()
+   */
+  function testLibraryAlter() {
+    // Verify that common_test's add callback is present.
+    $library = drupal_get_library('system', 'farbtastic');
+    $this->assertTrue(array_search('common_test_library_add', $library['add callbacks']) !== FALSE, t('Registered libraries were altered.'));
+
+    // Add Farbtastic, which should invoke common_test_library_add().
+    $result = drupal_add_library('system', 'farbtastic');
+    $this->assertTrue(isset($result['common_test_library_add']) && $result['common_test_library_add'] == t('Add callback for the @library library fired.', array('@library' => 'farbtastic')), t("Library 'add callbacks' were invoked."));
+
+    // common_test_library_alter() also added a dependency on jQuery Form.
+    $scripts = drupal_get_js();
+    $this->assertTrue(strpos($scripts, 'misc/jquery.form.js'), t('Altered library dependencies are added to the page.'));
+  }
+
+  /**
+   * Tests that multiple modules can implement the same library.
+   *
+   * @see common_test_library()
+   */
+  function testLibraryNameConflicts() {
+    $farbtastic = drupal_get_library('common_test', 'farbtastic');
+    $this->assertEqual($farbtastic['title'], 'Farbtastic: Test library', t('Alternative libraries can be added to the page.'));
+  }
 }
 
 /**
Index: modules/simpletest/tests/common_test.info
===================================================================
RCS file: modules/simpletest/tests/common_test.info
diff -N modules/simpletest/tests/common_test.info
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/simpletest/tests/common_test.info	28 Jun 2009 22:55:30 -0000
@@ -0,0 +1,8 @@
+; $Id$
+name = "Common Test"
+description = "Support module for core Drupal functionality tests."
+core = 7.x
+package = Testing
+files[] = common_test.module
+version = VERSION
+hidden = TRUE
Index: modules/simpletest/tests/common_test.module
===================================================================
RCS file: modules/simpletest/tests/common_test.module
diff -N modules/simpletest/tests/common_test.module
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/simpletest/tests/common_test.module	28 Jun 2009 22:41:03 -0000
@@ -0,0 +1,41 @@
+<?php
+// $Id$
+
+/**
+ * Implementation of hook_library_alter().
+ */
+function common_test_library_alter(&$libraries) {
+  if (isset($libraries['system']['farbtastic'])) {
+    // Register an 'add callback' to invoke when farbtastic is loaded.
+    $libraries['system']['farbtastic']['add callbacks'][] = 'common_test_library_add';
+    // Make Farbtastic depend on jQuery Form to test library dependencies.
+    $libraries['system']['farbtastic']['dependencies'][] = array('system', 'form');
+  }
+}
+
+/**
+ * Add callback for the Farbtastic plugin.
+ */
+function common_test_library_add($module, $library) {
+  return t('Add callback for the @library library fired.', array('@library' => $library));
+}
+
+/**
+ * Implementation of hook_library().
+ *
+ * Adds Farbtastic in a different version.
+ */
+function common_test_library() {
+  $libraries['farbtastic'] = array(
+    'title' => 'Farbtastic: Test library',
+    'website' => 'http://code.google.com/p/farbtastic/',
+    'version' => '5.3',
+    'js' => array(
+      'misc/farbtastic/farbtastic.js' => array(),
+    ),
+    'css' => array(
+      'misc/farbtastic/farbtastic.css' => array(),
+    ),
+  );
+  return $libraries;
+}
Index: modules/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.158
diff -u -p -r1.158 system.admin.inc
--- modules/system/system.admin.inc	19 Jun 2009 20:35:05 -0000	1.158
+++ modules/system/system.admin.inc	29 Jun 2009 00:13:11 -0000
@@ -579,6 +579,7 @@ function system_modules($form_state = ar
   drupal_theme_rebuild();
   node_types_rebuild();
   cache_clear_all('schema', 'cache');
+  cache_clear_all('library', 'cache');
   // Get current list of modules.
   $files = system_get_module_data();
 
Index: modules/system/system.api.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.api.php,v
retrieving revision 1.45
diff -u -p -r1.45 system.api.php
--- modules/system/system.api.php	27 Jun 2009 10:19:31 -0000	1.45
+++ modules/system/system.api.php	28 Jun 2009 21:27:38 -0000
@@ -183,6 +183,114 @@ function hook_js_alter(&$javascript) {
 }
 
 /**
+ * Registers JavaScript/CSS libraries associated with a module.
+ *
+ * Modules implementing this return an array of arrays. The key to each
+ * sub-array is the machine readable name of the library. Each library may
+ * contain the following items:
+ *
+ * - 'title': The human readable name of the library.
+ * - 'website': The URL of the library's web site.
+ * - 'version': A string specifying the version of the library; intentionally
+ *   not a float because a version like "1.2.3" is not a valid float. Use PHP's
+ *   version_compare() to compare versions.
+ * - 'js': An array of JavaScript elements; each element's key is used as $data
+ *   argument, each element's value is used as $options array for
+ *   drupal_add_js(). To add library-specific (not module-specific) JavaScript
+ *   settings, the key may be skipped, the value must specify
+ *   'type' => 'setting', and the actual settings must be contained in a 'data'
+ *   element of the value. Note that only custom libraries are aware of Drupal's
+ *   JavaScript settings; usually, settings should be added by adding an
+ *   "add callback".
+ * - 'css': Like 'js', an array of CSS elements passed to drupal_add_css().
+ * - 'dependencies': An array of libraries that are required for a library. Each
+ *   element is an array containing the module and name of the registered
+ *   library.
+ * - 'add callbacks': An array of function callbacks that will be invoked when
+ *   this library is added to the page. Any additional arguments passed to
+ *   drupal_add_library() are passed along to all callback functions of this
+ *   library.
+ *
+ * @return
+ *   An array defining libraries associated with a module.
+ *
+ * @see system_library()
+ * @see drupal_add_library()
+ * @see drupal_get_library()
+ */
+function hook_library() {
+  // Library One.
+  $libraries['library-1'] = array(
+    'title' => 'Library One',
+    'website' => 'http://example.com/library-1',
+    'version' => '1.2',
+    'js' => array(
+      drupal_get_path('module', 'my_module') . '/library-1.js' => array(),
+    ),
+    'css' => array(
+      drupal_get_path('module', 'my_module') . '/library-2.css' => array(
+        'type' => 'file',
+        'media' => 'screen',
+      ),
+    ),
+  );
+  // Library Two.
+  $libraries['library-2'] = array(
+    'title' => 'Library Two',
+    'website' => 'http://example.com/library-2',
+    'version' => '2.1-beta1',
+    'js' => array(
+      // JavaScript settings may use the 'data' key.
+      array(
+        'type' => 'setting',
+        'data' => array('library-2' => TRUE),
+      ),
+    ),
+    'dependencies' => array(
+      // Require jQuery UI core.
+      array('system' => 'ui'),
+      // Require our other library.
+      array('my_module', 'library-1'),
+      // Require another library.
+      array('other_module', 'library-3'),
+    ),
+    // When this library is added to a page, all functions defined in
+    // 'add callbacks' will be called. The module name, the library name, and
+    // any additional arguments supplied to drupal_add_library() are passed to
+    // each callback.
+    'add callbacks' => array(
+      'library_2_added',
+    ),
+  );
+  return $libraries;
+}
+
+/**
+ * Alters the JavaScript/CSS library registry.
+ *
+ * The primary purpose of this hook is to allow certain contrib modules to
+ * update libraries to newer versions, while ensuring backwards compatibility;
+ * such as jquery_update module. Other modules may implement it to add further
+ * 'add callbacks' to invoke when a certain library is added to a page.
+ *
+ * @param $libraries
+ *   The JavaScript/CSS library registry, keyed by module and libray name, and
+ *   passed by reference.
+ *
+ * @see hook_library()
+ */
+function hook_library_alter(&$libraries) {
+  // Invoke a custom callback whenever jQuery UI core is added to a page.
+  if (isset($libraries['system']['ui'])) {
+    // Check that it is the version we expect.
+    if (version_compare($libraries['system']['ui']['version'], '1.7.2', '>=')) {
+      // Add our callback.
+      $libraries['system']['ui']['add callbacks'][] = 'mymodule_jquery_ui_add';
+    }
+  }
+}
+
+/**
  * Perform alterations before a page is rendered.
  *
  * Use this hook when you want to add, remove, or alter elements at the page
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.716
diff -u -p -r1.716 system.module
--- modules/system/system.module	28 Jun 2009 12:52:57 -0000	1.716
+++ modules/system/system.module	28 Jun 2009 22:05:42 -0000
@@ -789,6 +789,348 @@ function system_menu() {
 }
 
 /**
+ * Implementation of hook_library().
+ */
+function system_library() {
+  // jQuery.
+  $libraries['jquery'] = array(
+    'title' => 'jQuery',
+    'website' => 'http://jquery.com',
+    'version' => '1.3.2',
+    'js' => array(
+      'misc/jquery.js' => array('weight' => JS_LIBRARY - 20),
+    ),
+  );
+
+  // jQuery Form Plugin.
+  $libraries['form'] = array(
+    'title' => 'jQuery Form Plugin',
+    'website' => 'http://malsup.com/jquery/form/',
+    'version' => '2.16',
+    'js' => array(
+      'misc/jquery.form.js' => array(),
+    ),
+  );
+
+  // Farbtastic.
+  $libraries['farbtastic'] = array(
+    'title' => 'Farbtastic',
+    'website' => 'http://code.google.com/p/farbtastic/',
+    'version' => '1.2',
+    'js' => array(
+      'misc/farbtastic/farbtastic.js' => array(),
+    ),
+    'css' => array(
+      'misc/farbtastic/farbtastic.css' => array('preprocess' => FALSE),
+    ),
+  );
+
+  // jQuery UI.
+  $libraries['ui'] = array(
+    'title' => 'jQuery UI: Core',
+    'website' => 'http://jqueryui.com',
+    'version' => '1.7.2',
+    'js' => array(
+      'misc/ui/ui.core.js' => array('weight' => JS_LIBRARY - 10),
+    ),
+    'css' => array(
+      'misc/ui/ui.core.css' => array(),
+      'misc/ui/ui.theme.css' => array(),
+    ),
+  );
+  $libraries['ui.accordion'] = array(
+    'title' => 'jQuery UI: Accordion',
+    'website' => 'http://jqueryui.com/demos/accordion/',
+    'version' => '1.7.2',
+    'js' => array(
+      'misc/ui/ui.accordion.js' => array(),
+    ),
+    'css' => array(
+      'misc/ui/ui.accordion.css' => array(),
+    ),
+    'dependencies' => array(
+      array('system', 'ui'),
+    ),
+  );
+  $libraries['ui.datepicker'] = array(
+    'title' => 'jQuery UI: Date Picker',
+    'website' => 'http://jqueryui.com/demos/datepicker/',
+    'version' => '1.7.2',
+    'js' => array(
+      'misc/ui/ui.datepicker.js' => array(),
+    ),
+    'css' => array(
+      'misc/ui/ui.datepicker.css' => array(),
+    ),
+    'dependencies' => array(
+      array('system', 'ui'),
+    ),
+  );
+  $libraries['ui.dialog'] = array(
+    'title' => 'jQuery UI: Dialog',
+    'website' => 'http://jqueryui.com/demos/dialog/',
+    'version' => '1.7.2',
+    'js' => array(
+      'misc/ui/ui.dialog.js' => array(),
+    ),
+    'css' => array(
+      'misc/ui/ui.dialog.css' => array(),
+    ),
+    'dependencies' => array(
+      array('system', 'ui'),
+    ),
+  );
+  $libraries['ui.draggable'] = array(
+    'title' => 'jQuery UI: Dialog',
+    'website' => 'http://jqueryui.com/demos/draggable/',
+    'version' => '1.7.2',
+    'js' => array(
+      'misc/ui/ui.draggable.js' => array(),
+    ),
+    'dependencies' => array(
+      array('system', 'ui'),
+    ),
+  );
+  $libraries['ui.droppable'] = array(
+    'title' => 'jQuery UI: Droppable',
+    'website' => 'http://jqueryui.com/demos/droppable/',
+    'version' => '1.7.2',
+    'js' => array(
+      'misc/ui/ui.droppable.js' => array(),
+    ),
+    'dependencies' => array(
+      array('system', 'ui'),
+    ),
+  );
+  $libraries['ui.progressbar'] = array(
+    'title' => 'jQuery UI: Progress Bar',
+    'website' => 'http://jqueryui.com/demos/progressbar/',
+    'version' => '1.7.2',
+    'js' => array(
+      'misc/ui/ui.progressbar.js' => array(),
+    ),
+    'css' => array(
+      'misc/ui/ui.progressbar.css' => array(),
+    ),
+    'dependencies' => array(
+      array('system', 'ui'),
+    ),
+  );
+  $libraries['ui.resizable'] = array(
+    'title' => 'jQuery UI: Resizable',
+    'website' => 'http://jqueryui.com/demos/resizable/',
+    'version' => '1.7.2',
+    'js' => array(
+      'misc/ui/ui.resizable.js' => array(),
+    ),
+    'css' => array(
+      'misc/ui/ui.resizable.css' => array(),
+    ),
+    'dependencies' => array(
+      array('system', 'ui'),
+    ),
+  );
+  $libraries['ui.selectable'] = array(
+    'title' => 'jQuery UI: Selectable',
+    'website' => 'http://jqueryui.com/demos/selectable/',
+    'version' => '1.7.2',
+    'js' => array(
+      'misc/ui/ui.selectable.js' => array(),
+    ),
+    'css' => array(
+      'misc/ui/ui.selectable.css' => array(),
+    ),
+    'dependencies' => array(
+      array('system', 'ui'),
+    ),
+  );
+  $libraries['ui.slider'] = array(
+    'title' => 'jQuery UI: Slider',
+    'website' => 'http://jqueryui.com/demos/slider/',
+    'version' => '1.7.2',
+    'js' => array(
+      'misc/ui/ui.slider.js' => array(),
+    ),
+    'css' => array(
+      'misc/ui/ui.slider.css' => array(),
+    ),
+    'dependencies' => array(
+      array('system', 'ui'),
+    ),
+  );
+  $libraries['ui.sortable'] = array(
+    'title' => 'jQuery UI: Sortable',
+    'website' => 'http://jqueryui.com/demos/sortable/',
+    'version' => '1.7.2',
+    'js' => array(
+      'misc/ui/ui.sortable.js' => array(),
+    ),
+    'dependencies' => array(
+      array('system', 'ui'),
+    ),
+  );
+  $libraries['ui.tabs'] = array(
+    'title' => 'jQuery UI: Tabs',
+    'website' => 'http://jqueryui.com/demos/tabs/',
+    'version' => '1.7.2',
+    'js' => array(
+      'misc/ui/ui.tabs.js' => array(),
+    ),
+    'css' => array(
+      'misc/ui/ui.tabs.css' => array(),
+    ),
+    'dependencies' => array(
+      array('system', 'ui'),
+    ),
+  );
+  $libraries['effects'] = array(
+    'title' => 'jQuery UI: Effects',
+    'website' => 'http://jqueryui.com/demos/effect/',
+    'version' => '1.7.2',
+    'js' => array(
+      'misc/ui/effects.core.js' => array('weight' => JS_LIBRARY - 9),
+    ),
+    'dependencies' => array(
+      array('system', 'ui'),
+    ),
+  );
+  $libraries['effects.blind'] = array(
+    'title' => 'jQuery UI: Effects Blind',
+    'website' => 'http://jqueryui.com/demos/effect/',
+    'version' => '1.7.2',
+    'js' => array(
+      'misc/ui/effects.blind.js' => array(),
+    ),
+    'dependencies' => array(
+      array('system', 'effects'),
+    ),
+  );
+  $libraries['effects.bounce'] = array(
+    'title' => 'jQuery UI: Effects Bounce',
+    'website' => 'http://jqueryui.com/demos/effect/',
+    'version' => '1.7.2',
+    'js' => array(
+      'misc/ui/effects.bounce.js' => array(),
+    ),
+    'dependencies' => array(
+      array('system', 'effects'),
+    ),
+  );
+  $libraries['effects.clip'] = array(
+    'title' => 'jQuery UI: Effects Clip',
+    'website' => 'http://jqueryui.com/demos/effect/',
+    'version' => '1.7.2',
+    'js' => array(
+      'misc/ui/effects.clip.js' => array(),
+    ),
+    'dependencies' => array(
+      array('system', 'effects'),
+    ),
+  );
+  $libraries['effects.drop'] = array(
+    'title' => 'jQuery UI: Effects Drop',
+    'website' => 'http://jqueryui.com/demos/effect/',
+    'version' => '1.7.2',
+    'js' => array(
+      'misc/ui/effects.drop.js' => array(),
+    ),
+    'dependencies' => array(
+      array('system', 'effects'),
+    ),
+  );
+  $libraries['effects.explode'] = array(
+    'title' => 'jQuery UI: Effects Explode',
+    'website' => 'http://jqueryui.com/demos/effect/',
+    'version' => '1.7.2',
+    'js' => array(
+      'misc/ui/effects.explode.js' => array(),
+    ),
+    'dependencies' => array(
+      array('system', 'effects'),
+    ),
+  );
+  $libraries['effects.fold'] = array(
+    'title' => 'jQuery UI: Effects Fold',
+    'website' => 'http://jqueryui.com/demos/effect/',
+    'version' => '1.7.2',
+    'js' => array(
+      'misc/ui/effects.fold.js' => array(),
+    ),
+    'dependencies' => array(
+      array('system', 'effects'),
+    ),
+  );
+  $libraries['effects.highlight'] = array(
+    'title' => 'jQuery UI: Effects Fold',
+    'website' => 'http://jqueryui.com/demos/effect/',
+    'version' => '1.7.2',
+    'js' => array(
+      'misc/ui/effects.highlight.js' => array(),
+    ),
+    'dependencies' => array(
+      array('system', 'effects'),
+    ),
+  );
+  $libraries['effects.pulsate'] = array(
+    'title' => 'jQuery UI: Effects Pulsate',
+    'website' => 'http://jqueryui.com/demos/effect/',
+    'version' => '1.7.2',
+    'js' => array(
+      'misc/ui/effects.pulsate.js' => array(),
+    ),
+    'dependencies' => array(
+      array('system', 'effects'),
+    ),
+  );
+  $libraries['effects.scale'] = array(
+    'title' => 'jQuery UI: Effects Pulsate',
+    'website' => 'http://jqueryui.com/demos/effect/',
+    'version' => '1.7.2',
+    'js' => array(
+      'misc/ui/effects.scale.js' => array(),
+    ),
+    'dependencies' => array(
+      array('system', 'effects'),
+    ),
+  );
+  $libraries['effects.shake'] = array(
+    'title' => 'jQuery UI: Effects Shake',
+    'website' => 'http://jqueryui.com/demos/effect/',
+    'version' => '1.7.2',
+    'js' => array(
+      'misc/ui/effects.scale.js' => array(),
+    ),
+    'dependencies' => array(
+      array('system', 'effects'),
+    ),
+  );
+  $libraries['effects.slide'] = array(
+    'title' => 'jQuery UI: Effects Slide',
+    'website' => 'http://jqueryui.com/demos/effect/',
+    'version' => '1.7.2',
+    'js' => array(
+      'misc/ui/effects.slide.js' => array(),
+    ),
+    'dependencies' => array(
+      array('system', 'effects'),
+    ),
+  );
+  $libraries['effects.transfer'] = array(
+    'title' => 'jQuery UI: Effects Transfer',
+    'website' => 'http://jqueryui.com/demos/effect/',
+    'version' => '1.7.2',
+    'js' => array(
+      'misc/ui/effects.transfer.js' => array(),
+    ),
+    'dependencies' => array(
+      array('system', 'effects'),
+    ),
+  );
+
+  return $libraries;
+}
+
+/**
  * Retrieve a blocked IP address from the database.
  *
  * @param $iid integer
