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

View File

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

View File

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

View File

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

View File

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

View File

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