? .DS_Store
? 304330_81_input_format_widget.patch
? input_format_widget_00.patch
? input_format_widget_01.patch
? modules/.DS_Store
? sites/.DS_Store
? sites/default/files
? sites/default/settings.php
? themes/.DS_Store
Index: misc/form.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/form.js,v
retrieving revision 1.2
diff -u -p -r1.2 form.js
--- misc/form.js	29 Oct 2008 10:01:26 -0000	1.2
+++ misc/form.js	26 Jan 2009 20:55:41 -0000
@@ -10,3 +10,20 @@ Drupal.behaviors.multiselectSelector = {
     });
   }
 };
+
+
+Drupal.behaviors.filterGuildelines = {
+  attach: function (context) {
+  // Automatically displays the guidelines of the selected input format.
+  $('.filter-guidelines:not(.filterGuidelines-processed)', context)
+      .addClass('filterGuidelines-processed')
+      .find('label').hide()
+      .parents('.filter-wrapper').find('select.filter-list')
+      .bind('change', function() {
+        $(this).parents('.filter-wrapper')
+        .find('.filter-guidelines-item').hide()
+        .siblings('#filter-guidelines-' + this.value).show();
+      })
+      .change();
+  }
+};
Index: modules/filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.240
diff -u -p -r1.240 filter.module
--- modules/filter/filter.module	21 Jan 2009 16:58:42 -0000	1.240
+++ modules/filter/filter.module	26 Jan 2009 20:55:42 -0000
@@ -60,6 +60,9 @@ function filter_theme() {
     'filter_tips_more_info' => array(
       'arguments' => array(),
     ),
+    'filter_guidelines' => array(
+      'arguments' => array('format' => NULL),
+     ),    
   );
 }
 
@@ -481,58 +484,43 @@ function check_markup($text, $format = F
 function filter_form($value = FILTER_FORMAT_DEFAULT, $weight = NULL, $parents = array('format')) {
   $value = filter_resolve_format($value);
   $formats = filter_formats();
-
-  $extra = theme('filter_tips_more_info');
-
+  
+  $form = array(
+   '#type' => 'fieldset',
+   '#weight' => $weight,
+   '#attributes' => array('class' => 'filter-wrapper'),
+  );
+  
+  $element_id = form_clean_id('edit-' . implode('-', $parents));
+   
   if (count($formats) > 1) {
-    $form = array(
-      '#type' => 'fieldset',
-      '#title' => t('Text format'),
-      '#collapsible' => TRUE,
-      '#collapsed' => TRUE,
-      '#weight' => $weight,
-      '#element_validate' => array('filter_form_validate'),
-    );
-    // Multiple formats available: display radio buttons with tips.
     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;
+      $guidelines[$format->format] = array('#markup' => theme('filter_guidelines', $format));
     }
+    drupal_add_js('misc/form.js');
+    $form['format'] = array(
+      '#type' => 'select',
+      '#title' => t('Formatting'),
+      '#options' => $options,
+      '#default_value' => $value,
+      '#parents' => $parents,
+      '#id' => $element_id,
+      '#attributes' => array('class' => 'filter-list'),
+    );
   }
   else {
-    // Only one format available: use a hidden form item and only show tips.
+    // Only one format available: use a form value and only show label.
     $format = array_shift($formats);
+    unset($format->name);
+    $guidelines = array('#markup' => theme('filter_guidelines', $format));
     $form[$format->format] = array('#type' => 'value', '#value' => $format->format, '#parents' => $parents);
-    $tips = _filter_tips(variable_get('filter_default_format', 1), FALSE);
-    $form['format']['guidelines'] = array(
-      '#title' => t('Formatting guidelines'),
-      '#markup' => theme('filter_tips', $tips, FALSE),
-    );
   }
-  $form[] = array('#markup' => $extra);
+  $form['format_help'] = array('#markup' => '<div id="' . $element_id . '-help" class="filter-help">' . theme('filter_tips_more_info') . '</div>');
+  $form['format_guidelines'] = array_merge($guidelines, array('#prefix' => '<div id="' . $element_id . '-guidelines" class="filter-guidelines">', '#suffix' => '</div>'));
   return $form;
 }
 
-function filter_form_validate($form) {
-  foreach (element_children($form) as $key) {
-    if ($form[$key]['#value'] == $form[$key]['#return_value']) {
-      return;
-    }
-  }
-  form_error($form, t('An illegal choice has been detected. Please contact the site administrator.'));
-  watchdog('form', 'Illegal choice %choice in %name element.', array('%choice' => $form[$key]['#value'], '%name' => empty($form['#title']) ? $form['#parents'][0] : $form['#title']), WATCHDOG_ERROR);
-}
-
 /**
  * Returns TRUE if the user is allowed to access this format.
  */
@@ -590,6 +578,16 @@ function theme_filter_tips_more_info() {
 }
 
 /**
+ * Format guidelines for an input format.
+ *
+ * @ingroup themeable
+ */
+function theme_filter_guidelines($format) {
+  $name = isset($format->name) ? '<label>' . $format->name . ':</label>' : NULL;
+  return '<div id="filter-guidelines-' . $format->format . '" class="filter-guidelines-item">' . $name . theme('filter_tips', _filter_tips($format->format, FALSE)) . '</div>';
+}
+
+/**
  * @name Standard filters
  * @{
  * Filters implemented by the filter.module.
Index: modules/filter/filter.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.test,v
retrieving revision 1.14
diff -u -p -r1.14 filter.test
--- modules/filter/filter.test	26 Jan 2009 14:08:43 -0000	1.14
+++ modules/filter/filter.test	26 Jan 2009 20:55:42 -0000
@@ -101,7 +101,7 @@ class FilterAdminTestCase extends Drupal
     $this->drupalLogin($web_user);
 
     $this->drupalGet('node/add/page');
-    $this->assertFieldByName('body_format', $full, t('Full HTML filter accessible.'));
+    $this->assertRaw('<option value="' . $full .'">Full HTML</option>', t('Full HTML filter accessible.'));
 
     // Use filtered HTML and see if it removes tags that arn't allowed.
     $body = $this->randomName();
Index: modules/node/node.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.css,v
retrieving revision 1.5
diff -u -p -r1.5 node.css
--- modules/node/node.css	25 Jan 2008 21:21:44 -0000	1.5
+++ modules/node/node.css	26 Jan 2009 20:55:42 -0000
@@ -42,3 +42,33 @@ td.revision-current {
 .terms-inline {
   display: inline;
 }
+.filter-label {
+  font-weight: bold;
+}
+
+.filter-wrapper {
+  border-top: 0;
+  width: 95%;
+  padding: 0;
+  margin-top: -1em;
+}
+.filter-guidelines {
+  clear: left;
+  margin: 1.5em;
+}
+.filter-wrapper .form-item {
+  float: left;
+  line-height: 3em;
+  margin: 0 0 0 1.5em;
+}
+.filter-wrapper .form-item label {
+  display: inline;
+}
+.filter-help {
+  float: right;
+  margin-right: 1em;
+}
+.filter-help a {
+  background: url(../../misc/help.png) right center no-repeat;
+  padding-right: 20px;
+}
\ No newline at end of file
