--- betterselect.module.original	2009-02-27 16:05:29.000000000 +0100
+++ betterselect.module.txt	2009-08-26 22:50:29.000000000 +0200
@@ -46,6 +46,13 @@ function betterselect_admin_settings() {
     '#description' => t('Only convert select lists on node forms'),
     '#default_value' => variable_get('betterselect_node_form_only', FALSE),
   );
+  
+  $form['betterselect_general']['betterselect_not_on_admin_pages'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Not on admin pages'),
+    '#description' => t('Disable convertion of select lists on admin pages'),
+    '#default_value' => variable_get('betterselect_not_on_admin_pages', FALSE),
+  );
 
   $form['betterselect_taxonomy'] = array(
     '#type' => 'fieldset',
@@ -83,7 +90,14 @@ function betterselect_elements() {
  * Form process callback; translates multiselect fields into checkboxes.
  */
 function betterselect_process($element, $edit, $form_state, $complete_form) {
-  if (isset($element['#multiple']) && $element['#multiple'] == TRUE && !(variable_get('betterselect_node_form_only', FALSE) == TRUE && $complete_form['#id'] != 'node-form')) {
+  if (isset($element['#multiple']) && $element['#multiple'] == TRUE && 
+  		!(variable_get('betterselect_not_on_admin_pages', FALSE) == TRUE && betterselect_is_admin_page(false, $complete_form)) &&
+  		!(variable_get('betterselect_node_form_only', FALSE) == TRUE && $complete_form['#id'] != 'node-form')) {
+
+	// To handle deselection of checkboxes in exposed Views-filters we need this
+  	if ((substr($complete_form['#id'],0,18) == 'views-exposed-form') && isset($element['#value'][0])) {
+  		$element['#value'] = array();
+  	}
 
     // If we're dealing with taxonomy, fix the option titles.
     if (is_object($element['#options'][0])) {
@@ -191,18 +205,68 @@ function betterselect_process($element, 
  * Implementation of hook_form_alter().
  */
 function betterselect_form_alter(&$form, $form_state, $form_id) {
-  // Taxonomy stores its #options in a weird way; we need to move it back once we're done.
-  if (($form['#id'] == 'node-form' && isset($form['taxonomy']))) {
-    $form['#submit'][] = 'betterselect_taxonomy_from_checkboxes';
-  }
-  elseif ($form_id == 'taxonomy_form_term' && !(variable_get('betterselect_node_form_only', FALSE))) {
-    // This is the form that appears on the edit/term/xx page. Betterselect
-    // has to process it before taxonomy module.
-    array_unshift($form['#submit'], 'betterselect_taxonomy_form_term_from_checkboxes');
+  // First make sure we should do any processing at all
+  if(!(variable_get('betterselect_not_on_admin_pages', FALSE) == TRUE && betterselect_is_admin_page($form, false))) {
+
+  	// Add this to handle checkboxes in exposed Views-filters
+  	if (substr($form['#id'],0,18) == 'views-exposed-form') {
+  		$form['#submit'][] = 'betterselect_views_filter_from_checkboxes';
+  	}
+
+  	// Taxonomy stores its #options in a weird way; we need to move it back once we're done.
+  	if (($form['#id'] == 'node-form' && isset($form['taxonomy']))) {
+    	$form['#submit'][] = 'betterselect_taxonomy_from_checkboxes';
+  	} elseif ($form_id == 'taxonomy_form_term' && !(variable_get('betterselect_node_form_only', FALSE))) {
+    	// This is the form that appears on the edit/term/xx page. Betterselect
+    	// has to process it before taxonomy module.
+    	array_unshift($form['#submit'], 'betterselect_taxonomy_form_term_from_checkboxes');
+  	}
   }
 }
 
 /**
+ * Additional submit handler for the views filter form.
+ */
+function betterselect_views_filter_from_checkboxes($form, &$form_state) {
+	// First detect which filters that are tid-filters
+	$tid_filters = array();
+	//print("<pre>");
+  	//			print_r($form['#info']);	
+  	//			print("</pre>");
+	if(is_array($form['#info'])) {
+		foreach ($form['#info'] as $key => $info_data) {
+			$short_key = substr($key,0,10);
+			
+			if ($short_key == "filter-tid" && is_array($info_data) && array_key_exists('value', $info_data)) {
+				$tid_filters[] = $info_data['value'];
+			}
+		}
+	}
+	
+  	// Create an array which is correct!
+  	$new_tid = array();
+  	$i = 0;
+  	$tid_id = "tid";
+	foreach($tid_filters as $tid_filter) {
+  		if (is_array($form_state['values'][$tid_filter]) && !array_key_exists(0, $form_state['values'][$tid_filter])) {
+  			foreach ($form_state['values'][$tid_filter] as $val) {
+  				if($val != 0) {
+  					$new_tid[$val] = $val;
+  				}
+  			}
+  			if($i > 0) {
+  				$tid_id = "tid_".$i;
+  			}
+  			// This is for the of chance that we actually selected something ;)
+  			form_set_value($form[$tid_filter], $new_tid, $form_state);
+  			$form_state['values'][$tid_filter] = $new_tid;
+  			$form_state[view]->filter[$tid_id]->validated_exposed_input = $new_tid;
+  			$i++;
+  		}
+	}
+}
+
+/**
  * Additional submit handler for the taxonomy term form.
  */
 function betterselect_taxonomy_form_term_from_checkboxes($form, &$form_state) {
@@ -243,3 +307,21 @@ function betterselect_taxonomy_from_chec
     }
   }
 }
+
+/**
+ * Check if the current page is an admin-page
+ * NOTE: I'm not sure this is a good way of doing this, but it works for me at the moment...
+ * TODO: Write this in the correct Drupal-way!
+ */
+function betterselect_is_admin_page($form, $complete_form) {
+	if($form != FALSE) {
+		$action_split = split("/", $form['#action'],3);
+	}
+	if($complete_form != FALSE) {
+		$action_split = split("/", $complete_form['#action'],3);
+	}
+	$action_split[] = "extra1";  // Just to make sure we have enough data in the array
+	$action_split[] = "extra2";  // Just to make sure we have enough data in the array
+	return ($action_split[0] == "admin" || $action_split[1] == "admin");		
+	
+}
\ No newline at end of file
