Index: modules/filter/filter.module =================================================================== RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v retrieving revision 1.230 diff -u -p -r1.230 filter.module --- modules/filter/filter.module 14 Oct 2008 20:44:56 -0000 1.230 +++ modules/filter/filter.module 26 Oct 2008 21:20:14 -0000 @@ -477,57 +477,48 @@ function filter_form($value = FILTER_FOR $value = filter_resolve_format($value); $formats = filter_formats(); - $extra = theme('filter_tips_more_info'); + $form = array( + '#type' => 'fieldset', + '#weight' => $weight, + '#attributes' => array('class' => 'input-format-wrapper'), + ); if (count($formats) > 1) { - $form = array( - '#type' => 'fieldset', - '#title' => t('Input format'), - '#collapsible' => TRUE, - '#collapsed' => TRUE, - '#weight' => $weight, - '#element_validate' => array('filter_form_validate'), - ); - // Multiple formats available: display radio buttons with tips. + // Multiple formats available: display dropdown select list. foreach ($formats as $format) { - // Generate the parents as the autogenerator does, so we will have a - // unique id for each radio button. - $parents_for_id = array_merge($parents, array($format->format)); - $form[$format->format] = array( - '#type' => 'radio', - '#title' => $format->name, - '#default_value' => $value, - '#return_value' => $format->format, - '#parents' => $parents, - '#description' => theme('filter_tips', _filter_tips($format->format, FALSE)), - '#id' => form_clean_id('edit-' . implode('-', $parents_for_id)), - ); + $options[$format->format] = $format->name; + // TODO: Add these descriptions to the form as hidden markup. Then using + // jQuery, show the corresponding description when a format is selected. + $descriptions[$format->format] = theme('filter_tips', _filter_tips($format->format, FALSE)); } + $element_id = form_clean_id('edit-' . implode('-', $parents)); + $form['format'] = array( + '#type' => 'select', + '#title' => t('Input format'), + '#options' => $options, + '#default_value' => $value, + '#parents' => $parents, + '#id' => $element_id, + '#suffix' => '
' . l(t('More information about formatting options'), 'filter/tips') . '
'; +function theme_filter_tips_more_info($icon = FALSE) { + if ($icon) { + $description = t('More information about formatting options'); + return l(theme('image', 'misc/help.png', $description, $description), 'filter/tips', array('html' => TRUE)); + } + else { + return ''. l(t('More information about formatting options'), 'filter/tips') .'
'; + } } /** Index: modules/system/system.css =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.css,v retrieving revision 1.52 diff -u -p -r1.52 system.css --- modules/system/system.css 19 Oct 2008 20:55:07 -0000 1.52 +++ modules/system/system.css 26 Oct 2008 21:20:14 -0000 @@ -348,6 +348,46 @@ html.js fieldset.collapsible .fieldset-w } /* +** Input formats +*/ +/* Align the Input format fieldset to its textarea */ +.input-format-wrapper { + margin-top: -1em; + margin-right: -2px; +} +/* Puts it all on one line and applies some margins and font weight */ +.input-format-wrapper .form-item { + float: left; + margin: 0; +} +.input-format-wrapper .form-item label { + float: left; + margin-right: 1em; + font-weight: normal; +} +.input-format-wrapper .form-item select { + float: left; + margin-right: 1em; +} +.input-format-help { + float: left; +} +/* Removes unaesthetic spacing at the bottom when only one input format is available */ +.input-format-wrapper p { + margin-bottom: 0; +} +/* To make the Input format fieldset the same width as the body textarea, we can make + the whole wrapper 95% wide, instead of only the textarea. This will also have to be + done on other textareas that has input formats, such as CCK's. */ +.body-field-wrapper { + width: 95%; +} +.body-field-wrapper textarea, +.body-field-wrapper .resizable-textarea { + width: 100%; +} + +/* ** Resizable text areas */ .resizable-textarea {