Added option to add disable attr to common_checkbox()
darcs-hash:20080923213829-7b5ce-da5c5d25639812403eb59787c4c429cc9931d08a.gz
This commit is contained in:
parent
cce099d347
commit
6548c6cd18
@ -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(' ');
|
||||
|
Loading…
Reference in New Issue
Block a user