Index: jquery_ui.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/jquery_ui/jquery_ui.info,v
retrieving revision 1.2
diff -u -r1.2 jquery_ui.info
--- jquery_ui.info	1 Aug 2008 15:06:22 -0000	1.2
+++ jquery_ui.info	12 Jan 2009 19:13:09 -0000
@@ -2,5 +2,6 @@
 name = jQuery UI
 description = Provides the jQuery UI plug-in to other Drupal modules.
 package = User interface
-core = 6.x
-dependencies[] = jquery_update
+core = 7.x
+files[] = jquery_ui.module
+files[] = jquery_ui.install
Index: jquery_ui.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/jquery_ui/jquery_ui.install,v
retrieving revision 1.4
diff -u -r1.4 jquery_ui.install
--- jquery_ui.install	3 Nov 2008 23:21:02 -0000	1.4
+++ jquery_ui.install	12 Jan 2009 19:13:09 -0000
@@ -1,44 +1,24 @@
 <?php
-// $Id: jquery_ui.install,v 1.4 2008/11/03 23:21:02 sun Exp $
+// $Id$
 
 /**
- * @file
- * Installation file for jQuery UI module.
- */
-
-/**
- * Implementation of hook_requirements().
+ * Checks that jQuery UI is installed.
  */
 function jquery_ui_requirements($phase) {
-  $requirements = array();
-  $t = get_t();
-  $jquery_ui_version = 0;
-
-  if ($phase == 'install') {
-    // The jquery_ui_get_version() function is in the .module file, which isn't
-    // loaded yet.
-    include_once drupal_get_path('module', 'jquery_ui') . '/jquery_ui.module';
-  }
-
-  $requirements['jquery_ui']['title'] = $t('jQuery UI');
-  if ($jquery_ui_version = jquery_ui_get_version()) {
-    // Everything looks good; display the current jQuery UI version.
-    $requirements['jquery_ui']['value'] = $jquery_ui_version;
-    $requirements['jquery_ui']['severity'] = REQUIREMENT_OK;
+  $version = jquery_ui_get_version();
+  $requirements = array(
+    'jquery_ui' => array(
+      'title' => t('jQuery UI'),
+    ),
+  );
+  if ($version == 0) {
+    $requirements['jquery_ui']['value'] = t('Not found');
+    $requirements['jquery_ui']['severity'] = REQUIREMENT_ERROR;
+    $requirements['jquery_ui']['description'] = t('Missing jQuery UI plug-in. Please !download and extract it to your sites/all/plugins directory.', array('!download' => l($t('download the jQuery UI development bundle'), 'http://ui.jquery.com/download')));
   }
   else {
-    // Required library wasn't found. Abort installation.
-    $requirements['jquery_ui']['value'] = $t('Not found');
-    $requirements['jquery_ui']['description'] = $t('Missing jQuery UI plug-in. Please !download and extract it to your jquery_ui module directory. See README.txt for more info.', array('!download' => l($t('download the jQuery UI development bundle'), 'http://ui.jquery.com/download')));
-    $requirements['jquery_ui']['severity'] = REQUIREMENT_ERROR;
+    $requirements['jquery_ui']['value'] = $version;
+    $requirements['jquery_ui']['severity'] = REQUIREMENT_OK;
   }
-
   return $requirements;
 }
-
-/**
- * Implementation of hook_uninstall().
- */
-function jquery_ui_uninstall() {
-  variable_del('jquery_ui_compression_type');
-}
Index: jquery_ui.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/jquery_ui/jquery_ui.module,v
retrieving revision 1.5
diff -u -r1.5 jquery_ui.module
--- jquery_ui.module	22 Jun 2008 20:09:58 -0000	1.5
+++ jquery_ui.module	12 Jan 2009 19:13:09 -0000
@@ -4,82 +4,79 @@
 /**
  * @file
  * Provides the jQuery UI plug-in to other Drupal modules.
- *
- * This module doesn't do too much, but it is a central location for any other
- * modules that implement the JQuery UI library. It ensures that multiple
- * modules will all include the same library script just once on any given page.
  */
 
 /**
- * Path to jQuery UI library.
+ * Implementation of hook_js_plugin().
  */
-define('JQUERY_UI_PATH', drupal_get_path('module', 'jquery_ui') . '/jquery.ui');
- 
-/**
- * Add the specified jQuery UI library files to this page.
- *
- * The ui.core file is always included automatically, as well as the
- * effects.core file if any of the effects libraries are used.
- *
- * @param $files
- *   An array of what additional files (other than UI core) should be loaded
- *   on the page, or a string with a single file name.
- */
-function jquery_ui_add($files = array()) {
-  static $loaded_files, $ui_core, $effects_core;
-  $jquery_ui_path = JQUERY_UI_PATH . '/ui';
-  $compression = variable_get('jquery_update_compression_type', 'mini');
-
-  // Convert file to an array if it's not one already, to compensate for
-  // lazy developers. ;)
-  if (!is_array($files)) {
-    $files = array($files);
-  }
-
-  // If core hasn't been added yet, add it.
-  if (!isset($ui_core)) {
-    $ui_core = TRUE;
-    jquery_ui_add(array('ui.core'));
+function jquery_ui_js_plugin() {
+  $plugins = array();
+  $version = jquery_ui_get_version();
+  $skin = variable_get('jquery_ui_skin', 'default');
+  if ($version > 0) {
+    $path = jquery_ui_get_path();
+    $plugins['ui.core'] = array(
+      'name' => t('jQuery UI'),
+      'description' => t('jQuery UI provides abstractions for low-level interaction and animation, advanced effects and high-level, themeable widgets, built on top of the jQuery JavaScript Library, that you can use to build highly interactive web applications.'),
+      'version' => $version,
+      'files' => array(
+        'js' => array(
+          $path . '/ui/ui.core.js',
+        ),
+        'css' => array(
+          "$path/themes/$skin/ui.core.js",
+        ),
+      ),
+    );
+    $plugins['ui.accordion'] = array(
+      'name' => t('Accordian'),
+      'version' => $version,
+      'files' => array(
+        'js' => array(
+          $path . '/ui/ui.core.js',
+          $path . '/ui/ui.accordion.js',
+        ),
+        'css' => array(
+          "$path/themes/$skin/ui.core.js",
+          "$path/themes/$skin/ui.core.css",
+        ),
+      ),
+    );
   }
+  return $plugins;
+}
 
-  // Loop through list of files to include and add them to the page.
-  foreach ($files as $file) {
-    // Any effects files require the effects core file.
-    if (!isset($effects_core) && strpos($file, 'effects.') === 0) {
-      $effects_core = TRUE;
-      jquery_ui_add(array('effects.core'));
+/**
+ * Return the version of jQuery UI installed.
+ */
+function jquery_ui_get_version() {
+  static $version = NULL;
+  if (!isset($version)) {
+    if (file_exists(jquery_ui_get_path() . '/version.txt')) {
+      $version = file_get_contents(jquery_ui_get_path() . '/version.txt');
     }
-  
-    // Load other files.
-    if (!isset($loaded_files[$file])) {
-      switch ($compression) {
-        case 'none':
-          $file_path = "$file.js";
-          break;
-        case 'pack':
-          $file_path = "packed/$file.packed.js";
-          break;
-        case 'mini':
-        default:
-          $file_path = "minified/$file.min.js";
-          break;
-      }
-      $js_path = $jquery_ui_path . '/' . $file_path;
-      drupal_add_js($js_path);
-      $loaded_files[$file] = $js_path; // or TRUE...
+    else {
+      $version = 0;
     }
   }
+  return $version;
 }
 
 /**
- * Return the version of jQuery UI installed.
+ * Retrieves the path where jQuery UI is located.
  */
-function jquery_ui_get_version() {
-  $version = 0;
-
-  if (file_exists(JQUERY_UI_PATH . '/version.txt')) {
-    $version = file_get_contents(JQUERY_UI_PATH . '/version.txt');
+function jquery_ui_get_path() {
+  static $path = NULL;
+  if (!isset($path)) {
+    $files = drupal_system_listing('(ui.core.js$)', 'plugins', 'name', 0);
+    dvm($files);
+    if (isset($files['ui.core'])) {
+      $path = dirname($files['ui.core']->filename);
+      $path = dirname($path . '../');
+    }
+    else {
+      $path = FALSE;
+    }
   }
-
-  return $version;
+  return $path;
 }
