summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/common.inc16
-rw-r--r--misc/drupal.css3
2 files changed, 15 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) {
diff --git a/misc/drupal.css b/misc/drupal.css
index d3fa130d8..bfa612823 100644
--- a/misc/drupal.css
+++ b/misc/drupal.css
@@ -150,6 +150,9 @@ li a.active {
.form-item label {
font-weight: bold;
}
+.form-item label.option {
+ font-weight: normal;
+}
.form-submit {
margin: 0.5em 0;
}