? modal_2.patch.txt
? modal_3.patch
? sites/default/files
? sites/default/private
? sites/default/settings.php
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.977
diff -u -p -r1.977 common.inc
--- includes/common.inc	26 Aug 2009 15:00:17 -0000	1.977
+++ includes/common.inc	29 Aug 2009 20:57:38 -0000
@@ -5188,3 +5188,31 @@ function xmlrpc($url) {
   return call_user_func_array('_xmlrpc', $args);
 }
 
+
+/**
+ * Add a dialog using jquery UI.
+ * @param $trigger_selector
+ *   A jquery selector which should open a dialog when clicked.
+ *     Example: 'a#modal-link'
+ * @param $content_selector
+ *   A jquery selector which contains the content for display in the dialog.
+ * @param $options
+ *   An array of dialog options keyed by option name.
+ *     See http://docs.jquery.com/UI/Dialog#options for available options.
+ */
+function drupal_dialog($trigger_selector = '', $content_selector = '', $options = array()) {
+  $dialogs = &drupal_static(__FUNCTION__, array());
+  if (!count($dialogs)) {
+    drupal_add_library('system', 'ui.dialog');
+    drupal_add_library('system', 'ui.draggable');
+    drupal_add_library('system', 'ui.resizable');
+    drupal_add_js('misc/dialog.js');
+  }
+  if (!isset($dialogs[$trigger_selector])) {
+    $settings['content_selector'] = $content_selector;
+    $settings['settings'] = $options;
+    $dialogs[$trigger_selector] = $settings;
+    drupal_add_js(array('dialogs' => $dialogs), 'setting');
+  }
+  return $dialogs;
+}
\ No newline at end of file
Index: misc/dialog.js
===================================================================
RCS file: misc/dialog.js
diff -N misc/dialog.js
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ misc/dialog.js	29 Aug 2009 20:57:38 -0000
@@ -0,0 +1,30 @@
+// $Id$
+(function ($) {
+
+/**
+ * Initialize all modal dialogs requested by drupal_dialog().
+ */
+Drupal.behaviors.dialog = {
+  attach: function (context, settings) {
+  for (var key in Drupal.settings.dialogs) {
+    if (!$(key).hasClass('dialog-processed')) {
+      var dialog = Drupal.settings.dialogs[key];
+      // Initialize the dialog with some default settings.
+      // Other default settings are defined by http://docs.jquery.com/UI/Dialog.
+      $(dialog.content_selector).dialog({ 
+        autoOpen: false, 
+      });
+      // Alter the dialog with any custom settings.
+      for (var optionName in dialog.settings) {
+        $(dialog.content_selector).dialog('option', optionName, dialog.settings[optionName]);
+      }
+      $(key).click(function() {
+        $(dialog.content_selector).dialog("open");
+        return false;
+      }).addClass('dialog-processed');
+    }
+  }
+ }
+}
+
+})(jQuery);
Index: modules/filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.286
diff -u -p -r1.286 filter.module
--- modules/filter/filter.module	29 Aug 2009 03:55:44 -0000	1.286
+++ modules/filter/filter.module	29 Aug 2009 20:57:38 -0000
@@ -741,7 +741,13 @@ function filter_dom_serialize($dom_docum
  * @ingroup themeable
  */
 function theme_filter_tips_more_info() {
-  return '<p>' . l(t('More information about text formats'), 'filter/tips') . '</p>';
+  $output = '<p>' . l(t('More information about text formats'), 'filter/tips', array('attributes' => array('class' => 'filter-tips-modal'))) . '</p>';
+  $options = array();
+  $title = t('Filter Tips');
+  $content = filter_tips_long();
+  $output .= '<div id="filter-tips-modal-dialog" class="ui-helper-hidden" title="' . $title . '">' . $content . '</div>';
+  drupal_dialog(".filter-tips-modal", "#filter-tips-modal-dialog", array('width' => 600, 'height' => 500));
+  return $output;
 }
 
 /**
Index: modules/filter/filter.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.pages.inc,v
retrieving revision 1.7
diff -u -p -r1.7 filter.pages.inc
--- modules/filter/filter.pages.inc	8 Mar 2009 21:25:18 -0000	1.7
+++ modules/filter/filter.pages.inc	29 Aug 2009 20:57:38 -0000
@@ -11,14 +11,7 @@
  * Menu callback; show a page with long filter tips.
  */
 function filter_tips_long() {
-  $format = arg(2);
-  if ($format) {
-    $output = theme('filter_tips', _filter_tips($format, TRUE), TRUE);
-  }
-  else {
-    $output = theme('filter_tips', _filter_tips(-1, TRUE), TRUE);
-  }
-  return $output;
+  return theme('filter_tips', _filter_tips(-1, TRUE), TRUE);
 }
 
 
Index: modules/php/php.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/php/php.test,v
retrieving revision 1.16
diff -u -p -r1.16 php.test
--- modules/php/php.test	28 Aug 2009 16:23:04 -0000	1.16
+++ modules/php/php.test	29 Aug 2009 20:57:38 -0000
@@ -56,7 +56,7 @@ class PHPFilterTestCase extends PHPTestC
 
     // 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();
@@ -66,7 +66,7 @@ class PHPFilterTestCase extends PHPTestC
     $this->assertRaw(t('Page %title has been updated.', array('%title' => $node->title)), 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.'));
   }
 }
