Skip to content

Commit e3e2849

Browse files
ENH Hide PHP font icons from screen readers
1 parent 8af55ff commit e3e2849

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

code/Form/GridFieldAddClassesButton.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public function getHTMLFragments($grid)
188188
$this->getAction(),
189189
array()
190190
);
191-
$addAction->addExtraClass('font-icon-plus btn');
191+
$addAction->addExtraClass('btn')->setIcon('plus');
192192

193193
if ($this->getButtonClass()) {
194194
$addAction->addExtraClass($this->getButtonClass());

code/Model/Submission/SubmittedFileField.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function getFormattedValue(): ?DBField
5050
$default = 'You don\'t have the right permissions to download this file';
5151
$message = _t(__CLASS__ . '.INSUFFICIENTRIGHTS', $default);
5252
return DBField::create_field('HTMLText', sprintf(
53-
'<i class="icon font-icon-lock"></i> %s - <em>%s</em>',
53+
'<span class="icon font-icon-lock" aria-hidden="true"></span> %s - <em>%s</em>',
5454
htmlspecialchars($name, ENT_QUOTES),
5555
htmlspecialchars($message, ENT_QUOTES)
5656
));

tests/php/Model/SubmittedFileFieldTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function testGetFormattedValue()
9797
$this->logInWithPermission('CMS_ACCESS_CMSMain');
9898
$this->assertEquals(
9999
sprintf(
100-
'<i class="icon font-icon-lock"></i> %s - <em>%s</em>',
100+
'<span class="icon font-icon-lock" aria-hidden="true"></span> %s - <em>%s</em>',
101101
$fileName,
102102
'You don&#039;t have the right permissions to download this file'
103103
),

0 commit comments

Comments
 (0)