summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-05-17 21:55:51 -0400
committerEvan Prodromou <evan@prodromou.name>2008-05-17 21:55:51 -0400
commit793d48dc9e1d73d871bf34d9f7c1da8916134d1b (patch)
treeeca9b97ed3da44402029f6509be9df539524ad73 /lib
parent81e037558f784d3784f61ef2dd9d17acc79255ec (diff)
smaller packet
darcs-hash:20080518015551-84dde-65964e140ed0b6c23aeee368fcffccdc14d71c61.gz
Diffstat (limited to 'lib')
-rw-r--r--lib/common.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/common.php b/lib/common.php
index e8a7ac6ae..03096260b 100644
--- a/lib/common.php
+++ b/lib/common.php
@@ -168,11 +168,15 @@ function common_menu_item($url, $text, $title=NULL) {
common_element_end('li');
}
-function common_input($id, $label) {
+function common_input($id, $label, $value=NULL) {
common_element('label', array('for' => $id), $label);
- common_element('input', array('name' => $id,
- 'type' => 'text',
- 'id' => $id));
+ $attrs = array('name' => $id,
+ 'type' => 'text',
+ 'id' => $id);
+ if ($value) {
+ $attrs['value'] = htmlspecialchars($value);
+ }
+ common_element('input', $attrs);
}
# salted, hashed passwords are stored in the DB