diff --git a/includes/common.inc b/includes/common.inc index 674419619a2..6a4e82a3c66 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -764,10 +764,10 @@ function form_select($title, $name, $value, $options, $description = NULL, $extr function form_radios($title, $name, $value, $options, $description = NULL) { if (count($options) > 0) { - foreach ($options as $key=>$choice) { + foreach ($options as $key => $choice) { $output .= form_radio($choice, $name, $key, ($key == $value)); } - return theme("form_element", $title, $output, $description); + return theme("form_element", $title, $output, $description, $name); } } diff --git a/includes/theme.inc b/includes/theme.inc index edf1c0d2388..c849c9fd110 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -274,6 +274,7 @@ function theme_node($node, $main = 0, $page = 0) { * @param $title the form element's title * @param $value the form element's data * @param $description the form element's description or explanation + * @param $id the form element's ID used by the <label> tag * * @return a string containing the @a node output. */ @@ -288,12 +289,18 @@ function theme_form_element($title, $value, $description = NULL, $id = NULL) { $title = "
"; } } + else { + if ($id) { + $title = ""; + // TODO: does this make sense to do? + } + } if ($description) { $description = "
$description
"; } - return "
$title $value $description
\n"; + return "
". $title . $value . $description ."
\n"; } /** diff --git a/modules/user.module b/modules/user.module index b5b2e69b87e..0654931e994 100644 --- a/modules/user.module +++ b/modules/user.module @@ -675,7 +675,7 @@ function user_login($edit = array(), $msg = "") { $output .= form_textfield(t("Username"), "name", $edit["name"], 30, 64, t("Enter your %s username.", array("%s" => variable_get("site_name", "local")))); } $output .= form_password(t("Password"), "pass", $pass, 30, 64, t("Enter the password that accompanies your username.")); - $output .= form_checkbox(t("Remember me"), "remember_me", 1, 0, 0); + $output .= form_checkbox(t("Remember me"), "remember_me"); $output .= form_submit(t("Log in")); $items[] = l(t("Request new password"), "user/password"); if (variable_get("user_register", 1)) { diff --git a/modules/user/user.module b/modules/user/user.module index b5b2e69b87e..0654931e994 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -675,7 +675,7 @@ function user_login($edit = array(), $msg = "") { $output .= form_textfield(t("Username"), "name", $edit["name"], 30, 64, t("Enter your %s username.", array("%s" => variable_get("site_name", "local")))); } $output .= form_password(t("Password"), "pass", $pass, 30, 64, t("Enter the password that accompanies your username.")); - $output .= form_checkbox(t("Remember me"), "remember_me", 1, 0, 0); + $output .= form_checkbox(t("Remember me"), "remember_me"); $output .= form_submit(t("Log in")); $items[] = l(t("Request new password"), "user/password"); if (variable_get("user_register", 1)) {