Mute all icons that are part of an anchor and add simple labels to such anchors

The labels I've added are probably just of temporary nature as it's not
defined yet how to handle link labels properly for screen readers. What
is sure is that all icons that are part of a link are not important for the
meaning of it as this is expressed by the link itself.

refs #8360
refs #8358
This commit is contained in:
Johannes Meyer 2015-02-16 11:02:09 +01:00
parent 27cb5e24db
commit 2dea398f3b
6 changed files with 120 additions and 55 deletions

View File

@ -10,17 +10,24 @@
<?php foreach ($modules as $module): ?>
<tr>
<td>
<?php if ($module->enabled): ?>
<?= $this->icon('thumbs-up', $this->translate('Module is enabled')) ?>
<?php else: ?>
<?= $this->icon('thumbs-down', $this->translate('Module is disabled')) ?>
<?php endif ?>
<a href="<?= $this->url(
'config/module/',
array('name' => $module->name)
) ?>"><?= $this->escape($module->name); ?></a> (<?=
$module->enabled ? ($module->loaded ? $this->translate('enabled') : $this->translate('failed')) : $this->translate('disabled')
?>)
<?php if ($module->enabled && $module->loaded) {
$icon = $this->icon('thumbs-up');
$title = sprintf($this->translate('Module %s is enabled'), $module->name);
} elseif (! $module->enabled) {
$icon = $this->icon('thumbs-down');
$title = sprintf($this->translate('Module %s is disabled'), $module->name);
} else { // ! $module->loaded
$icon = $this->icon('thumbs-down');
$title = sprintf($this->translate('Module %s has failed to load'), $module->name);
}
echo $this->qlink(
$icon . $this->escape($module->name),
'config/module/',
array('name' => $module->name),
array('title' => $title),
false
); ?>
</td>
</tr>
<?php endforeach ?>

View File

@ -36,14 +36,24 @@
<?php foreach ($this->resources as $name): ?>
<tr>
<td>
<a href="<?= $this->href('config/editresource', array('resource' => $name)); ?>">
<?= $this->icon('edit'); ?> <?= $this->escape($name); ?>
</a>
<?= $this->qlink(
$this->icon('edit') . ' ' . $this->escape($name),
'config/editresource',
array('resource' => $name),
array('title' => sprintf($this->translate('Edit resource %s'), $name)),
false
); ?>
</td>
<td style="text-align: center">
<a href="<?= $this->href('config/removeresource', array('resource' => $name)); ?>">
<?= $this->icon('cancel'); ?>
</a>
<td>
<center>
<?= $this->qlink(
$this->icon('cancel'),
'config/removeresource',
array('resource' => $name),
array('title' => sprintf($this->translate('Remove resource %s'), $name)),
false
); ?>
</center>
</td>
</tr>
<?php endforeach; ?>

View File

@ -1,5 +1,3 @@
<?php
?>
<div class="controls">
<?= $this->tabs ?>
</div>
@ -25,9 +23,13 @@
<?= $pane->getName(); ?>
</th>
<th>
<a href="<?= $this->href('dashboard/remove-pane', array('pane' => $pane->getName())); ?>">
<?= $this->icon('cancel'); ?>
</a>
<?= $this->qlink(
$this->icon('cancel'),
'dashboard/remove-pane',
array('pane' => $pane->getName()),
array('title' => sprintf($this->translate('Remove pane %s'), $pane->getName())),
false
); ?>
</th>
</tr>
<?php $dashlets = $pane->getDashlets(); ?>
@ -50,9 +52,13 @@
<a href="<?= $this->href($dashlet->getUrl()); ?>"><?= $dashlet->getUrl(); ?></a>
</td>
<td>
<a href="<?= $this->href('dashboard/remove-dashlet', array('pane' => $pane->getName(), 'dashlet' => $dashlet->getTitle())); ?>">
<?= $this->icon('cancel'); ?>
</a>
<?= $this->qlink(
$this->icon('cancel'),
'dashboard/remove-dashlet',
array('pane' => $pane->getName(), 'dashlet' => $dashlet->getTitle()),
array('title' => sprintf($this->translate('Remove dashlet %s from pane %s'), $dashlet->getTitle(), $pane->getName())),
false
); ?>
</td>
</tr>
<?php endforeach; ?>

View File

