Index: better_exposed_filters.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/better_exposed_filters/better_exposed_filters.info,v
retrieving revision 1.1
diff -u -r1.1 better_exposed_filters.info
--- better_exposed_filters.info	22 Dec 2009 03:59:52 -0000	1.1
+++ better_exposed_filters.info	11 Feb 2011 02:03:37 -0000
@@ -1,6 +1,10 @@
 ; $Id: better_exposed_filters.info,v 1.1 2009/12/22 03:59:52 mikeker Exp $
 name = Better Exposed Filters
 description = Allow the use of checkboxes or radio buttons for exposed Views filters 
-core = 6.x
+core = 7.x
 package = Views
-dependencies[] = views
\ No newline at end of file
+dependencies[] = views
+files[] = better_exposed_filters.module
+files[] = better_exposed_filters.views.inc
+files[] = better_exposed_filters_exposed_form_plugin.inc
+files[] = tests/better_exposed_filters.test
Index: better_exposed_filters.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/better_exposed_filters/better_exposed_filters.module,v
retrieving revision 1.20
diff -u -r1.20 better_exposed_filters.module
--- better_exposed_filters.module	13 Dec 2010 06:10:45 -0000	1.20
+++ better_exposed_filters.module	11 Feb 2011 02:03:38 -0000
@@ -10,7 +10,7 @@
 
 
 /**
- * Implements hook_form_alter()
+ * Implements hook_form_alter().
  */
 function better_exposed_filters_form_alter(&$form, $form_state, $form_id) {
 
@@ -106,7 +106,7 @@
         'Puts this filter in a collapsible fieldset'
       ),
     );
-  
+
     // Insert BEF form elements into the exposed filter form
     $expose = $form['options']['expose'];
     $first_chunk = array_splice($expose, 0, array_search('end_left', array_keys($expose)));
@@ -116,7 +116,7 @@
     $first_chunk = array_splice($expose, 0, array_search('end_checkboxes', array_keys($expose)));
     $form['options']['expose'] = array_merge($first_chunk, $right, $expose);
 
-  }     // if ('views_ui_config_item_form' ...) {
+  } // if ('views_ui_config_item_form' ...) {
 
   /*
    * Update exposed filters to show either checkboxes or radio buttons
@@ -139,13 +139,13 @@
             case 'bef_ul':
               $form[$field_id]['#bef_nested'] = TRUE;
               // Intentionally falling through
-              
+
             case 'bef':
               if (empty($form[$field_id]['#multiple'])) {
                 // Single-select -- display as radio buttons
                 $form[$field_id]['#type'] = 'radios';
                 $form[$field_id]['#process'] = array('expand_radios', 'views_process_dependency');
-                
+
                 // Clean up objects from the options array (happens for taxonomy-based filters)
                 $options = $form[$field_id]['#options'];
                 $form[$field_id]['#options'] = array();
@@ -171,20 +171,20 @@
                     $form[$field_id]['#options']['All'] = check_plain($form[$field_id]['#options']['All']);
                   }
                 }
-                
+
                 // Render as radio buttons or radio buttons in a collapsible fieldset
                 if (!empty($filter->options['expose']['bef_collapsible'])) {
                   // Use the option label for the title of the fieldset
                   $form[$field_id]['#title'] = $form['#info']["filter-$field_id"]['label'];
                   unset($form['#info']["filter-$field_id"]['label']);
-                  
+
                   // Pass the description and title along in a way such that it doesn't get rendered as part of
                   // the exposed form widget.  We'll render them as part of the fieldset.
                   $form[$field_id]['#bef_description'] = $form[$field_id]['#description'];
                   unset($form[$field_id]['#description']);
                   $form[$field_id]['#bef_title'] = $form[$field_id]['#title'];
                   unset($form[$field_id]['#title']);
-                  
+
                   // Take care of adding the fieldset in the theme layer
                   $form[$field_id]['#theme'] = 'select_as_radios_fieldset';
                 }
@@ -192,14 +192,14 @@
                   // Render select element as radio buttons
                   $form[$field_id]['#theme'] = 'select_as_radios';
                 }
-              }         // if (empty($form[$field_id]['#multiple'])) {
+              } // if (empty($form[$field_id]['#multiple'])) {
               else {
                 // Render as checkboxes or checkboxes enclosed in a collapsible fieldset
                 if (!empty($filter->options['expose']['bef_collapsible'])) {
                   // Use exposed filter widget label as legend for this fieldset
                   $form[$field_id]['#title'] = $form['#info']["filter-$field_id"]['label'];
                   unset($form['#info']["filter-$field_id"]['label']);
-                  
+
                   $form[$field_id]['#theme'] = 'select_as_checkboxes_fieldset';
                 }
                 else {
@@ -208,7 +208,7 @@
 
                 if ($filter->options['expose']['bef_select_all_none']) {
                   // Add BEF's JavaScript to the mix to handle select all/none functionality
-                  drupal_add_js(drupal_get_path('module', 'better_exposed_filters') .'/better_exposed_filters.js');
+                  drupal_add_js(drupal_get_path('module', 'better_exposed_filters') . '/better_exposed_filters.js');
 
                   // Add select all/none functionality to this filter.
                   if (!isset($form[$field_id]['#attributes'])) {
@@ -219,11 +219,11 @@
                   // level includes E_NOTICE.  Suppress the notice with the '@' operator.
                   @$form[$field_id]['#attributes']['class'] .= 'bef-select-all-none';
                 }
-              }         // if (empty($form[$field_id]['#multiple'])) { ... } else {
+              } // if (empty($form[$field_id]['#multiple'])) { ... } else {
               break;
 
             case 'bef_hidden':
-              $form['#info']["filter-$field_id"]['label'] = '';     // Hide the label
+              $form['#info']["filter-$field_id"]['label'] = ''; // Hide the label
               if (empty($form[$field_id]['#multiple'])) {
                 $form[$field_id]['#type'] = 'hidden';
               }
@@ -232,31 +232,52 @@
               }
               break;
           } // switch
-        }   // if (isset($filter->options['expose']['bef_format'])) {
-      }     // if ($filter->options['exposed']) {
-    }       // foreach (...)
-  }         // if ('views_exposed_form' == $form_id)
+        } // if (isset($filter->options['expose']['bef_format'])) {
+      } // if ($filter->options['exposed']) {
+    } // foreach (...)
+  } // if ('views_exposed_form' == $form_id)
 }
 
 /**
- * Implements hook_theme()
+ * Implements hook_theme().
  */
 function better_exposed_filters_theme($existing, $type, $theme, $path) {
   return array(
-    'select_as_checkboxes'          => array('function' => 'theme_select_as_checkboxes',
-                                             'file' => 'better_exposed_filters.theme'),
-    'select_as_checkboxes_fieldset' => array('function' => 'theme_select_as_checkboxes_fieldset',
-                                             'file' => 'better_exposed_filters.theme'),
-    'select_as_radios'              => array('function' => 'theme_select_as_radios',
-                                             'file' => 'better_exposed_filters.theme'),
-    'select_as_radios_fieldset'     => array('function' => 'theme_select_as_radios_fieldset',
-                                             'file' => 'better_exposed_filters.theme'),
-    'select_as_hidden'              => array('function' => 'theme_select_as_hidden',
-                                             'file' => 'better_exposed_filters.theme'),
-    'select_as_tree'                => array('function' => 'theme_select_as_tree',
-                                             'file' => 'better_exposed_filters.theme'),
-    'select_as_links'               => array('function' => 'theme_select_as_links',
-                                             'file' => 'better_exposed_filters.theme'),
+    'select_as_checkboxes' => array(
+      'function' => 'theme_select_as_checkboxes',
+      'render element' => 'element',
+      'file' => 'better_exposed_filters.theme',
+    ),
+    'select_as_checkboxes_fieldset' => array(
+      'function' => 'theme_select_as_checkboxes_fieldset',
+      'render element' => 'element',
+      'file' => 'better_exposed_filters.theme',
+    ),
+    'select_as_radios' => array(
+      'function' => 'theme_select_as_radios',
+      'render element' => 'element',
+      'file' => 'better_exposed_filters.theme',
+    ),
+    'select_as_radios_fieldset' => array(
+      'function' => 'theme_select_as_radios_fieldset',
+      'render element' => 'element',
+      'file' => 'better_exposed_filters.theme',
+    ),
+    'select_as_hidden' => array(
+      'function' => 'theme_select_as_hidden',
+      'render element' => 'element',
+      'file' => 'better_exposed_filters.theme',
+    ),
+    'select_as_tree' => array(
+      'function' => 'theme_select_as_tree',
+      'render element' => 'element',
+      'file' => 'better_exposed_filters.theme',
+    ),
+    'select_as_links' => array(
+      'function' => 'theme_select_as_links',
+      'render element' => 'element',
+      'file' => 'better_exposed_filters.theme',
+    ),
   );
 }
 
