summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-06-12 12:52:01 -0400
committerEvan Prodromou <evan@prodromou.name>2008-06-12 12:52:01 -0400
commit2354faf7ac87f191b7d4906e40e82172199accb9 (patch)
tree004fa15a68e31565cf36236a31c8e838b0dfdddc /lib
parentf4be93d2852dac7c5b8a6ecce66f047a53bba6c5 (diff)
add instructions to each form entry in forms
darcs-hash:20080612165201-84dde-1abc45a0b2fd24002bc6f3449e9fc521d4f02eac.gz
Diffstat (limited to 'lib')
-rw-r--r--lib/util.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/util.php b/lib/util.php
index 5c55fcda9..c64cd5979 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -261,7 +261,7 @@ function common_menu_item($url, $text, $title=NULL, $is_selected=false) {
common_element_end('li');
}
-function common_input($id, $label, $value=NULL) {
+function common_input($id, $label, $value=NULL,$instructions=NULL) {
common_element_start('p');
common_element('label', array('for' => $id), $label);
$attrs = array('name' => $id,
@@ -271,6 +271,9 @@ function common_input($id, $label, $value=NULL) {
$attrs['value'] = htmlspecialchars($value);
}
common_element('input', $attrs);
+ if ($instructions) {
+ common_element('span', 'input_instructions', $instructions);
+ }
common_element_end('p');
}
@@ -281,13 +284,16 @@ function common_hidden($id, $value) {
'value' => $value));
}
-function common_password($id, $label) {
+function common_password($id, $label, $instructions=NULL) {
common_element_start('p');
common_element('label', array('for' => $id), $label);
$attrs = array('name' => $id,
'type' => 'password',
'id' => $id);
common_element('input', $attrs);
+ if ($instructions) {
+ common_element('span', 'input_instructions', $instructions);
+ }
common_element_end('p');
}
@@ -301,7 +307,7 @@ function common_submit($id, $label) {
common_element_end('p');
}
-function common_textarea($id, $label, $content=NULL) {
+function common_textarea($id, $label, $content=NULL, $instructions=NULL) {
common_element_start('p');
common_element('label', array('for' => $id), $label);
common_element('textarea', array('rows' => 3,
@@ -309,6 +315,9 @@ function common_textarea($id, $label, $content=NULL) {
'name' => $id,
'id' => $id),
($content) ? $content : ' ');
+ if ($instructions) {
+ common_element('span', 'input_instructions', $instructions);
+ }
common_element_end('p');
}