mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
MDL-30845 accessibility: changing the way input fields are rendered when they are not-editable
This commit is contained in:
parent
61bfc2c13b
commit
3ec55b9e0a
@ -64,6 +64,19 @@ class MoodleQuickForm_text extends HTML_QuickForm_text{
|
||||
$this->_hiddenLabel = $hiddenLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the html to be used when the element is frozen
|
||||
*
|
||||
* @since 2.4
|
||||
* @return string Frozen html
|
||||
*/
|
||||
function getFrozenHtml()
|
||||
{
|
||||
$attributes = array('readonly' => 'readonly');
|
||||
$this->updateAttributes($attributes);
|
||||
return $this->_getTabs() . '<input' . $this->_getAttrString($this->_attributes) . ' />' . $this->_getPersistantData();
|
||||
} //end func getFrozenHtml
|
||||
|
||||
/**
|
||||
* Returns HTML for this form element.
|
||||
*
|
||||
@ -88,18 +101,4 @@ class MoodleQuickForm_text extends HTML_QuickForm_text{
|
||||
return $this->_helpbutton;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user