You are here

function theme_select_as_radios_fieldset in Better Exposed Filters 6

Same name and namespace in other branches
  1. 6.3 better_exposed_filters.theme \theme_select_as_radios_fieldset()
  2. 6.2 better_exposed_filters.theme \theme_select_as_radios_fieldset()
  3. 7.3 better_exposed_filters.theme \theme_select_as_radios_fieldset()
  4. 7 better_exposed_filters.theme \theme_select_as_radios_fieldset()

Themes a select element as a collection of radio buttons enclosed in a collapsible fieldset

Parameters

array $element - An associative array containing the properties of the element.: Properties used: title, value, options, description

Return value

HTML string representing the form element.

1 string reference to 'theme_select_as_radios_fieldset'
better_exposed_filters_theme in ./better_exposed_filters.module
Implements hook_theme()

File

./better_exposed_filters.theme, line 159

Code

function theme_select_as_radios_fieldset($element) {

  // The "all" option is the first in the list. If the selected radio button is the all
  // option, then leave the fieldset collapsed.  Otherwise, render it opened.
  $all = array_shift(array_keys($element['#options']));
  $fieldset = array(
    '#title' => $element['#bef_title'],
    '#collapsible' => TRUE,
    '#description' => $element['#bef_description'],
    '#collapsed' => $element[$all]['#value'] == $all,
    '#attribute' => array(
      'class' => 'bef-select-as-radios-fieldset',
    ),
  );
  $fieldset['#children'] = theme('select_as_radios', $element);
  return theme('fieldset', $fieldset);
}