applying the same patch to advcheckbox, backported from HEAD - Fixes MDL-8627, "HTML QuickForm displays (some?) disabled elements in a non-accessible way", overrides parent::getFrozenHtml.

This commit is contained in:
skodak 2007-09-15 19:48:39 +00:00
parent 45d99c3807
commit 5a9528b959

View file

@ -89,5 +89,22 @@ class MoodleQuickForm_advcheckbox extends HTML_QuickForm_advcheckbox{
}
} // end func _generateId
/**
* Returns the disabled field. Accessibility: the return "[ ]" from parent
* class is not acceptable for screenreader users, and we DO want a label.
* @return string
*/
function getFrozenHtml()
{
//$this->_generateId();
$output = '<input type="checkbox" disabled="disabled" id="'.$this->getAttribute('id').'" ';
if ($this->getChecked()) {
$output .= 'checked="checked" />'.$this->_getPersistantData();
} else {
$output .= '/>';
}
return $output;
} //end func getFrozenHtml
}
?>