mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-13983 show frozen radio buttons in a more accessible way.
This commit is contained in:
parent
c09604234a
commit
1e668c4d85
1 changed files with 15 additions and 0 deletions
|
@ -66,6 +66,21 @@ class MoodleQuickForm_radio extends HTML_QuickForm_radio{
|
||||||
return 'default';
|
return 'default';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 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()
|
||||||
|
{
|
||||||
|
$output = '<input type="radio" disabled="disabled" id="'.$this->getAttribute('id').'" ';
|
||||||
|
if ($this->getChecked()) {
|
||||||
|
$output .= 'checked="checked" />'.$this->_getPersistantData();
|
||||||
|
} else {
|
||||||
|
$output .= '/>';
|
||||||
|
}
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
function toHtml()
|
function toHtml()
|
||||||
{
|
{
|
||||||
return '<span>' . parent::toHtml() . '</span>';
|
return '<span>' . parent::toHtml() . '</span>';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue