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.12
diff -u -r1.12 better_exposed_filters_exposed_form_plugin.inc
--- better_exposed_filters_exposed_form_plugin.inc	27 Aug 2010 16:54:15 -0000	1.12
+++ better_exposed_filters_exposed_form_plugin.inc	14 Sep 2010 17:57:38 -0000
@@ -75,10 +75,10 @@
         '#default_value' => $this->options['bef'][$label]['more_options']['bef_select_all_none'],
         '#disabled' => $filter->options['expose']['single'],
         '#description' => t(
-          'Add a "Select All/None" link when rendering the exposed filter using
-            checkboxes. If this option is disabled, edit the filter and uncheck
-            "Force single". NOTE: The link is built at page load, so it will not appear
-            in the "Live Preview" which is loaded dynamically.'
+          'Add a "Select All/None" link for filters that allow multiple selections.
+           If this option is disabled, edit the filter and uncheck "Force single".  
+           NOTE: The link is built at page load, so it will not appear in the "Live 
+           Preview" which is loaded dynamically.'
         ),
       );
 
@@ -126,6 +126,18 @@
         $form[$field_id]['#description'] = $options['more_options']['bef_filter_description'];
       }
         
+      // Add select all/none links for any multi-select filter
+      if (!empty($form[$field_id]['#multiple']) && $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');
+
+        // Add select all/none functionality to this filter.
+        if (!isset($form[$field_id]['#attributes'])) {
+          $form[$field_id]['#attributes'] = array();
+        }
+        $form[$field_id]['#attributes']['class'] .= 'bef-select-all-none';
+      }
+      
       switch ($options['bef_format']) {
         case 'bef':
           if (empty($form[$field_id]['#multiple'])) {
@@ -166,19 +178,6 @@
             // For multi-select boxes, rewrite the HTML at the theme level, since the Forms API handles
             // selects and checkboxes differently.
             $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');
-
-              // Add select all/none functionality to this filter.
-              if (!isset($form[$field_id]['#attributes'])) {
-                $form[$field_id]['#attributes'] = array();
-              }
-              
-              // If the 'class' index doesn't exist, PHP will throw a notice if the error_reporting
-              // level includes E_NOTICE.  Suppress the notice with the '@' operator.
-              @$form[$field_id]['#attributes']['class'] .= 'bef-select-all-none';
-            }
           }
           break;
               
Index: better_exposed_filters.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/better_exposed_filters/better_exposed_filters.module,v
retrieving revision 1.15
diff -u -r1.15 better_exposed_filters.module
--- better_exposed_filters.module	27 Aug 2010 16:54:15 -0000	1.15
+++ better_exposed_filters.module	14 Sep 2010 17:57:38 -0000
@@ -119,6 +119,18 @@
           $form[$field_id]['#description'] = $filter->options['expose']['bef_filter_description'];
         }
 
+        // Add select all/none links for any multi-select filter
+        if (!empty($form[$field_id]['#multiple']) && $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');
+
+          // Add select all/none functionality to this filter.
+          if (!isset($form[$field_id]['#attributes'])) {
+            $form[$field_id]['#attributes'] = array();
+          }
+          $form[$field_id]['#attributes']['class'] .= 'bef-select-all-none';
+        }
+        
         if (isset($filter->options['expose']['bef_format'])) {
           switch ($filter->options['expose']['bef_format']) {
             case 'bef':
@@ -160,19 +172,6 @@
                 // For multi-select boxes, rewrite the HTML at the theme level, since the Forms API handles
                 // selects and checkboxes differently.
                 $form[$field_id]['#theme'] = 'select_as_checkboxes';
-                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');
-
-                  // Add select all/none functionality to this filter.
-                  if (!isset($form[$field_id]['#attributes'])) {
-                    $form[$field_id]['#attributes'] = array();
-                  }
-
-                  // If the 'class' index doesn't exist, PHP will throw a notice if the error_reporting
-                  // level includes E_NOTICE.  Suppress the notice with the '@' operator.
-                  @$form[$field_id]['#attributes']['class'] .= 'bef-select-all-none';
-                }
               }
               break;
 
Index: better_exposed_filters.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/better_exposed_filters/better_exposed_filters.js,v
retrieving revision 1.10
diff -u -r1.10 better_exposed_filters.js
--- better_exposed_filters.js	13 Sep 2010 18:54:37 -0000	1.10
+++ better_exposed_filters.js	14 Sep 2010 17:57:38 -0000
@@ -7,7 +7,7 @@
     
     // Check for selected that already has the select all/none element for pages with outside ajaxy
     // things going on.
