You are here

function theme_select_as_radios in Better Exposed Filters 7.3

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

Themes a select drop-down as a collection of radio buttons.

Parameters

array $vars: An array of arrays, the 'element' item holds the properties of the element.

Return value

string HTML representing the form element.

See also

http://api.drupal.org/api/function/theme_select/7

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 radio buttons enclosed in a collapsible fieldset.

File

./better_exposed_filters.theme, line 289
Provides theming functions to display exposed forms using different interfaces.

Code

function theme_select_as_radios($vars) {
  $element =& $vars['element'];
  if (!empty($element['#bef_nested'])) {
    return theme('select_as_tree', $vars);
  }
  $output = '';
  foreach (element_children($element) as $key) {
    if (isset($element['#bef_term_descriptions'][$key])) {
      $element[$key]['#description'] = $element['#bef_term_descriptions'][$key];
    }
    $element[$key]['#default_value'] = NULL;
    $element[$key]['#children'] = theme('radio', array(
      'element' => $element[$key],
    ));
    $output .= theme('form_element', array(
      'element' => $element[$key],
    ));
  }
  return $output;
}