theme_checkboxes

Versions
5 – 6
theme_checkboxes($element)
7
theme_checkboxes($variables)

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

Code

drupal/includes/form.inc, line 2621

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

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.