diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-12-22 15:38:07 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-12-22 15:38:07 +0000 |
commit | 770174b2994937f7dc5bba43e17e5b2a07421d33 (patch) | |
tree | ab895ffed1a15697912fb020c9370b9462c12bf1 /includes/theme.inc | |
parent | 8f226513b4f5a7e4dd559888df0b9bb69b9f8cb6 (diff) | |
download | brdo-770174b2994937f7dc5bba43e17e5b2a07421d33.tar.gz brdo-770174b2994937f7dc5bba43e17e5b2a07421d33.tar.bz2 |
- Updated documentation, small bug fix and small improvements to the <label>
tags.
To be discussed and investigated: when a form element has no title an empty
<label> tag will be emitted (eg. "remember me" checkbox). This doesn't make
sense but is our best option for now.
Diffstat (limited to 'includes/theme.inc')
-rw-r--r-- | includes/theme.inc | 9 |
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"; } /** |