MDL-80192 forms: implement method to set group element hidden label.
This is consistent with the API used for other form element types, in order to provide screen-readable text in the fieldset legend while not necessarily wanting to display said label. The new class property is automatically exported to the template via the `templatable_form_element` trait.
This commit is contained in:
@@ -46,6 +46,9 @@ class MoodleQuickForm_group extends HTML_QuickForm_group implements templatable
|
||||
/** @var string html for help button, if empty then no help */
|
||||
var $_helpbutton='';
|
||||
|
||||
/** @var bool if true label will be hidden. */
|
||||
protected $_hiddenLabel = false;
|
||||
|
||||
/** @var MoodleQuickForm */
|
||||
protected $_mform = null;
|
||||
|
||||
@@ -104,6 +107,15 @@ class MoodleQuickForm_group extends HTML_QuickForm_group implements templatable
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets label to be hidden
|
||||
*
|
||||
* @param bool $hiddenLabel sets if label should be hidden
|
||||
*/
|
||||
public function setHiddenLabel($hiddenLabel) {
|
||||
$this->_hiddenLabel = $hiddenLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the grouped elements and hides label
|
||||
*
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
This files describes API changes in core_form libraries and APIs,
|
||||
information provided here is intended especially for developers.
|
||||
|
||||
=== 4.2.6 ===
|
||||
|
||||
* New method `setHiddenLabel` added to the group form element type
|
||||
|
||||
=== 4.2.4 ===
|
||||
|
||||
* The group element has a new method `getAttributesForFormElement` which should be used in conjunction
|
||||
|
||||
Reference in New Issue
Block a user