@@ -270,7 +291,7 @@
  */
 
 /**
- * Implements hook_views_api()
+ * Implements hook_views_api().
  */
 function better_exposed_filters_views_api() {
   return array(
@@ -287,7 +308,7 @@
     list($form_state['values']['sort_by'], $form_state['values']['sort_order']) =
         explode(' ', $form_state['values']['sort_bef_combine']);
   }
-  
+
   // And pass this along to Views
   views_exposed_form_submit($form, $form_state);
 }
Index: better_exposed_filters.theme
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/better_exposed_filters/better_exposed_filters.theme,v
retrieving revision 1.7
diff -u -r1.7 better_exposed_filters.theme
--- better_exposed_filters.theme	25 Dec 2010 00:33:16 -0000	1.7
+++ better_exposed_filters.theme	11 Feb 2011 02:03:39 -0000
@@ -8,7 +8,8 @@
  *                         Properties used: title, value, options, description
  * @return HTML string representing the form element.
  */
-function theme_select_as_checkboxes_fieldset($element) {
+function theme_select_as_checkboxes_fieldset($variables) {
+  $element =& $variables['element'];
   $fieldset = array(
     '#title' => $element['#title'],
     '#collapsible' => TRUE,
@@ -21,7 +22,7 @@
   unset($element['#description']);
   
   $fieldset['#children'] = theme('select_as_checkboxes', $element);
-  return theme('fieldset', $fieldset);
+  return theme('fieldset', array('element' => $fieldset));
 }
 
 /**
@@ -32,13 +33,14 @@
  *                         Properties used: title, value, options, description
  * @return HTML string representing the form element.
  */
-function theme_select_as_checkboxes($element) {
+function theme_select_as_checkboxes(&$variables) {
+  $element =& $variables['element'];
   if (!empty($element['#bef_nested'])) {
-    return theme('select_as_tree', $element);
+    return theme('select_as_tree', array('element' => $element));
   }
   
   // the selected keys from #options
-  $selected_options = !empty($element['#post'][$element['#name']]) ? (array)$element['#post'][$element['#name']] : $element['#default_value'];
+  $selected_options = !empty($element['#post'][$element['#name']]) ? (array)$element['#post'][$element['#name']] : ($element['#default_value'] ? $element['#default_value'] : $element['#value']);
   
   $output = '<div class="bef-checkboxes">';
   foreach ($element['#options'] as $option => $elem) {
@@ -103,7 +105,8 @@
  *                          Properties used: title, value, options, description
  * @return HTML string representing the form element.
  */
-function theme_select_as_hidden($element) {
+function theme_select_as_hidden($variables) {
+  $element =& $variables['element'];
   $output = '';
   $selected_options = (array)$element['#post'][$element['#name']];   // the selected keys from #options
   $properties = array(
@@ -143,7 +146,7 @@
           . 'id="'. $id .'" '
           . 'value="'. check_plain($key) .'" '
           . drupal_attributes($element['#attributes']) .' />';
-        $output .= theme('form_element', array_merge($properties, array('#id' => $id)), $hidden);
+        $output .= theme('form_element', array('element' => array_merge($properties, array('#id' => $id, '#children' => $hidden))));
       }
     }
   }
@@ -157,7 +160,9 @@
  *                         Properties used: title, value, options, description
  * @return HTML string representing the form element.
  */
-function theme_select_as_radios_fieldset($element) {
+function theme_select_as_radios_fieldset($variables) {
+  $element =& $variables['element'];
+  
   // The "all" option is the first in the list. If the selected radio button is the all
   // option, then leave the fieldset collapsed.  Otherwise, render it opened.
   $all = array_shift(array_keys($element['#options']));
@@ -170,7 +175,7 @@
     '#attribute' => array('class' => 'bef-select-as-radios-fieldset'),
   );
   $fieldset['#children'] = theme('select_as_radios', $element);
-  return theme('fieldset', $fieldset);
+  return theme('fieldset', array('element' => $fieldset));
 }
 
 /**
@@ -182,13 +187,14 @@
  * @return HTML string representing the form element.
  */
 function theme_select_as_radios($element) {
+  $element =& $variables['element'];
   if (!empty($element['#bef_nested'])) {
     return theme('select_as_tree', $element);
   }
   
   $output = '';
   foreach (element_children($element) as $key) {
-    $output .= theme('radio', $element[$key]);
+    $output .= theme('radio', array('element' => $element[$key]));
   }
   return '<div class="bef-select-as-radios">'. $output .'</div>';
 }
@@ -200,7 +206,9 @@
  * @param $element
  * @return HTML
  */
-function theme_select_as_tree($element) {
+function theme_select_as_tree($variables) {
+  $element =& $variables['element'];
+  
   // The selected keys from #options
   $selected_options = (array)$element['#post'][$element['#name']];
 
@@ -237,7 +245,7 @@
         );
       }
       else {
-        $html = theme('radio', $element[$option_value]);
+        $html = theme('radio', array('element' => $element[$option_value]));
       }
       
       if ($depth > $curr_depth) {
@@ -295,7 +303,8 @@
  *                          Properties used: title, value, options, description, name
  * @return HTML string representing the form element.
  */
-function theme_select_as_links($element) {
+function theme_select_as_links($variables) {
+  $element =& $variables['element'];
   $output = '';
   $name = $element['#name'];
   $selected_options = (array)$element['#post'][$name];   // the selected keys from #options
@@ -329,11 +338,11 @@
       $id = form_clean_id($element['#id'] . '-' . $key);
       if (array_search($key, $selected_options) === FALSE) {
         $link = l($value, bef_replace_query_string_arg($name, $key, $multiple));
-        $output .= theme('form_element', array('#id' => $id), $link);
+        $output .= theme('form_element', array('element' => array('#id' => $id, '#children' => $link)));
       } else {
         // Selected value is output without a link
         // TODO: Does that look funny in the display?  Should add a "current" class to this elem?
-        $output .= theme('form_element', array('#id' => $id), $value);
+        $output .= theme('form_element', array('element' => array('#id' => $id, '#children' => $value)));
       }
     }
   }
@@ -341,10 +350,11 @@
   $properties = array(
     '#title' => $element['#title'],
     '#description' => $element['#description'],
+    '#children' => $output,
   );
   
   return '<div class="bef-select-as-links">'
-    . theme('form_element', $properties, $output)
+    . theme('form_element', array('element' => $properties))
     . '</div>';
 }
 
@@ -366,7 +376,7 @@
 function bef_checkbox($element, $value, $label, $selected) {
   $value = check_plain($value);
   $label = check_plain($label);
-  $id = form_clean_id($element['#id'] . '-' . $value);
+  $id = drupal_html_id($element['#id'] . '-' . $value);
   // Custom ID for each checkbox based on the <select>'s original ID
   $properties = array(
     '#required' => FALSE,
@@ -380,7 +390,8 @@
     . ($selected ? 'checked="checked" ' : '')
     . drupal_attributes($element['#attributes']) .' />';
   $item = "$checkbox <label class='option' for='$id'>$label</label>";
-  $output .= theme('form_element', $properties, $item);
+  $properties['#children'] = $item;
+  $output = theme('form_element', array('element' => $properties));
   return $output;
 }
 
Index: better_exposed_filters.views.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/better_exposed_filters/better_exposed_filters.views.inc,v
retrieving revision 1.2
diff -u -r1.2 better_exposed_filters.views.inc
--- better_exposed_filters.views.inc	15 Feb 2010 01:13:05 -0000	1.2
+++ better_exposed_filters.views.inc	11 Feb 2011 02:03:39 -0000
@@ -3,17 +3,17 @@
 
 /**
  * @file better_exposed_filters.views.inc
- * 
+ *
  * Adds Views3 support
- * 
+ *
  * Views3 adds the concept of exposed forms to the mix.  In addition, elements injected into a Views
  * dialog is no longer saved along with the Views form information (see the unpack_options() and
- * options_definition() methods of the views_object object). 
+ * options_definition() methods of the views_object object).
  *
  */
 
 /**
- * Implementation of hook_views_plugins()
+ * Implements hook_views_plugins().
  */
 function better_exposed_filters_views_plugins() {
   return array(
Index: better_exposed_filters_exposed_form_plugin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/better_exposed_filters/better_exposed_filters_exposed_form_plugin.inc,v
retrieving revision 1.17
diff -u -r1.17 better_exposed_filters_exposed_form_plugin.inc
--- better_exposed_filters_exposed_form_plugin.inc	13 Dec 2010 06:10:45 -0000	1.17
+++ better_exposed_filters_exposed_form_plugin.inc	11 Feb 2011 02:03:39 -0000
@@ -87,12 +87,12 @@
         '#description' => t('Select a format for the exposed pager options.'),
       );
     }
-    
+
     /*
      * Changes to the options form need to be mirrored in hook_form_alter in
      * better_exposed_filters.module to maintain Views 2.x support
      */
-    
+
     // Go through each filter and add the same options we used to add in hook_form_alter()
     foreach ($this->display->handler->get_handlers('filter') as $label => $filter) {
       if (!$filter->options['exposed']) {
@@ -127,11 +127,11 @@
            unchecked, checkboxes will be used.'
         ),
       );
-      
+
       // Link option is available if "Force single" is selected
-//      if ($filter->options['expose']['single']) {
-//
-//      }
+      //      if ($filter->options['expose']['single']) {
+      //
+      //      }
 
       // Fieldset to keep the UI from getting out of hand
       $bef_options[$label]['more_options'] = array(
@@ -154,7 +154,7 @@
             in the "Live Preview" which is loaded dynamically.'
         ),
       );
-      
+
       // Put filter in collapsible fieldset option
       $bef_options[$label]['more_options']['bef_collapsible'] = array(
         '#type' => 'checkbox',
@@ -164,7 +164,7 @@
           'Puts this filter in a collapsible fieldset'
         ),
       );
-      
+
       // Build a description option form element
       $bef_options[$label]['more_options']['bef_filter_description'] = array(
         '#type' => 'textarea',
@@ -173,7 +173,7 @@
         '#description' => t('Adds descriptive text to the exposed filter.  This is usually
                               rendered in smaller print under the label or the options.'),
       );
-    }             // foreach ($filters as $filter) {
+    } // foreach ($filters as $filter) {
 
     // Add BEF form elements to the exposed form options form
     $form['bef'] = $bef_options;
@@ -184,7 +184,7 @@
    */
   function exposed_form_alter(&$form, &$form_state) {
     parent::exposed_form_alter($form, $form_state);
-    
+
     /*
      * Handle exposed sort elements
      */
@@ -199,7 +199,7 @@
         if ($this->options['bef']['sort']['reset']) {
           $options[' '] = t($this->options['bef']['sort']['reset_label']);
         }
-        
+
         $selected = '';
         foreach ($form['sort_by']['#options'] as $by_key => $by_val) {
           foreach ($form['sort_order']['#options'] as $order_key => $order_val) {
@@ -207,37 +207,37 @@
             $options["$by_key $order_key"] = "$by_val $order_val";
           }
         }
-        
+
         $form['sort_bef_combine'] = array(
           '#type' => 'radios',
           '#options' => $options,
           '#title' => $form['sort_by']['#title'],
         );
-        
+
         // Handle display-specific details
         switch ($this->options['bef']['sort']['bef_format']) {
           case 'bef':
             $form['sort_bef_combine']['#prefix'] = '<div class="bef-sort-combined bef-select-as-radios">';
             $form['sort_bef_combine']['#suffix'] = '</div>';
             break;
-            
+
           case 'bef_links':
             $form['sort_bef_combine']['#theme'] = 'select_as_links';
             unset($form['sort_bef_combine']['#title']);
             break;
-            
+
           case 'default':
             $form['sort_bef_combine']['#type'] = 'select';
             break;
         }
-        
+
         // Add our submit routine to process
         $form['#submit'][] = 'bef_sort_combine_submit';
 
         // Remove the existing sort_by and sort_order elements
         unset($form['sort_by']);
         unset($form['sort_order']);
-      }                 // if ($this->options['bef']['sort']['combine']) {
+      } // if ($this->options['bef']['sort']['combine']) {
       else {
         // Leave sort_by and sort_order as separate elements
         if ('bef' == $this->options['bef']['sort']['bef_format']) {
@@ -260,38 +260,38 @@
         if ($this->options['bef']['sort']['reset']) {
           array_unshift($form['sort_by']['#options'], $this->options['bef']['sort']['reset_label']);
         }
-      }                 // if ($this->options['bef']['sort']['combine']) { ... } else {
-    }                   // if (isset($this->options['bef']['sort'])) {
+      } // if ($this->options['bef']['sort']['combine']) { ... } else {
+    } // if (isset($this->options['bef']['sort'])) {
 
     /*
      * Handle exposed pager elements
      */
     if (isset($this->options['bef']['pager'])) {
-      switch($this->options['bef']['pager']['bef_format']) {
+      switch ($this->options['bef']['pager']['bef_format']) {
         case 'bef':
           $form['items_per_page']['#type'] = 'radios';
           $form['items_per_page']['#process'] = array('expand_radios', 'views_process_dependency');
           $form['items_per_page']['#prefix'] = '<div class="bef-sortby bef-select-as-radios">';
           $form['items_per_page']['#suffix'] = '</div>';
           break;
-          
+
         case 'bef_links':
           if (count($form['items_per_page']['#options']) > 1) {
             $form['items_per_page']['#theme'] = 'select_as_links';
             $form['items_per_page']['#items_per_page'] = max($form['items_per_page']['#default_value'], key($form['items_per_page']['#options']));
           }
-        break;
+          break;
       }
     }
-    
+
     /*
      * Changes to the display of BEF filters need to be mirrored in hook_form_alter in
      * better_exposed_filters.module to maintain Views 2.x support
      */
-    
+
     // Shorthand for all filters in this view
     $filters = $form_state['view']->display_handler->handlers['filter'];
-    
+
     // Go through each saved option looking for Better Exposed Filter settings
     foreach ($this->options['bef'] as $label => $options) {
 
@@ -299,7 +299,7 @@
       if (empty($filters[$label]) || !$filters[$label]->options['exposed']) {
         continue;
       }
-      
+
       // Form element is designated by the element ID which is user-configurable
       $field_id = $form['#info']["filter-$label"]['value'];
 
@@ -307,22 +307,22 @@
       if (!empty($options['more_options']['bef_filter_description'])) {
         $form[$field_id]['#description'] = $options['more_options']['bef_filter_description'];
       }
-      
+
       switch ($options['bef_format']) {
         case 'bef_links':
           $form[$field_id]['#theme'] = 'select_as_links';
           break;
-          
+
         case 'bef_ul':
           $form[$field_id]['#bef_nested'] = TRUE;
           // Intentionally falling through to case 'bef':
-          
+
         case 'bef':
           if (empty($form[$field_id]['#multiple'])) {
             // Single-select -- display as radio buttons
             $form[$field_id]['#type'] = 'radios';
             $form[$field_id]['#process'] = array('expand_radios', 'views_process_dependency');
-        
+
             // Clean up objects from the options array (happens for taxonomy-based filters)
             $opts = $form[$field_id]['#options'];
             $form[$field_id]['#options'] = array();
@@ -348,20 +348,20 @@
                 $form[$field_id]['#options']['All'] = check_plain($form[$field_id]['#options']['All']);
               }
             }
-          
+
             // Render as radio buttons or radio buttons in a collapsible fieldset
             if (!empty($options['more_options']['bef_collapsible'])) {
               // Use the option label for the title of the fieldset
               $form[$field_id]['#title'] = $form['#info']["filter-$label"]['label'];
               unset($form['#info']["filter-$label"]['label']);
-              
+
               // Pass the description and title along in a way such that it doesn't get rendered as part of
               // the exposed form widget.  We'll render them as part of the fieldset.
               $form[$field_id]['#bef_description'] = $form[$field_id]['#description'];
               unset($form[$field_id]['#description']);
               $form[$field_id]['#bef_title'] = $form[$field_id]['#title'];
               unset($form[$field_id]['#title']);
-              
+
               // Take care of adding the fieldset in the theme layer
               $form[$field_id]['#theme'] = 'select_as_radios_fieldset';
             }
@@ -369,23 +369,23 @@
               // Render select element as radio buttons
               $form[$field_id]['#theme'] = 'select_as_radios';
             }
-          }           // if (empty($form[$field_id]['#multiple'])) {
+          } // if (empty($form[$field_id]['#multiple'])) {
           else {
             // Render as checkboxes or checkboxes enclosed in a collapsible fieldset
             if (!empty($options['more_options']['bef_collapsible'])) {
               // Use exposed filter widget label as legend for this fieldset
               $form[$field_id]['#title'] = $form['#info']["filter-$label"]['label'];
               unset($form['#info']["filter-$label"]['label']);
-              
+
               $form[$field_id]['#theme'] = 'select_as_checkboxes_fieldset';
             }
             else {
               $form[$field_id]['#theme'] = 'select_as_checkboxes';
             }
-            
+
             if ($options['more_options']['bef_select_all_none']) {
               // Add BEF's JavaScript to the mix to handle select all/none functionality
-              drupal_add_js(drupal_get_path('module', 'better_exposed_filters') .'/better_exposed_filters.js');
+              drupal_add_js(drupal_get_path('module', 'better_exposed_filters') . '/better_exposed_filters.js');
 
               // Add select all/none functionality to this filter.
               if (!isset($form[$field_id]['#attributes']['class'])) {
@@ -393,11 +393,11 @@
               }
               $form[$field_id]['#attributes']['class'] .= 'bef-select-all-none';
             }
-          }           // if (empty($form[$field_id]['#multiple'])) { ... } else {
-          break;      // case 'bef':
-              
+          } // if (empty($form[$field_id]['#multiple'])) { ... } else {
+          break; // case 'bef':
+
         case 'bef_hidden':
-          $form['#info']["filter-$field_id"]['label'] = '';     // Hide the label
+          $form['#info']["filter-$field_id"]['label'] = ''; // Hide the label
           if (empty($form[$field_id]['#multiple'])) {
             $form[$field_id]['#type'] = 'hidden';
           }
@@ -406,7 +406,7 @@
           }
           break;
 
-      }     // switch ($options['bef_format'])
-    }       // foreach ($this->options['bef']...)
-  }         // function exposed_form_alter(...)
-}
\ No newline at end of file
+      } // switch ($options['bef_format'])
+    } // foreach ($this->options['bef']...)
+  } // function exposed_form_alter(...)
+}