@ -10,24 +10,50 @@
<?php for ($i = 0; $i < count($backendNames); $i++): ?>
<tr>
<td class="action">
<a href="<?= $this->href('config/editAuthenticationBackend', array('auth_backend' => $backendNames[$i])); ?>">
<?= $this->icon('edit'); ?> <?= $this->escape($backendNames[$i]); ?>
</a>
<?= $this->qlink(
$this->icon('edit') . ' ' . $this->escape($backendNames[$i]),
'config/editAuthenticationBackend',
array('auth_backend' => $backendNames[$i]),
array('title' => sprintf($this->translate('Edit authentication backend %s'), $backendNames[$i])),
false
); ?>
</td>
<td>
<a href="<?= $this->href('config/removeAuthenticationBackend', array('auth_backend' => $backendNames[$i])); ?>">
<?= $this->icon('cancel', $this->translate('Remove')); ?>
</a>
<?= $this->qlink(
$this->icon('cancel'),
'config/removeAuthenticationBackend',
array('auth_backend' => $backendNames[$i]),
array('title' => sprintf($this->translate('Remove authentication backend %s'), $backendNames[$i])),
false
); ?>
</td>
<td>
<?php if ($i > 0): ?>
<button type="submit" name="backend_newpos" value="<?= sprintf('%s|%s', $backendNames[$i], $i - 1); ?>">
<?= $this->icon('up-big', $this->translate('Move up in authentication order')); ?>
<button type="submit" name="backend_newpos" value="<?= sprintf(
'%s|%s',
$backendNames[$i],
$i - 1
); ?>" title="<?= $this->translate(
'Move up in authentication order'
); ?>" aria-label="<?= sprintf(
$this->translate('Move authentication backend %s upwards'),
$backendNames[$i]
); ?>">
<?= $this->icon('up-big'); ?>
</button>
<?php endif; ?>
<?php if ($i + 1 < count($backendNames)): ?>
<button type="submit" name="backend_newpos" value="<?= sprintf('%s|%s', $backendNames[$i], $i + 1); ?>">
<?= $this->icon('down-big', $this->translate('Move down in authentication order')); ?>
<button type="submit" name="backend_newpos" value="<?= sprintf(
'%s|%s',
$backendNames[$i],
$i + 1
); ?>" title="<?= $this->translate(
'Move down in authentication order'
); ?>" aria-label="<?= sprintf(
$this->translate('Move authentication backend %s downwards'),
$backendNames[$i]
); ?>">
<?= $this->icon('down-big'); ?>
</button>
<?php endif; ?>
</td>

View File

@ -51,13 +51,13 @@
<td><?= $this->escape($role->users) ?></td>
<td><?= $this->escape($role->groups) ?></td>
<td>
<a href="<?= $this->url('roles/remove', array('role' => $name)) ?>"
title="<?= sprintf(
$this->translate('Remove role %s'),
$name
) ?>">
<?= $this->icon('cancel') ?>
</a>
<?= $this->qlink(
$this->icon('cancel'),
'roles/remove',
array('role' => $name),
array('title' => sprintf($this->translate('Remove role %s'), $name)),
false
); ?>
</td>
</tr>
<?php endforeach ?>

View File

@ -18,18 +18,26 @@
<?php foreach ($this->backendsConfig as $backendName => $config): ?>
<tr>
<td>
<a href="<?= $this->href('/monitoring/config/editbackend', array('backend' => $backendName)); ?>">
<?= $this->icon('edit'); ?> <?= $this->escape($backendName); ?>
</a>
<?= $this->qlink(
$this->icon('edit') . ' ' . $this->escape($backendName),
'/monitoring/config/editbackend',
array('backend' => $backendName),
array('title' => sprintf($this->translate('Edit monitoring backend %s'), $backendName)),
false
); ?>
<small>(<?= sprintf(
$this->translate('Type: %s'),
$this->escape($config->type === 'ido' ? 'IDO' : ucfirst($config->type))
); ?>)</small>
</td>
<td>
<a href="<?= $this->href('/monitoring/config/removebackend', array('backend' => $backendName)); ?>">
<?= $this->icon('cancel'); ?>
</a>
<?= $this->qlink(
$this->icon('cancel'),
'/monitoring/config/removebackend',
array('backend' => $backendName),
array('title' => sprintf($this->translate('Remove monitoring backend %s'), $backendName)),
false
); ?>
</td>
</tr>
<?php endforeach; ?>
@ -50,18 +58,26 @@
<?php foreach ($this->instancesConfig as $instanceName => $config): ?>
<tr>
<td>
<a href="<?= $this->href('/monitoring/config/editinstance', array('instance' => $instanceName)); ?>">
<?= $this->icon('edit'); ?> <?= $this->escape($instanceName); ?>
</a>
<?= $this->qlink(
$this->icon('edit') . ' ' . $this->escape($instanceName),
'/monitoring/config/editinstance',
array('instance' => $instanceName),
array('title' => sprintf($this->translate('Edit monitoring instance %s'), $instanceName)),
false
); ?>
<small>(<?= sprintf(
$this->translate('Type: %s'),
$config->host !== null ? $this->translate('Remote') : $this->translate('Local')
); ?>)</small>
</td>
<td>
<a href="<?= $this->href('/monitoring/config/removeinstance', array('instance' => $instanceName)); ?>">
<?= $this->icon('cancel'); ?>
</a>
<?= $this->qlink(
$this->icon('cancel'),
'/monitoring/config/removeinstance',
array('instance' => $instanceName),
array('title' => sprintf($this->translate('Remove monitoring instance %s'), $instanceName)),
false
); ?>
</td>
</tr>
<?php endforeach; ?>