$this->updateAttributes(array('id' => 'id_'.substr(md5(microtime() . $idx++), 0, 6)));
}
} // end func _generateId
- /**
- * Slightly different container template when frozen. Don't want to use a label tag
- * with a for attribute in that case for the element label but instead use a div.
- * Templates are defined in renderer constructor.
- *
- * @return string
- */
- function getElementTemplateType(){
- if ($this->_flagFrozen){
- return 'static';
- } else {
- return 'default';
- }
- }
+
function toHtml()
{
return '<span>' . parent::toHtml() . '</span>';
}
+
+ /**
+ * 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
+
}
?>
\ No newline at end of file