You are here

function theme_radios in Drupal 6

Same name and namespace in other branches
  1. 4 includes/form.inc \theme_radios()
  2. 5 includes/form.inc \theme_radios()
  3. 7 includes/form.inc \theme_radios()

Format a set of radio buttons.

Parameters

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

Return value

A themed HTML string representing the radio button set.

Related topics

File

includes/form.inc, line 1663

Code

function theme_radios($element) {
  $class = 'form-radios';
  if (isset($element['#attributes']['class'])) {
    $class .= ' ' . $element['#attributes']['class'];
  }
  $element['#children'] = '<div class="' . $class . '">' . (!empty($element['#children']) ? $element['#children'] : '') . '</div>';
  if ($element['#title'] || $element['#description']) {
    unset($element['#id']);
    return theme('form_element', $element, $element['#children']);
  }
  else {
    return $element['#children'];
  }
}