function theme_select_as_radios in Better Exposed Filters 6.3
Same name and namespace in other branches
- 6 better_exposed_filters.theme \theme_select_as_radios()
- 6.2 better_exposed_filters.theme \theme_select_as_radios()
- 7.3 better_exposed_filters.theme \theme_select_as_radios()
- 7 better_exposed_filters.theme \theme_select_as_radios()
Themes a select drop-down as a collection of radio buttons
Parameters
object $element - An associative array containing the properties of the element.: Properties used: return_value, value, attributes, title, description
Return value
HTML string representing the form element.
See also
theme_select(), http://api.drupal.org/api/function/theme_select/6
1 string reference to 'theme_select_as_radios'
- better_exposed_filters_theme in ./
better_exposed_filters.module - Implements hook_theme()
1 theme call to theme_select_as_radios()
- theme_select_as_radios_fieldset in ./
better_exposed_filters.theme - Themes a select element as a collection of radio buttons enclosed in a collapsible fieldset
File
- ./
better_exposed_filters.theme, line 184
Code
function theme_select_as_radios($element) {
if (!empty($element['#termcount'])) {
// Add term counts to labels
foreach (element_children($element) as $key) {
$count = taxonomy_term_count_nodes($element[$key]['#return_value']);
if ($count) {
$element[$key]['#title'] .= " ({$count})";
}
}
}
if (!empty($element['#bef_nested'])) {
return theme('select_as_tree', $element);
}
$output = '';
foreach (element_children($element) as $key) {
$output .= theme('radio', $element[$key]);
}
return '<div class="bef-select-as-radios">' . $output . '</div>';
}