From a98a90163e48dad3a13b655fb4110656b6c3b1d1 Mon Sep 17 00:00:00 2001 From: nfreear Date: Wed, 12 Sep 2007 11:17:35 +0000 Subject: [PATCH] Fixes MDL-8627, "HTML QuickForm displays (some?) disabled elements in a non-accessible way", overrides parent::getFrozenHtml. --- lib/form/checkbox.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/lib/form/checkbox.php b/lib/form/checkbox.php index 2f4442645b..a2d9cbd970 100644 --- a/lib/form/checkbox.php +++ b/lib/form/checkbox.php @@ -103,19 +103,22 @@ class MoodleQuickForm_checkbox extends HTML_QuickForm_checkbox{ { return '' . parent::toHtml() . ''; } + /** - * 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 + * 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 getElementTemplateType(){ - if ($this->_flagFrozen){ - return 'static'; + function getFrozenHtml() + { + //$this->_generateId(); + $output = 'getChecked()) { + $output .= 'checked="checked" />'.$this->_getPersistantData(); } else { - return 'default'; + $output .= '/>'; } - } + return $output; + } //end func getFrozenHtml } ?> \ No newline at end of file -- 2.39.5