diff options
author | Kjartan Mannes <kjartan@2.no-reply.drupal.org> | 2004-06-04 18:10:05 +0000 |
---|---|---|
committer | Kjartan Mannes <kjartan@2.no-reply.drupal.org> | 2004-06-04 18:10:05 +0000 |
commit | 7cd54567bdebc9fe25f778982fb6319b966265ec (patch) | |
tree | b2524f2d3b58c37c162295e093044ee2e6f9562c | |
parent | c957fe0aab54531d5ceb13718ecff078f3c9f5cb (diff) | |
download | brdo-7cd54567bdebc9fe25f778982fb6319b966265ec.tar.gz brdo-7cd54567bdebc9fe25f778982fb6319b966265ec.tar.bz2 |
- Commiting patch #8288: Let modules pass $attributes to form_checkboxes() and form_radios().
-rw-r--r-- | includes/common.inc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/includes/common.inc b/includes/common.inc index 254993075..9fbb41857 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1034,11 +1034,11 @@ function form_radio($title, $name, $value = 1, $checked = 0, $description = NULL return theme('form_element', NULL, $element, $description, $required, _form_get_error($name)); } -function form_radios($title, $name, $value, $options, $description = NULL, $required = FALSE) { +function form_radios($title, $name, $value, $options, $description = NULL, $required = FALSE, $attributes = NULL) { if (count($options) > 0) { $choices = ''; foreach ($options as $key => $choice) { - $choices .= "<label class=\"option\"><input type=\"radio\" class=\"form-radio\" name=\"edit[$name]\" value=\"$key\"". ($key == $value ? " checked=\"checked\"" : "") ." /> $choice</label><br />"; + $choices .= "<label class=\"option\"><input type=\"radio\" class=\"form-radio\" name=\"edit[$name]\" value=\"$key\"". ($key == $value ? " checked=\"checked\"" : ""). drupal_attributes($attributes). " /> $choice</label><br />"; } return theme('form_element', $title, $choices, $description, $required, _form_get_error($name)); } @@ -1052,14 +1052,14 @@ function form_checkbox($title, $name, $value = 1, $checked = 0, $description = N return form_hidden($name, 0) . theme('form_element', NULL, $element, $description, $required, _form_get_error($name)); } -function form_checkboxes($title, $name, $values, $options, $description = NULL, $required = FALSE) { +function form_checkboxes($title, $name, $values, $options, $description = NULL, $required = FALSE, $attributes = NULL) { if (count($options) > 0) { if (!isset($values)) { $values = array(); } $choices = ''; foreach ($options as $key => $choice) { - $choices .= "<label class=\"option\"><input type=\"checkbox\" class=\"form-checkbox\" name=\"edit[$name][]\" value=\"$key\"". (in_array($key, $values) ? " checked=\"checked\"" : "") ." /> $choice</label><br />"; + $choices .= "<label class=\"option\"><input type=\"checkbox\" class=\"form-checkbox\" name=\"edit[$name][]\" value=\"$key\"". (in_array($key, $values) ? " checked=\"checked\"" : ""). drupal_attributes($attributes). " /> $choice</label><br />"; } return theme('form_element', $title, $choices, $description, $required, _form_get_error($name)); } |