Mute icons properly using the new automatic mechanisms of our view helpers

refs #8360
This commit is contained in:
Johannes Meyer 2015-02-16 10:52:42 +01:00
parent 243bc6ec0c
commit 5321c2f9e5
24 changed files with 44 additions and 44 deletions

View File

@ -31,7 +31,7 @@ if ( isset($pdf) )
}
</script>
<?= $this->img('img/logo_icinga_big_dark.png', array('align' => 'right', 'width' => '75')) ?>
<?= $this->img('img/logo_icinga_big_dark.png', null, array('align' => 'right', 'width' => '75')) ?>
<!--<div id="page-header">
<table>
<tr>

View File

@ -7,7 +7,7 @@
<div class="form" data-base-target="layout">
<h1><?= $this->translate('Welcome to Icinga Web 2'); ?></h1>
<?php if ($requiresSetup): ?>
<p tabindex="0" class="config-note"><?= sprintf(
<p class="config-note"><?= sprintf(
$this->translate(
'It appears that you did not configure Icinga Web 2 yet so it\'s not possible to log in without any defined '
. 'authentication method. Please define a authentication method by following the instructions in the'
@ -18,7 +18,7 @@
'</a>'
); ?></p>
<?php elseif ($requiresExternalAuth): ?>
<p tabindex="0" class="info-box"><i aria-hidden="true" class="icon-info"></i><?= $this->translate(
<p class="info-box"><?= $this->icon('icon-info'); ?><?= $this->translate(
'You\'re currently not authenticated using any of the web server\'s authentication mechanisms.'
. ' Make sure you\'ll configure such, otherwise you\'ll not be able to login.'
); ?></p>

View File

@ -21,7 +21,7 @@
</h2>
<p>
<a href="<?= $this->href('/config/createAuthenticationBackend'); ?>">
<?= $this->icon('plus', null, array('aria-hidden' => 'true')); ?><?= $this->translate('Create A New Authentication Backend'); ?>
<?= $this->icon('plus'); ?><?= $this->translate('Create A New Authentication Backend'); ?>
</a>
</p>
<h2 tabindex="0" id="authentication-reorder" class="sr-only">

View File

@ -21,7 +21,7 @@
</h2>
<p>
<a href="<?= $this->href('/config/createresource'); ?>">
<?= $this->icon('plus', null, array('aria-hidden' => 'true')); ?> <?= $this->translate('Create A New Resource'); ?>
<?= $this->icon('plus'); ?> <?= $this->translate('Create A New Resource'); ?>
</a>
</p>
<h2 tabindex="0" id="resource-edit-resource" class="sr-only">

View File

@ -25,7 +25,7 @@ class NoScriptApply extends Zend_Form_Decorator_Abstract
{
if ($content) {
$content .= '<noscript><button name="noscript_apply" style="margin-left: 0.5em;" type="submit" value="1">'
. Icinga::app()->getViewRenderer()->view->icon('refresh.png', null, array('aria-hidden' => 'true')) . '&nbsp;' . t('Apply')
. Icinga::app()->getViewRenderer()->view->icon('refresh.png') . '&nbsp;' . t('Apply')
. '</button></noscript>';
}

View File

@ -669,7 +669,7 @@ class FilterEditor extends AbstractWidget
. '" title="'
. $title
. '">'
. '<i class="icon-filter"></i>'
. '<i aria-hidden="true" class="icon-filter"></i>'
. '</a>';
}

View File

@ -215,9 +215,9 @@ class Tab extends AbstractWidget
if ($this->icon !== null) {
if (strpos($this->icon, '.') === false) {
$caption = $view->icon($this->icon, null, array('aria-hidden' => 'true')) . $caption;
$caption = $view->icon($this->icon) . $caption;
} else {
$caption = $view->img($this->icon, array('aria-hidden' => 'true', 'class' => 'icon')) . $caption;
$caption = $view->img($this->icon, null, array('class' => 'icon')) . $caption;
}
}
if ($this->url !== null) {

View File

@ -33,7 +33,7 @@ EOT;
*/
private $dropdownTpl = <<< 'EOT'
<li class="dropdown">
<a href="#" class="dropdown-toggle"><i class="icon-down-open"></i></a>
<a href="#" class="dropdown-toggle"><i aria-hidden="true" class="icon-down-open"></i></a>
<ul class="dropdown-menu">
{TABS}
</ul>

View File

@ -42,11 +42,11 @@
<span>
<?php if ($this->trend->trend === 'up'): ?>
<?= $this->icon('up-open', null, array('aria-hidden' => 'true')); ?>
<?= $this->icon('up-open'); ?>
<?php elseif ($this->trend->trend === 'unchanged'): ?>
<?= $this->icon('right-open', null, array('aria-hidden' => 'true')); ?>
<?= $this->icon('right-open'); ?>
<?php else: ?>
<?= $this->icon('down-open', null, array('aria-hidden' => 'true')); ?>
<?= $this->icon('down-open'); ?>
<?php endif; ?>
</span>
</div>

View File

@ -6,7 +6,7 @@
<div class="content" data-base-target="_next">
<p>
<a href="<?= $this->href('/monitoring/config/createbackend'); ?>">
<?= $this->icon('plus', null, array('aria-hidden' => 'true')); ?> <?= $this->translate('Create New Monitoring Backend'); ?>
<?= $this->icon('plus'); ?> <?= $this->translate('Create New Monitoring Backend'); ?>
</a>
</p>
<table class="action">
@ -38,7 +38,7 @@
<h1><?= $this->translate('Monitoring Instances') ?></h1>
<p>
<a href="<?= $this->href('/monitoring/config/createinstance'); ?>">
<?= $this->icon('plus', null, array('aria-hidden' => 'true')); ?> <?= $this->translate('Create New Instance'); ?>
<?= $this->icon('plus'); ?> <?= $this->translate('Create New Instance'); ?>
</a>
</p>
<table class="action">

View File

@ -31,21 +31,21 @@
<div>
<a href="<?= $rescheduleAllLink ?>">
<?= $this->icon('reschedule', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('reschedule'); ?>
<?= $this->translate('Reschedule host checks') ?>
</a>
</div>
<div>
<a href="<?= $downtimeAllLink ?>">
<?= $this->icon('plug', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('plug'); ?>
<?= $this->translate('Schedule host downtimes') ?>
</a>
</div>
<div>
<a href="<?= $processCheckResultAllLink; ?>">
<?= $this->icon('reply', null, array('aria-hidden' => 'true')); ?>
<?= $this->icon('reply'); ?>
<?= $this->translate('Submit passive check results'); ?>
</a>
</div>
@ -71,7 +71,7 @@
),
$unhandledCount
) ?>">
<?= $this->icon('plug', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('plug'); ?>
<?= sprintf(
$this->translatePlural(
'Schedule downtime for unhandled host problem',
@ -91,7 +91,7 @@
),
$unhandledCount
) ?>">
<?= $this->icon('ok', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('ok'); ?>
<?= sprintf(
$this->translatePlural(
'Acknowledge unhandled host problem',
@ -133,7 +133,7 @@
),
$inDowntimeCount
) ?>">
<?= $this->icon('plug', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('plug'); ?>
<?= sprintf(
$this->translatePlural(
'List %u host currently in downtime',
@ -158,7 +158,7 @@
),
$commentCount
) ?>">
<?= $this->icon('comment', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('comment'); ?>
<?= sprintf(
$this->translatePlural(
'List %u host comment',

View File

@ -20,7 +20,7 @@ foreach ($groupData as $groupName => $groupInfo): ?>
<div class="box contents">
<?php foreach ($groupInfo['contacts'] as $c): ?>
<div class="box entry">
<img aria-hidden="true" src="<?= $this->href('/static/gravatar', array('email' => $c->contact_email )) ?>" />
<?= $this->img('/static/gravatar', array('email' => $c->contact_email)); ?>
<a href="<?= $this->href(
'monitoring/show/contact',
array('contact' => $c->contact_name)

View File

@ -14,7 +14,7 @@
}
foreach ($contacts as $contact): ?>
<div class="contact">
<img aria-hidden="true" src="<?= $this->href('/static/gravatar', array('email' => $contact->contact_email )) ?>" />
<?= $this->img('/static/gravatar', array('email' => $contact->contact_email)); ?>
<a href="<?= $this->href(
'monitoring/show/contact',
array('contact' => $contact->contact_name)

View File

@ -9,8 +9,8 @@
<table class="objectlist">
<thead>
<tr>
<th><?= $this->icon('host', null, array('aria-hidden' => 'true')); ?> <?= $this->translate('Host'); ?></th>
<th><?= $this->icon('conf', null, array('aria-hidden' => 'true')); ?> <?= $this->translate('Service'); ?></th>
<th><?= $this->icon('host'); ?> <?= $this->translate('Host'); ?></th>
<th><?= $this->icon('conf'); ?> <?= $this->translate('Service'); ?></th>
</tr>
</thead>
<tbody>

View File

@ -19,21 +19,21 @@
<div>
<a href="<?= $rescheduleAllLink ?>">
<?= $this->icon('reschedule', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('reschedule'); ?>
<?= $this->translate('Reschedule service checks') ?>
</a>
</div>
<div>
<a href="<?= $downtimeAllLink ?>">
<?= $this->icon('plug', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('plug'); ?>
<?= $this->translate('Schedule service downtimes') ?>
</a>
</div>
<div>
<a href="<?= $processCheckResultAllLink; ?>">
<?= $this->icon('reply', null, array('aria-hidden' => 'true')); ?>
<?= $this->icon('reply'); ?>
<?= $this->translate('Submit passive check results'); ?>
</a>
</div>
@ -59,7 +59,7 @@
),
$unhandledCount
) ?>">
<?= $this->icon('plug', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('plug'); ?>
<?= sprintf(
$this->translatePlural(
'Schedule downtime for unhandled service problem',
@ -79,7 +79,7 @@
),
$unhandledCount
) ?>">
<?= $this->icon('ok', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('ok'); ?>
<?= sprintf(
$this->translatePlural(
'Acknowledge unhandled service problem',
@ -119,7 +119,7 @@
$inDowntimeCount
),
$inDowntimeCount) ?>">
<?= $this->icon('plug', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('plug'); ?>
<?= sprintf(
$this->translatePlural(
'List %u service currently in downtime',
@ -143,7 +143,7 @@
),
$commentCount
) ?>">
<?= $this->icon('comment', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('comment'); ?>
<?= sprintf(
$this->translatePlural(
'List %u service comment',

View File

@ -36,7 +36,7 @@ if ($object->acknowledged): ?>
}
?>
<a href="<?= $ackLink ?>" data-base-target="_self">
<?= $this->icon('ok', null, array('aria-hidden' => 'true')) ?> <?= $this->translate('Acknowledge') ?>
<?= $this->icon('ok') ?> <?= $this->translate('Acknowledge') ?>
</a>
<?php } else {
echo '&#45;';

View File

@ -40,7 +40,7 @@ if ($object->getType() === $object::TYPE_HOST) {
}
?>
<a href="<?= $reschedule ?>" data-base-target="_self">
<?= $this->icon('reschedule', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('reschedule') ?>
<?= $this->translate('Reschedule') ?>
</a>
<?php } // endif ?>

View File

@ -22,7 +22,7 @@ $command = array_shift($parts);
);
} ?>
<a href="<?= $processCheckResult ?>" data-base-target="_self">
<?= $this->icon('reply', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('reply') ?>
<?= $this->translate('Process check result') ?>
</a>
<?php endif ?>

View File

@ -16,7 +16,7 @@
}
?>
<a href="<?= $addCommentLink ?>" data-base-target="_self">
<?= $this->icon('comment', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('comment') ?>
<?= $this->translate('Add comment') ?>
</a>
<?php } else {

View File

@ -12,7 +12,7 @@ if (! empty($object->contacts)) {
printf(
"<tr><th>%s</th><td>%s %s</td></tr>\n",
$this->translate('Contacts'),
$this->icon('user', null, array('aria-hidden' => 'true')),
$this->icon('user'),
implode(', ', $list)
);
@ -31,7 +31,7 @@ if (! empty($object->contactgroups)) {
printf(
"<tr><th>%s</th><td>%s %s</td></tr>\n",
$this->translate('Contactgroups'),
$this->icon('users', null, array('aria-hidden' => 'true')),
$this->icon('users'),
implode(', ', $list)
);

View File

@ -16,7 +16,7 @@
}
?>
<a href="<?= $scheduleDowntimeLink ?>" data-base-target="_self">
<?= $this->icon('plug', null, array('aria-hidden' => 'true')) ?>
<?= $this->icon('plug') ?>
<?= $this->translate('Schedule downtime') ?>
</a>
<?php } else {

View File

@ -11,7 +11,7 @@ foreach ($object->hostgroups as $name => $alias) {
printf(
"<tr><th>%s</th><td>%s %s</td></tr>\n",
$this->translate('Hostgroups'),
$this->icon('host', null, array('aria-hidden' => 'true')),
$this->icon('host'),
implode(', ', $list)
);

View File

@ -12,7 +12,7 @@ foreach ($object->servicegroups as $name => $alias) {
printf(
"<tr><th>%s</th><td>%s %s</td></tr>\n",
$this->translate('Servicegroups'),
$this->icon('services', null, array('aria-hidden' => 'true')),
$this->icon('services'),
implode(', ', $list)
);

View File

@ -41,7 +41,7 @@ class AuthenticationPage extends Form
'note',
'external_note',
array(
'value' => $this->translate(
'value' => '<i aria-hidden="true" class="icon-info"></i>' . $this->translate(
'You\'re currently not authenticated using any of the web server\'s authentication '
. 'mechanisms. Make sure you\'ll configure such, otherwise you\'ll not be able to '
. 'log into Icinga Web 2.'
@ -50,7 +50,7 @@ class AuthenticationPage extends Form
'ViewHelper',
array(
'HtmlTag',
array('tag' => 'p', 'class' => 'icon-info info-box')
array('tag' => 'p', 'class' => 'info-box')
)
)
)