better_exposed_filters.module in Better Exposed Filters 6.3
Allows the use of checkboxes, radio buttons or hidden fields for exposed Views filters.
Thanks to Ben Buckman (http://echodittolabs.org/) for the original concept.
File
better_exposed_filters.moduleView source
<?php
/**
* @file
* Allows the use of checkboxes, radio buttons or hidden fields for exposed Views filters.
*
* Thanks to Ben Buckman (http://echodittolabs.org/) for the original concept.
*/
/**
* Implements hook_theme()
*/
function better_exposed_filters_theme($existing, $type, $theme, $path) {
return array(
'select_as_checkboxes' => array(
'function' => 'theme_select_as_checkboxes',
'arguments' => array(
'element' => NULL,
),
'file' => 'better_exposed_filters.theme',
),
'select_as_checkboxes_fieldset' => array(
'function' => 'theme_select_as_checkboxes_fieldset',
'arguments' => array(
'element' => NULL,
),
'file' => 'better_exposed_filters.theme',
),
'select_as_radios' => array(
'function' => 'theme_select_as_radios',
'arguments' => array(
'element' => NULL,
),
'file' => 'better_exposed_filters.theme',
),
'select_as_radios_fieldset' => array(
'function' => 'theme_select_as_radios_fieldset',
'arguments' => array(
'element' => NULL,
),
'file' => 'better_exposed_filters.theme',
),
'select_as_single_checkbox' => array(
'function' => 'theme_select_as_single_checkbox',
'arguments' => array(
'element' => NULL,
),
'file' => 'better_exposed_filters.theme',
),
'select_as_hidden' => array(
'function' => 'theme_select_as_hidden',
'arguments' => array(
'element' => NULL,
),
'file' => 'better_exposed_filters.theme',
),
'select_as_tree' => array(
'function' => 'theme_select_as_tree',
'arguments' => array(
'element' => NULL,
),
'file' => 'better_exposed_filters.theme',
),
'select_as_links' => array(
'function' => 'theme_select_as_links',
'arguments' => array(
'element' => NULL,
),
'file' => 'better_exposed_filters.theme',
),
);
}
/**
* Implements hook_views_api()
*/
function better_exposed_filters_views_api() {
return array(
'api' => 3.0,
);
}
/**
* Helper function for combining exposed sort criteria and direction
*/
function bef_sort_combine_submit($form, &$form_state) {
// Unpack sort_by and sort_order from the sort_bef_combine element
if (empty($form_state['values']['sort_bef_combine'])) {
$form_state['values']['sort_by'] = $form_state['values']['sort_order'] = '';
}
else {
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);
}
Functions
Name![]() |
Description |
---|---|
bef_sort_combine_submit | Helper function for combining exposed sort criteria and direction |
better_exposed_filters_theme | Implements hook_theme() |
better_exposed_filters_views_api | Implements hook_views_api() |