Add aria-label to icons with title attributes

This commit is contained in:
Michael Vickers
2020-10-02 21:48:19 +01:00
committed by Frédéric Guillot
parent de56529291
commit eafd82f564
11 changed files with 37 additions and 31 deletions

View File

@@ -1,55 +1,59 @@
<div class="table-list-icons">
<?php if ($user['notifications_enabled'] == 1): ?>
<span title="<?= t('Notifications are activated') ?>">
<i class="fa fa-bell-o" aria-hidden="true"></i>
<i class="fa fa-bell-o" role="img" aria-label="<?= t('Notifications are activated') ?>"></i>
</span>
<?php endif ?>
<?php if ($user['notifications_enabled'] == 0): ?>
<span title="<?= t('Notifications are disabled') ?>">
<i class="fa fa-bell-slash-o" aria-hidden="true"></i>
<i class="fa fa-bell-slash-o" role="img" aria-label="<?= t('Notifications are disabled') ?>"></i>
</span>
<?php endif ?>
<?php if ($user['twofactor_activated'] == 1): ?>
<span title="<?= t('Two factor authentication enabled') ?>">
<i class="fa fa-shield" aria-hidden="true"></i>
<i class="fa fa-shield" role="img" aria-label="<?= t('Two factor authentication enabled') ?>"></i>
</span>
<?php endif ?>
<?php if ($user['is_ldap_user'] == 1): ?>
<span title="<?= t('Remote user') ?>">
<i class="fa fa-cloud" aria-hidden="true"></i>
<i class="fa fa-cloud" role="img" aria-label="<?= t('Remote user') ?>"></i>
</span>
<?php endif ?>
<?php if ($user['lock_expiration_date'] != 0): ?>
<span title="<?= t('Account locked until:') ?> <?= $this->dt->datetime($user['lock_expiration_date']) ?>">
<i class="fa fa-lock" aria-hidden="true"></i>
<?php $aria_label = t('Account locked until:') . ' ' . $this->dt->datetime($user['lock_expiration_date']); ?>
<span title="<?= $aria_label ?>">
<i class="fa fa-lock" role="img" aria-label="<?= $aria_label ?>"></i>
</span>
<?php endif ?>
<?php if ($user['role'] == 'app-admin'): ?>
<span title="<?= $this->user->getRoleName($user['role']) ?>">
<i class="fa fa-star" aria-hidden="true"></i>
<?php $aria_label = $this->user->getRoleName($user['role']); ?>
<span title="<?= $aria_label ?>">
<i class="fa fa-star" role="img" aria-label="<?= $aria_label ?>"></i>
</span>
<?php endif ?>
<?php if ($user['role'] == 'app-manager'): ?>
<span title="<?= $this->user->getRoleName($user['role']) ?>">
<i class="fa fa-star-half-o" aria-hidden="true"></i>
<?php $aria_label = $this->user->getRoleName($user['role']); ?>
<span title="<?= $aria_label ?>">
<i class="fa fa-star-half-o" role="img" aria-label="<?= $aria_label ?>"></i>
</span>
<?php endif ?>
<?php if ($user['role'] == 'app-user'): ?>
<span title="<?= $this->user->getRoleName($user['role']) ?>">
<i class="fa fa-star-o" aria-hidden="true"></i>
<?php $aria_label = $this->user->getRoleName($user['role']); ?>
<span title="<?= $aria_label ?>">
<i class="fa fa-star-o" role="img" aria-label="<?= $aria_label ?>"></i>
</span>
<?php endif ?>
<?php if ($user['is_active'] == 0): ?>
<span title="<?= t('User disabled') ?>">
<i class="fa fa-ban" aria-hidden="true"></i>
<i class="fa fa-ban" role="img" aria-label="<?= t('User disabled') ?>"></i>
</span>
<?php endif ?>
</div>