diff options
Diffstat (limited to 'includes/common.inc')
-rw-r--r-- | includes/common.inc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/includes/common.inc b/includes/common.inc index 787921912..1d199b209 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -966,20 +966,28 @@ function form_group($legend, $group, $description = NULL) { } function form_radio($title, $name, $value = 1, $checked = 0, $description = NULL, $attributes = NULL) { - return theme("form_element", NULL, "<input type=\"radio\" class=\"form-radio\" name=\"edit[$name]\" id=\"edit-$name-$value\" value=\"$value\"". ($checked ? " checked=\"checked\"" : "") . drupal_attributes($attributes) .' />'. (!is_null($title) ? " <label for=\"edit-$name-$value\">$title</label>" : ''), $description); + $element = "<input type=\"radio\" class=\"form-radio\" name=\"edit[$name]\" value=\"$value\"". ($checked ? " checked=\"checked\"" : "") . drupal_attributes($attributes) .' />'; + if (!is_null($title)) { + $element = "<label class=\"option\">$element $title</label>"; + } + return theme('form_element', NULL, $element, $description); } function form_radios($title, $name, $value, $options, $description = NULL) { if (count($options) > 0) { foreach ($options as $key => $choice) { - $choices .= "<input type=\"radio\" class=\"form-radio\" name=\"edit[$name]\" id=\"edit-$name-$key\" value=\"$key\"". ($key == $value ? " checked=\"checked\"" : "") ." /> <label for=\"edit-$name-$key\">$choice</label><br />"; + $choices .= "<label class=\"option\"><input type=\"radio\" class=\"form-radio\" name=\"edit[$name]\" value=\"$key\"". ($key == $value ? " checked=\"checked\"" : "") ." /> $choice</label><br />"; } - return theme("form_element", $title, $choices, $description); + return theme('form_element', $title, $choices, $description); } } function form_checkbox($title, $name, $value = 1, $checked = 0, $description = NULL, $attributes = NULL) { - return form_hidden($name, 0) . theme("form_element", NULL, "<input type=\"checkbox\" class=\"form-checkbox\" name=\"edit[$name]\" id=\"edit-$name\" value=\"". $value ."\"". ($checked ? " checked=\"checked\"" : "") . drupal_attributes($attributes) .' />' . (!is_null($title) ? " <label for=\"edit-$name\">$title</label>" : ''), $description); + $element = "<input type=\"checkbox\" class=\"form-checkbox\" name=\"edit[$name]\" id=\"edit-$name\" value=\"". $value ."\"". ($checked ? " checked=\"checked\"" : "") . drupal_attributes($attributes) .' />'; + if (!is_null($title)) { + $element = "<label class=\"option\">$element $title</label>"; + } + return form_hidden($name, 0) . theme('form_element', NULL, $element, $description); } function form_textfield($title, $name, $value, $size, $maxlength, $description = NULL, $attributes = NULL) { |