mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 00:16:46 +02:00
MDL-70829 theme_boost: Make context header icons decorative
The non-empty alt text for the icons of the context header buttons like the "Message" and the "Add contact" buttons cause redundant information to be read twice by screen readers when the buttons are rendered with the icon and the button name. The icons need to be set as decorative by setting an empty alt text for them. * The presentation role is also unnecessary. * The alt text is needed when the button gets rendered without the button name text.
This commit is contained in:
parent
dd29c50196
commit
87bacf1750
4 changed files with 17 additions and 8 deletions
|
@ -28,7 +28,12 @@
|
|||
}
|
||||
}}
|
||||
<span>
|
||||
{{#pix}} t/addcontact, core, {{#str}} addtoyourcontacts, message {{/str}} {{/pix}}
|
||||
{{#displaytextlabel}}<span class="header-button-title">{{#str}} addtoyourcontacts, message {{/str}}</span>{{/displaytextlabel}}
|
||||
{{^displaytextlabel}}
|
||||
{{#pix}} t/addcontact, core, {{#str}} addtoyourcontacts, message {{/str}} {{/pix}}
|
||||
{{/displaytextlabel}}
|
||||
{{#displaytextlabel}}
|
||||
{{#pix}} t/addcontact, core {{/pix}}
|
||||
<span class="header-button-title">{{#str}} addtoyourcontacts, message {{/str}}</span>
|
||||
{{/displaytextlabel}}
|
||||
</span>
|
||||
{{> core/loading }}
|
||||
|
|
|
@ -28,7 +28,12 @@
|
|||
}
|
||||
}}
|
||||
<span>
|
||||
{{#pix}} t/removecontact, core, {{#str}} removefromyourcontacts, message {{/str}} {{/pix}}
|
||||
{{#displaytextlabel}}<span class="header-button-title">{{#str}} removefromyourcontacts, message {{/str}}</span>{{/displaytextlabel}}
|
||||
{{^displaytextlabel}}
|
||||
{{#pix}} t/removecontact, core, {{#str}} removefromyourcontacts, message {{/str}} {{/pix}}
|
||||
{{/displaytextlabel}}
|
||||
{{#displaytextlabel}}
|
||||
{{#pix}} t/removecontact, core {{/pix}}
|
||||
<span class="header-button-title">{{#str}} removefromyourcontacts, message {{/str}}</span>
|
||||
{{/displaytextlabel}}
|
||||
</span>
|
||||
{{> core/loading }}
|
||||
|
|
|
@ -61,7 +61,7 @@ Feature: Self conversation
|
|||
Given I log in as "student1"
|
||||
When I follow "Profile" in the user menu
|
||||
Then I should see "Message"
|
||||
And I click on "Message" "icon"
|
||||
And I press "Message"
|
||||
And I send "Hi!" message in the message area
|
||||
And I should see "Hi!" in the "Student 1" "core_message > Message conversation"
|
||||
And I should see "##today##%d %B##" in the "Student 1" "core_message > Message conversation"
|
||||
|
|
|
@ -224,15 +224,14 @@ class core_renderer extends \core_renderer {
|
|||
if ($button['buttontype'] === 'message') {
|
||||
\core_message\helper::messageuser_requirejs();
|
||||
}
|
||||
$image = $this->pix_icon($button['formattedimage'], $button['title'], 'moodle', array(
|
||||
$image = $this->pix_icon($button['formattedimage'], '', 'moodle', array(
|
||||
'class' => 'iconsmall',
|
||||
'role' => 'presentation'
|
||||
));
|
||||
$image .= html_writer::span($button['title'], 'header-button-title');
|
||||
} else {
|
||||
$image = html_writer::empty_tag('img', array(
|
||||
'src' => $button['formattedimage'],
|
||||
'role' => 'presentation'
|
||||
'alt' => $button['title'],
|
||||
));
|
||||
}
|
||||
$html .= html_writer::link($button['url'], html_writer::tag('span', $image), $button['linkattributes']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue