Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.811
diff -u -r1.811 system.module
--- modules/system/system.module	14 Oct 2009 20:42:47 -0000	1.811
+++ modules/system/system.module	14 Oct 2009 21:56:57 -0000
@@ -1104,6 +1104,8 @@
     ),
     'dependencies' => array(
       array('system', 'ui'),
+      array('system', 'ui.draggable'),
+      array('system', 'ui.resizable'),
     ),
   );
   $libraries['ui.draggable'] = array(
Index: modules/php/php.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/php/php.test,v
retrieving revision 1.18
diff -u -r1.18 php.test
--- modules/php/php.test	11 Oct 2009 03:07:19 -0000	1.18
+++ modules/php/php.test	14 Oct 2009 21:56:57 -0000
@@ -60,7 +60,7 @@
 
     // Make sure that the PHP code shows up as text.
     $this->drupalGet('node/' . $node->nid);
-    $this->assertText('print', t('PHP code is displayed.'));
+    $this->assertText('print "SimpleTest PHP was executed!"', t('PHP code is displayed.'));
 
     // Change filter to PHP filter and see that PHP code is evaluated.
     $edit = array();
@@ -70,7 +70,7 @@
     $this->assertRaw(t('Page %title has been updated.', array('%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'])), t('PHP code filter turned on.'));
 
     // Make sure that the PHP code shows up as text.
-    $this->assertNoText('print', t('PHP code isn\'t displayed.'));
+    $this->assertNoText('print "SimpleTest PHP was executed!"', t('PHP code isn\'t displayed.'));
     $this->assertText('SimpleTest PHP was executed!', t('PHP code has been evaluated.'));
   }
 }
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.1017
diff -u -r1.1017 common.inc
--- includes/common.inc	13 Oct 2009 21:16:42 -0000	1.1017
+++ includes/common.inc	14 Oct 2009 21:56:57 -0000
@@ -3673,6 +3673,61 @@
 }
 
 /**
+ * Adds a jQuery UI element to the page, and invokes its behaviors.
+ *
+ * @param $module
+ *   The name of the module that registered the desired library. For most jQuery
+ *   UI elements, this is usually "system".
+ * @param $library
+ *   The name of the library to add. Some examples are "ui.dialog",
+ *   "effects.resizable", "ui.accordion", etc.
+ * @param $selector
+ *   (optional) The jQuery selector for the element to apply the tool to.
+ * @param $options
+ *   (optional) The options that are passed to the element during execution.
+ * @param $event
+ *   (optional) On what binded event the tool should be applied to the element.
+ *   Defaults to once the element is ready, much like document.ready().
+ * @param $binded_element
+ *   (optional) When binding on an event other than ready, will be the element
+ *   that the event is binded to.
+ * @param $base
+ *   The base name of the tool that is being added. Specify "effects" for any
+ *   jQuery UI effect, and "ui" for widgets and interactions. Defaults to "ui".
+ * @return
+ *   An array representing all elements added to the page so far.
+ */
+function drupal_add_ui($module, $library, $selector = NULL, $options = array(), $event = 'ready', $binded_element = NULL) {
+  $elements = &drupal_static(__FUNCTION__, array());
+  // Add the jQuery UI Drupal behaviors.
+  if (empty($elements)) {
+    drupal_add_js('misc/ui.js');
+  }
+  // Retrieve the desired base (ui or effects) and tool (dialog, draggable, etc).
+  list($base, $tool) = explode('.', $library, 2);
+  // Add the jQuery UI tool if it hasn't been added yet.
+  if (!isset($elements[$library])) {
+    $elements[$library] = array();
+    drupal_add_library($module, $library);
+  }
+  // Add the settings so that the behaviors are attached to the elements.
+  if (isset($selector) && !isset($elements[$library][$selector][$event])) {
+    $elements[$library][$selector][$event] = $options;
+    drupal_add_js(array('ui' => array(
+      $tool => array(
+        $selector => array(
+          $event => array(
+            'options' => $options,
+            'item' => $binded_element,
+          ),
+        ),
+      ),
+    )), 'setting');
+  }
+  return $elements;
+}
+
+/**
  * Retrieves information for a JavaScript/CSS library.
  *
  * Library information is statically cached. Libraries are keyed by module for
Index: modules/filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.297
diff -u -r1.297 filter.module
--- modules/filter/filter.module	13 Oct 2009 15:39:41 -0000	1.297
+++ modules/filter/filter.module	14 Oct 2009 21:56:57 -0000
@@ -49,9 +49,6 @@
       'arguments' => array('tips' => NULL, 'long' => FALSE),
       'file' => 'filter.pages.inc',
     ),
-    'filter_tips_more_info' => array(
-      'arguments' => array(),
-    ),
     'filter_guidelines' => array(
       'arguments' => array('format' => NULL),
     ),
@@ -665,10 +662,28 @@
   );
   $form['format_help'] = array(
     '#prefix' => '<div id="' . $element_id . '-help" class="filter-help">',
-    '#markup' => theme('filter_tips_more_info'),
     '#suffix' => '</div>',
     '#weight' => 1,
   );
+  // Present the more information about text formats link.
+  $form['format_help']['more'] = array(
+    '#markup' => l(t('More information about text formats'), 'filter/tips', array('attributes' => array('class' => array('filter-tips-modal')))),
+  );
+  $form['format_help']['long'] = array(
+    '#prefix' => '<div id="filter-tips-modal-dialog" class="ui-helper-hidden" title="' . t('Filter tips') . '">',
+    '#markup' => filter_tips_long(),
+    '#suffix' => '</div>',
+  );
+
+  // Create a dialog box for the filter tips.
+  $form['#attached']['drupal_add_ui'][] = array('system', 'ui.dialog', '#filter-tips-modal-dialog', array(
+    'width' => 600,
+    'height' => 500,
+    'dialogClass' => 'filter-tips',
+    'autoOpen' => FALSE,
+  ));
+  // When the user clicks on the more information link, present the dialog box.
+  $form['#attached']['drupal_add_ui'][] = array('system', 'ui.dialog', '#filter-tips-modal-dialog', 'open', 'click', '.filter-tips-modal');
 
   return $form;
 }
@@ -777,15 +792,6 @@
 }
 
 /**
- * Format a link to the more extensive filter tips.
- *
- * @ingroup themeable
- */
-function theme_filter_tips_more_info() {
-  return '<p>' . l(t('More information about text formats'), 'filter/tips') . '</p>';
-}
-
-/**
  * Format guidelines for a text format.
  *
  * @param $variables
Index: modules/filter/filter.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.pages.inc,v
retrieving revision 1.9
diff -u -r1.9 filter.pages.inc
--- modules/filter/filter.pages.inc	13 Oct 2009 15:39:41 -0000	1.9
+++ modules/filter/filter.pages.inc	14 Oct 2009 21:56:57 -0000
@@ -11,17 +11,9 @@
  * Menu callback; show a page with long filter tips.
  */
 function filter_tips_long() {
-  $format_id = arg(2);
-  if ($format_id) {
-    $output = theme('filter_tips', array('tips' => _filter_tips($format_id, TRUE), 'long' => TRUE));
-  }
-  else {
-    $output = theme('filter_tips', array('tips' => _filter_tips(-1, TRUE), 'long' => TRUE));
-  }
-  return $output;
+  return theme('filter_tips', array('tips' => _filter_tips(-1, TRUE), 'long' => TRUE));
 }
 
-
 /**
  * Render HTML for a set of filter tips.
  *
Index: misc/ui.js
===================================================================
RCS file: misc/ui.js
diff -N misc/ui.js
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ misc/ui.js	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,45 @@
+// $Id$
+(function ($) {
+
+/**
+ * @file
+ * Provides the jQuery UI Drupal behaviors.
+ */
+
+/**
+ * The jQuery UI Drupal behavior.
+ *
+ * This will go through all widgets and apply them to the given selectors with
+ * the appropriate arguments. It also takes binded events into consideration.
+ */
+Drupal.behaviors.ui = {
+  attach: function(context, settings) {
+    if (settings.ui || false) {
+      // Iterate through each widget and apply the tool to the elements.
+      jQuery.each(settings.ui, function(tool, selectors) {
+        // Iterate through each selector to bind the events.
+        jQuery.each(selectors, function(selector, events) {
+          // Iterate through each event to bind the elements to their properties.
+          jQuery.each(events, function(event, options) {
+            // See if we are to bind the tool to an event, or just apply it when
+            // the element itself is ready.
+            if (event == 'ready') {
+              // Apply the jQuery UI's effect.
+              $(selector, context).once('ui-' + tool + '-ready')[tool](options.options);
+            }
+            else {
+              // Apply the jQuery UI's effect on a binded event.
+              $(options.item, context).once('ui-' + tool + '-' + event).bind(event, function(e) {
+                $(selector, context)[tool](options.options);
+                // Remove the default effect as we're using jQuery UI now.
+                return false;
+              });
+            }
+          });
+        });
+      });
+    }
+  }
+};
+
+})(jQuery);
