Same name and namespace in other branches
  1. 4.7.x includes/form.inc \theme_checkboxes()
  2. 5.x includes/form.inc \theme_checkboxes()
  3. 6.x includes/form.inc \theme_checkboxes()

Returns HTML for a set of checkbox form elements.

Parameters

$variables: An associative array containing:

  • element: An associative array containing the properties of the element. Properties used: #children, #attributes.

Related topics

File

includes/form.inc, line 3262
Functions for form and batch generation and processing.

Code

function theme_checkboxes($variables) {
  $element = $variables['element'];
  $attributes = array();
  if (isset($element['#id'])) {
    $attributes['id'] = $element['#id'];
  }
  $attributes['class'][] = 'form-checkboxes';
  if (!empty($element['#attributes']['class'])) {
    $attributes['class'] = array_merge($attributes['class'], $element['#attributes']['class']);
  }
  if (isset($element['#attributes']['title'])) {
    $attributes['title'] = $element['#attributes']['title'];
  }
  return '<div' . drupal_attributes($attributes) . '>' . (!empty($element['#children']) ? $element['#children'] : '') . '</div>';
}