Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.1000 diff -u -p -r1.1000 common.inc --- includes/common.inc 29 Sep 2009 17:52:46 -0000 1.1000 +++ includes/common.inc 29 Sep 2009 22:28:24 -0000 @@ -3728,6 +3728,42 @@ function drupal_add_tabledrag($table_id, } /** + * Adds a dialog using jQuery UI. + * + * @param $options + * An array of options with the following keys: + * - 'trigger_selector': A jQuery selector which should open a dialog when + * clicked. Example: 'a#modal-link'. + * - 'content_selector': A jQuery selector which contains the content for + * display in the dialog. + * - 'options': An array of dialog options keyed by option name. See + * @link http://docs.jquery.com/UI/Dialog#options jQuery UI documentation @endlink + * for available options. + */ +function drupal_add_dialog(array $options = array()) { + $dialogs = &drupal_static(__FUNCTION__, array()); + // Add default options to the options array. + $options += array( + 'options' => 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'); + } + $trigger_selector = $options['trigger_selector']; + if (!isset($dialogs[$trigger_selector])) { + $dialogs[$trigger_selector] = array( + 'content_selector' => $options['content_selector'], + 'options' => $options['options'], + ); + drupal_add_js(array('dialogs' => $dialogs), 'setting'); + } + return $dialogs; +} + +/** * Aggregate JS files, putting them in the files directory. * * @param $files 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 27 Sep 2009 23:36:26 -0000 @@ -0,0 +1,29 @@ +// $Id$ +(function ($) { + +/** + * Initialize all modal dialogs requested by drupal_add_dialog(). + */ +Drupal.behaviors.dialog = { + attach: function (context, settings) { + for (var key in settings.dialogs) { + $(key).once('dialog', function { + var dialog = settings.dialogs[key]; + // Initialize the dialog with some default settings. + $(dialog.content_selector).dialog({ + autoOpen: false + }); + // Alter the dialog with any custom settings. + for (var name in dialog.options) { + $(dialog.content_selector).dialog('option', name, dialog.options[name]); + } + $(key).click(function() { + $(dialog.content_selector).dialog('open'); + return false; + }); + }); + } + } +} + +})(jQuery); Index: modules/filter/filter.module =================================================================== RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v retrieving revision 1.291 diff -u -p -r1.291 filter.module --- modules/filter/filter.module 20 Sep 2009 07:32:18 -0000 1.291 +++ modules/filter/filter.module 29 Sep 2009 22:28:24 -0000 @@ -49,9 +49,6 @@ function filter_theme() { 'arguments' => array('tips' => NULL, 'long' => FALSE), 'file' => 'filter.pages.inc', ), - 'filter_tips_more_info' => array( - 'arguments' => array(), - ), 'filter_guidelines' => array( 'arguments' => array('format' => NULL), ), @@ -776,10 +773,25 @@ function filter_form($selected_format = ); $form['format_help'] = array( '#prefix' => '
', - '#markup' => theme('filter_tips_more_info'), '#suffix' => '
', '#weight' => 1, ); + $form['format_help']['#attached']['drupal_add_dialog'][][] = array( + 'trigger_selector' => '.filter-tips-modal', + 'content_selector' => '#filter-tips-modal-dialog', + 'options' => array( + 'width' => 600, + 'height' => 500, + ), + ); + $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' => '
', + '#markup' => filter_tips_long(), + '#suffix' => '
', + ); return $form; } @@ -893,15 +905,6 @@ function filter_dom_serialize($dom_docum } /** - * Format a link to the more extensive filter tips. - * - * @ingroup themeable - */ -function theme_filter_tips_more_info() { - return '

' . l(t('More information about text formats'), 'filter/tips') . '

'; -} - -/** * Format guidelines for a text format. * * @ingroup themeable 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 Sep 2009 22:28:24 -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.17 diff -u -p -r1.17 php.test --- modules/php/php.test 20 Sep 2009 07:32:18 -0000 1.17 +++ modules/php/php.test 29 Sep 2009 22:30:38 -0000 @@ -60,7 +60,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(); @@ -70,7 +70,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.')); } } Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.797 diff -u -p -r1.797 system.module --- modules/system/system.module 29 Sep 2009 15:31:16 -0000 1.797 +++ modules/system/system.module 29 Sep 2009 22:28:24 -0000 @@ -973,7 +973,6 @@ function system_library() { ), 'css' => array( 'misc/ui/ui.core.css' => array(), - 'misc/ui/ui.theme.css' => array(), ), ); $libraries['ui.accordion'] = array( Index: themes/garland/style.css =================================================================== RCS file: /cvs/drupal/drupal/themes/garland/style.css,v retrieving revision 1.64 diff -u -p -r1.64 style.css --- themes/garland/style.css 31 Aug 2009 17:40:03 -0000 1.64 +++ themes/garland/style.css 29 Sep 2009 22:28:24 -0000 @@ -1125,3 +1125,27 @@ table.system-status-report tr.ok, table. background-color: #dfd; border-color: #beb; } + +/** + * UI dialogs. + */ +.ui-dialog { + background-color: #fff; + border: 1px solid #ccc; + padding: 0; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; +} +.ui-dialog .ui-dialog-titlebar { + background-color: #edf5fa; +} +.ui-icon { + width: 16px; + height: 16px; + background-image: url(/misc/ui/images/ui-icons_222222_256x240.png); +} +.ui-icon-closethick { + background-position: -96px -128px; +} + Index: themes/seven/style.css =================================================================== RCS file: /cvs/drupal/drupal/themes/seven/style.css,v retrieving revision 1.18 diff -u -p -r1.18 style.css --- themes/seven/style.css 11 Sep 2009 13:48:44 -0000 1.18 +++ themes/seven/style.css 29 Sep 2009 22:28:24 -0000 @@ -715,6 +715,29 @@ div.admin-options div.form-item { border: none; } +/** + * UI dialogs. + */ +.ui-dialog { + background-color: #fff; + border: 1px solid #ccc; + padding: 0; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; +} +.ui-dialog .ui-dialog-titlebar { + background-color: #e0e0d8; +} +.ui-icon { + width: 16px; + height: 16px; + background-image: url(/misc/ui/images/ui-icons_222222_256x240.png); +} +.ui-icon-closethick { + background-position: -96px -128px; +} + /* Overlay theming */ body.overlay { background: #fff;