summaryrefslogtreecommitdiff
path: root/includes/theme.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/theme.inc')
-rw-r--r--includes/theme.inc9
1 files changed, 8 insertions, 1 deletions
diff --git a/includes/theme.inc b/includes/theme.inc
index edf1c0d23..c849c9fd1 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 = "<label>$title:</label><br />";
}
}
+ else {
+ if ($id) {
+ $title = "<label for=\"$id\"></label>";
+ // TODO: does this make sense to do?
+ }
+ }
if ($description) {
$description = "<div class=\"description\">$description</div>";
}
- return "<div class=\"form-item\">$title $value $description</div>\n";
+ return "<div class=\"form-item\">". $title . $value . $description ."</div>\n";
}
/**