Index: better_exposed_filters.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/better_exposed_filters/better_exposed_filters.js,v
retrieving revision 1.9
diff -u -r1.9 better_exposed_filters.js
--- better_exposed_filters.js	7 Jun 2010 22:56:05 -0000	1.9
+++ better_exposed_filters.js	14 Aug 2010 19:08:12 -0000
@@ -7,43 +7,61 @@
     
     // 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');
+    var selected = $('.form-checkboxes.bef-select-all-none, .form-select.bef-select-all-none');
     if (selected.length) {
       var selAll = Drupal.t('Select All');
       var selNone = Drupal.t('Select None');
-      
+
       // 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()
-
-            // 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() 
-          ;
+        // Closure variable for use in callbacks
+        var $self = $(this);
+
+        // 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 {
+          $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');
+            }
+          });
+          $(this).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
-          $(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.each(function(index) {
+            if ('checkboxes' == type) {
+              $(this).attr('checked', '');  
+            }
+            else {
+              $(this).attr('selected', '');
+            }
+          });
+          $(this).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;
       });
@@ -52,11 +70,23 @@
       selected.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();
+          }
         }
       });
     }
Index: better_exposed_filters.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/better_exposed_filters/better_exposed_filters.module,v
retrieving revision 1.13
diff -u -r1.13 better_exposed_filters.module
--- better_exposed_filters.module	4 Aug 2010 18:38:47 -0000	1.13
+++ better_exposed_filters.module	14 Aug 2010 19:08:12 -0000
@@ -86,9 +86,8 @@
       '#title' => t('Add select all/none links'),
       '#default_value' => $curr['allnone'],
       '#description' => t(
-        'Add a "Select All/None" link when rendering the exposed filter using
-         checkboxes. 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 NOTE: The link is built at page load,
+         so it will not appear in the "Live Preview" which is loaded dynamically.'
       ),
     );
 
@@ -118,6 +117,19 @@
         if (isset($filter->options['expose']['bef_filter_description'])) {
           $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']) {
@@ -147,19 +159,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;
 
