summaryrefslogtreecommitdiff
path: root/lib/util.php
diff options
context:
space:
mode:
authorZach Copley <zach@controlyourself.ca>2008-09-23 17:38:29 -0400
committerZach Copley <zach@controlyourself.ca>2008-09-23 17:38:29 -0400
commit6548c6cd1835006fed67a4d1f944094b436feb14 (patch)
treeb9112e79f560d2c2ac11ea0d07351f7ab8db91e0 /lib/util.php
parentcce099d3477a7ec517eab01e388f9e93b50e5938 (diff)
Added option to add disable attr to common_checkbox()
darcs-hash:20080923213829-7b5ce-da5c5d25639812403eb59787c4c429cc9931d08a.gz
Diffstat (limited to 'lib/util.php')
-rw-r--r--lib/util.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/util.php b/lib/util.php
index 86b2747dc..90abe72db 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -377,7 +377,7 @@ function common_input($id, $label, $value=NULL,$instructions=NULL) {
common_element_end('p');
}
-function common_checkbox($id, $label, $checked=false, $instructions=NULL, $value='true')
+function common_checkbox($id, $label, $checked=false, $instructions=NULL, $value='true', $disabled=false)
{
common_element_start('p');
$attrs = array('name' => $id,
@@ -390,6 +390,9 @@ function common_checkbox($id, $label, $checked=false, $instructions=NULL, $value
if ($checked) {
$attrs['checked'] = 'checked';
}
+ if ($disabled) {
+ $attrs['disabled'] = 'true';
+ }
common_element('input', $attrs);
# XXX: use a <label>
common_text(' ');