- {{#pix}}req, core, {{#str}}required{{/str}}{{/pix}}
+
+ {{#pix}}req, core{{/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. }}