diff --git a/lib/form/templates/element-advcheckbox.mustache b/lib/form/templates/element-advcheckbox.mustache index 24dc981ae38..0993261bd07 100644 --- a/lib/form/templates/element-advcheckbox.mustache +++ b/lib/form/templates/element-advcheckbox.mustache @@ -50,8 +50,8 @@ {{/text}}
{{#required}} -
- {{#pix}}req, core, {{#str}}required{{/str}}{{/pix}} + {{/required}} {{{helpbutton}}} diff --git a/lib/form/templates/element-checkbox.mustache b/lib/form/templates/element-checkbox.mustache index 8268d369019..16035cac0da 100644 --- a/lib/form/templates/element-checkbox.mustache +++ b/lib/form/templates/element-checkbox.mustache @@ -50,8 +50,8 @@ {{/text}}
{{#required}} -
- {{#pix}}req, core, {{#str}}required{{/str}}{{/pix}} + {{/required}} {{{helpbutton}}} diff --git a/lib/form/templates/element-radio.mustache b/lib/form/templates/element-radio.mustache index bb9db253d83..86e0d5280ad 100644 --- a/lib/form/templates/element-radio.mustache +++ b/lib/form/templates/element-radio.mustache @@ -41,8 +41,8 @@
{{#required}} -
- {{#pix}}req, core, {{#str}}required{{/str}}{{/pix}} + {{/required}} {{{helpbutton}}} diff --git a/lib/form/templates/element-template.mustache b/lib/form/templates/element-template.mustache index 83abf802c01..2043ae8b529 100644 --- a/lib/form/templates/element-template.mustache +++ b/lib/form/templates/element-template.mustache @@ -58,8 +58,8 @@ {{/ label }}{{/ label}}
{{#required}} -
- {{#pix}}req, core, {{#str}}required{{/str}}{{/pix}} + {{/required}} {{{helpbutton}}} diff --git a/lib/formslib.php b/lib/formslib.php index a29ce7edb2d..6d5c48bebf7 100644 --- a/lib/formslib.php +++ b/lib/formslib.php @@ -1776,7 +1776,17 @@ class MoodleQuickForm extends HTML_QuickForm_DHTMLRulesTableless { } $this->_reqHTML = '' . $OUTPUT->pix_icon('req', get_string('requiredelement', 'form')) . ''; $this->_advancedHTML = '' . $OUTPUT->pix_icon('adv', get_string('advancedelement', 'form')) . ''; - $this->setRequiredNote(get_string('somefieldsrequired', 'form', $OUTPUT->pix_icon('req', get_string('requiredelement', 'form')))); + $this->setRequiredNote( + get_string( + identifier: 'somefieldsrequired', + component: 'form', + a: $OUTPUT->pix_icon( + pix: 'req', + alt: get_string('requiredelement', 'form'), + attributes: ['aria-hidden' => 'true'], + ), + ), + ); } /** @@ -3194,7 +3204,7 @@ class MoodleQuickForm_Renderer extends HTML_QuickForm_Renderer_Tableless{ /** @var string Required Note template string */ var $_requiredNoteTemplate = - "\n\t\t
{requiredNote}
"; + "\n\t\t
{requiredNote}
"; /** * Collapsible buttons string template. diff --git a/lib/templates/pix_icon_fontawesome.mustache b/lib/templates/pix_icon_fontawesome.mustache index 50876e3ae2f..48ef8466ede 100644 --- a/lib/templates/pix_icon_fontawesome.mustache +++ b/lib/templates/pix_icon_fontawesome.mustache @@ -31,6 +31,7 @@ * pix * title * extraclasses + * aria-hidden - whether the icon is hidden from assistive technologies Example context (json): { @@ -38,12 +39,13 @@ "title": "Meh", "alt": "Meh Meh", "extraclasses": "fa-spin", - "unmappedIcon": false + "unmappedIcon": false, + "aria-hidden": false } }} {{^unmappedIcon}} - + {{/unmappedIcon}} {{#unmappedIcon}} {{! We cannot include the pix_icon template directly here because we don't have all the mustache helpers loaded. }}