-    var selected = $('.form-checkboxes.bef-select-all-none:not(.bef-processed)');
+    var selected = $('.form-checkboxes.bef-select-all-none:not(.bef-processed), .form-select.bef-select-all-none:not(.bef-processed)');
     if (selected.length) {
       var selAll = Drupal.t('Select All');
       var selNone = Drupal.t('Select None');
@@ -15,38 +15,56 @@
       // Set up a prototype link and event handlers
       var link = $('<a class="bef-toggle" href="#">'+ selAll +'</a>')
       link.click(function() {
-        if (selAll == $(this).text()) {
-          // Select all the checkboxes
-          $(this)
-            .html(selNone)
-            .siblings('.bef-checkboxes')
-              .find('.form-item input:checkbox').each(function() {
-                $(this).attr('checked', 'checked');
-              })
-            .end()
+        // Closure variable for use in callbacks
+        var $self = $(this);
 
-            // attr() doesn't trigger a change event, so we do it ourselves. But just on 
-            // one checkbox otherwise we have many spinning cursors
-            .find('input[@type=checkbox]:first').change() 
-          ;
+        // Find all the elements (either select options or checkboxes) that need to be toggled
+        var $elems;
+        
+        // Select or checkboxes
+        var type = $.data(this, 'BEF_type');
+        
+        if ('checkboxes' == type) {
+          $elems = $self.siblings('.bef-checkboxes').find('.form-item input:checkbox');
         }
         else {
-          // Unselect all the checkboxes
-          $(this)
-            .html(selAll)
-            .siblings('.bef-checkboxes')
-              .find('.form-item input:checkbox').each(function() {
-                $(this).attr('checked', '');
-              })
-            .end()
-
-            // attr() doesn't trigger a change event, so we do it ourselves. But just on 
-            // one checkbox otherwise we have many spinning cursors
-            .find('input[@type=checkbox]:first').change() 
-          ;
+          $elems = $self.next().find('.form-select option');
+        }
+        
+        if (selAll == $self.text()) {
+          // Select all the checkboxes/option elements
+          $elems.each(function(index){
+            if ('checkboxes' == type) {
+              $(this).attr('checked', 'checked');
+            }
+            else {
+              $(this).attr('selected', 'selected');
+            }
+          });
+          $self.html(selNone);
+          
+          // attr() doesn't trigger a change event, so we do it ourselves. But just on 
+          // one element otherwise we have many spinning cursors
+          $elems.eq(0).change();
+        }
+        else {
+          // Unselect all the checkboxes/option elements
+          $elems.each(function(index){
+            if ('checkboxes' == type) {
+              $(this).attr('checked', '');
+            }
+            else {
+              $(this).attr('selected', '');
+            }
+          });
+          $self.html(selAll);
+          
+          // attr() doesn't trigger a change event, so we do it ourselves. But just on 
+          // one element otherwise we have many spinning cursors
+          $elems.eq(0).change();
         }
         return false;
-      });
+      });                   // link.click(function()
 
       // Add link to the page for each set of checkboxes.
       selected
@@ -54,14 +72,26 @@
         .each(function(index) {
           // Clone the link prototype and insert into the DOM
           var newLink = link.clone(true);
-          
-          newLink.insertBefore($('.bef-checkboxes', this));
-          
-          // If all checkboxes are already checked by default then switch to Select None
-          if ($('input:checkbox:checked', this).length == $('input:checkbox', this).length) {
-            newLink.click();
+          if ("select-multiple" == this.type) {
+            newLink.data('BEF_type', 'select-multiple');
+            newLink.insertBefore($(this).parent());
+            
+            // If all select options are seleted then switch to Select None
+            if ($('option:selected', this).length == $('option', this).length) {
+              newLink.click();
+            }
+          }
+          else {
+            newLink.data('BEF_type', 'checkboxes');
+            newLink.insertBefore($('.bef-checkboxes', this));
+  
+            // If all checkboxes are already checked by default then switch to Select None
+            if ($('input:checkbox:checked', this).length == $('input:checkbox', this).length) {
+              newLink.click();
+            }
           }
         });
+
     }
   };
 }
