Convert array() to [] in application view scripts

This commit is contained in:
Johannes Rauh 2026-05-19 08:23:10 +02:00
parent dda3ad1ec2
commit e7f4a0a63d
20 changed files with 146 additions and 146 deletions

View file

@ -38,11 +38,11 @@ if ($this->layout()->inlineLayout) {
'',
Auth::getInstance()->isAuthenticated() ? 'dashboard' : '',
null,
array(
[
'aria-hidden' => 'true',
'data-base-target' => '_main',
'id' => 'header-logo'
)
]
); ?>
<div id="mobile-menu-toggle">
<button type="button"><?= $this->icon('menu') ?><?= $this->icon('cancel') ?></button>

View file

@ -24,9 +24,9 @@ if (! $this->auth()->isAuthenticated()) {
<?= $this->partial(
'layout/menu.phtml',
'default',
array(
[
'menuRenderer' => (new Menu())->getRenderer()->setUseStandardItemRenderer()
)
]
) ?>
</div>
<button id="toggle-sidebar" title="<?= $this->translate('Toggle Menu') ?>">

View file

@ -12,7 +12,7 @@ use ipl\Web\Widget\StateBadge;
</div>
<div id="about" class="content">
<?= $this->img('img/icinga-logo-big.svg', null, array('class' => 'icinga-logo', 'width' => 194)) ?>
<?= $this->img('img/icinga-logo-big.svg', null, ['class' => 'icinga-logo', 'width' => 194]) ?>
<section>
<table class="name-value-table">
@ -159,8 +159,8 @@ use ipl\Web\Widget\StateBadge;
<?= $this->qlink(
$this->translate('Configure'),
'config/module/',
array('name' => $module->getName()),
array('title' => sprintf($this->translate('Show the overview of the %s module'), $module->getName()))
['name' => $module->getName()],
['title' => sprintf($this->translate('Show the overview of the %s module'), $module->getName())]
) ?>
<?php endif ?>
</td>
@ -177,9 +177,9 @@ use ipl\Web\Widget\StateBadge;
'Icinga GmbH',
'https://icinga.com',
null,
array(
[
'target' => '_blank'
)
]
) ?>
</div>
<div class="about-social">
@ -187,11 +187,11 @@ use ipl\Web\Widget\StateBadge;
null,
'https://www.facebook.com/icinga',
null,
array(
[
'target' => '_blank',
'icon' => 'facebook-squared',
'title' => $this->translate('Icinga on Facebook')
)
]
) ?>
</div>
</footer>

View file

@ -15,12 +15,12 @@
$this->translate('Create a New Announcement') ,
'announcements/new',
null,
array(
[
'class' => 'button-link',
'data-base-target' => '_next',
'icon' => 'plus',
'title' => $this->translate('Create a new announcement')
)
]
);
} ?>
<?php if (empty($this->announcements)): ?>
@ -43,7 +43,7 @@
<td><?= $this->escape($announcement->author) ?></td>
<?php if ($this->hasPermission('application/announcements')): ?>
<td>
<a href="<?= $this->href('announcements/update', array('id' => $announcement->id)) ?>">
<a href="<?= $this->href('announcements/update', ['id' => $announcement->id]) ?>">
<?= $this->ellipsis($this->escape($announcement->message), 100) ?>
</a>
</td>
@ -56,12 +56,12 @@
<td class="icon-col"><?= $this->qlink(
null,
'announcements/remove',
array('id' => $announcement->id),
array(
['id' => $announcement->id],
[
'class' => 'action-link',
'icon' => 'cancel',
'title' => $this->translate('Remove this announcement')
)
]
) ?></td>
<?php endif ?>
</tr>

View file

@ -28,11 +28,11 @@
echo $this->qlink(
$module->name,
'config/module',
array('name' => $module->name),
array(
['name' => $module->name],
[
'class' => 'rowaction',
'title' => sprintf($this->translate('Show the overview of the %s module'), $module->name)
)
]
); ?>
</td>
</tr>

View file

@ -6,12 +6,12 @@
$this->translate('Create a New Resource') ,
'config/createresource',
null,
array(
[
'class' => 'button-link',
'data-base-target' => '_next',
'icon' => 'plus',
'title' => $this->translate('Create a new resource')
)
]
) ?>
<table class="table-row-selectable common-table" data-base-target="_next">
<thead>
@ -47,23 +47,23 @@
<?= $this->qlink(
$name,
'config/editresource',
array('resource' => $name),
array(
['resource' => $name],
[
'icon' => $icon,
'title' => sprintf($this->translate('Edit resource %s'), $name)
)
]
) ?>
</td>
<td class="icon-col text-right">
<?= $this->qlink(
'',
'config/removeresource',
array('resource' => $name),
array(
['resource' => $name],
[
'class' => 'action-link',
'icon' => 'cancel',
'title' => sprintf($this->translate('Remove resource %s'), $name)
)
]
) ?>
</td>
</tr>

View file

@ -8,12 +8,12 @@
$this->translate('Create a New User Backend') ,
'config/createuserbackend',
null,
array(
[
'class' => 'button-link',
'data-base-target' => '_next',
'icon' => 'plus',
'title' => $this->translate('Create a new user backend')
)
]
) ?>
<?= $form ?>
<?php endif ?>
@ -24,12 +24,12 @@
$this->translate('Create a New User Group Backend') ,
'usergroupbackend/create',
null,
array(
[
'class' => 'button-link',
'data-base-target' => '_next',
'icon' => 'plus',
'title' => $this->translate('Create a new user group backend')
)
]
) ?>
<?php if (! count($backendNames)) { return; } ?>
<table class="table-row-selectable common-table" data-base-target="_next">
@ -48,23 +48,23 @@
<?= $this->qlink(
$backendName,
'usergroupbackend/edit',
array('backend' => $backendName),
array(
['backend' => $backendName],
[
'icon' => $type === 'external' ? 'magic' : ($type === 'ldap' || $type === 'msldap' ? 'sitemap' : 'database'),
'title' => sprintf($this->translate('Edit user group backend %s'), $backendName)
)
]
); ?>
</td>
<td class="icon-col text-right">
<?= $this->qlink(
null,
'usergroupbackend/remove',
array('backend' => $backendName),
array(
['backend' => $backendName],
[
'class' => 'action-link',
'icon' => 'cancel',
'title' => sprintf($this->translate('Remove user group backend %s'), $backendName)
)
]
) ?>
</td>
</tr>

View file

@ -25,8 +25,8 @@
<?= $this->qlink(
$pane->getName(),
'dashboard/rename-pane',
array('pane' => $pane->getName()),
array('title' => sprintf($this->translate('Edit pane %s'), $pane->getName()))
['pane' => $pane->getName()],
['title' => sprintf($this->translate('Edit pane %s'), $pane->getName())]
) ?>
<?php else: ?>
<?= $this->escape($pane->getName()) ?>
@ -36,12 +36,12 @@
<?= $this->qlink(
'',
'dashboard/remove-pane',
array('pane' => $pane->getName()),
array(
['pane' => $pane->getName()],
[
'icon' => 'cancel',
'class' => 'action-link',
'title' => sprintf($this->translate('Remove pane %s'), $pane->getName())
)
]
); ?>
</th>
</tr>
@ -60,8 +60,8 @@
<?= $this->qlink(
$dashlet->getTitle(),
'dashboard/update-dashlet',
array('pane' => $pane->getName(), 'dashlet' => $dashlet->getName()),
array('title' => sprintf($this->translate('Edit dashlet %s'), $dashlet->getTitle()))
['pane' => $pane->getName(), 'dashlet' => $dashlet->getName()],
['title' => sprintf($this->translate('Edit dashlet %s'), $dashlet->getTitle())]
); ?>
</td>
<td>
@ -69,19 +69,19 @@
$dashlet->getUrl()->getRelativeUrl(),
$dashlet->getUrl()->getRelativeUrl(),
null,
array('title' => sprintf($this->translate('Show dashlet %s'), $dashlet->getTitle()))
['title' => sprintf($this->translate('Show dashlet %s'), $dashlet->getTitle())]
); ?>
</td>
<td>
<?= $this->qlink(
'',
'dashboard/remove-dashlet',
array('pane' => $pane->getName(), 'dashlet' => $dashlet->getName()),
array(
['pane' => $pane->getName(), 'dashlet' => $dashlet->getName()],
[
'icon' => 'cancel',
'class' => 'action-link',
'title' => sprintf($this->translate('Remove dashlet %s from pane %s'), $dashlet->getTitle(), $pane->getTitle())
)
]
); ?>
</td>
</tr>

View file

@ -27,25 +27,25 @@ $this->escape($form->getAction())
<?= $this->qlink(
$backendNames[$i],
'config/edituserbackend',
array('backend' => $backendNames[$i]),
array(
['backend' => $backendNames[$i]],
[
'icon' => $type === 'external' ?
'magic' : ($type === 'ldap' || $type === 'msldap' ? 'sitemap' : 'database'),
'class' => 'rowaction',
'title' => sprintf($this->translate('Edit user backend %s'), $backendNames[$i])
)
]
) ?>
</td>
<td class="icon-col text-right">
<?= $this->qlink(
'',
'config/removeuserbackend',
array('backend' => $backendNames[$i]),
array(
['backend' => $backendNames[$i]],
[
'class' => 'action-link',
'icon' => 'cancel',
'title' => sprintf($this->translate('Remove user backend %s'), $backendNames[$i])
)
]
) ?>
</td>
<td class="icon-col text-right" data-base-target="_self">

View file

@ -31,12 +31,12 @@ if (! isset($backend)) {
<?= $this->qlink(
$this->translate('Add a New User Group'),
'group/add',
array('backend' => $backend->getName()),
array(
['backend' => $backend->getName()],
[
'class' => 'button-link',
'data-base-target' => '_next',
'icon' => 'plus'
)
]
) ?>
<?php endif ?>
@ -60,16 +60,16 @@ if (! isset($backend)) {
<?= $this->qlink(
$group->group_name,
'group/show',
array(
[
'backend' => $backend->getName(),
'group' => $group->group_name
),
array(
],
[
'title' => sprintf(
$this->translate('Show detailed information for user group %s'),
$group->group_name
)
)
]
); ?>
</td>
<?php if ($reducible): ?>
@ -77,15 +77,15 @@ if (! isset($backend)) {
<?= $this->qlink(
null,
'group/remove',
array(
[
'backend' => $backend->getName(),
'group' => $group->group_name
),
array(
],
[
'class' => 'action-link',
'title' => sprintf($this->translate('Remove user group %s'), $group->group_name),
'icon' => 'cancel'
)
]
); ?>
</td>
<?php endif ?>

View file

@ -10,15 +10,15 @@ if ($this->hasPermission('config/access-control/groups') && $backend instanceof
$editLink = $this->qlink(
null,
'group/edit',
array(
[
'backend' => $backend->getName(),
'group' => $group->group_name
),
array(
],
[
'title' => sprintf($this->translate('Edit group %s'), $group->group_name),
'class' => 'group-edit',
'icon' => 'edit'
)
]
);
}
@ -53,14 +53,14 @@ if ($this->hasPermission('config/access-control/groups') && $backend instanceof
<?= $this->qlink(
$this->translate('Add New Member'),
'group/addmember',
array(
[
'backend' => $backend->getName(),
'group' => $group->group_name
),
array(
],
[
'icon' => 'plus',
'class' => 'button-link'
)
]
) ?>
<?php endif ?>
@ -86,12 +86,12 @@ if ($this->hasPermission('config/access-control/groups') && $backend instanceof
$this->hasPermission('config/access-control/users')
&& ($userBackend = $backend->getUserBackendName($member->user_name)) !== null
): ?>
<?= $this->qlink($member->user_name, 'user/show', array(
<?= $this->qlink($member->user_name, 'user/show', [
'backend' => $userBackend,
'user' => $member->user_name
), array(
], [
'title' => sprintf($this->translate('Show detailed information about %s'), $member->user_name)
)); ?>
]); ?>
<?php else: ?>
<?= $this->escape($member->user_name); ?>
<?php endif ?>

View file

@ -40,10 +40,10 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :
<?= $this->qlink(
'',
Url::fromRequest(),
array(
[
'page' => $currentXAxisPage . ',' . $prevYAxisPage
),
array(
],
[
'icon' => 'up-open',
'data-base-target' => '_self',
'title' => sprintf(
@ -54,7 +54,7 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :
$prevYAxisPage * $yAxisPages->itemCountPerPage,
$yAxisPages->totalItemCount
)
)
]
); ?>
<?php else: ?>
<?= $this->icon('up-open'); ?>
@ -68,10 +68,10 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :
<?= $this->qlink(
'',
Url::fromRequest(),
array(
[
'page' => $prevXAxisPage . ',' . $currentYAxisPage
),
array(
],
[
'icon' => 'left-open',
'data-base-target' => '_self',
'title' => sprintf(
@ -82,7 +82,7 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :
$prevXAxisPage * $xAxisPages->itemCountPerPage,
$xAxisPages->totalItemCount
)
)
]
); ?>
<?php else: ?>
<?= $this->icon('left-open'); ?>
@ -93,11 +93,11 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :
'',
$flipUrl,
null,
array(
[
'icon' => 'arrows-cw',
'data-base-target' => '_self',
'title' => $this->translate('Flip grid axes')
)
]
) ?></td>
<?php else: ?>
<td>&nbsp;</td>
@ -107,10 +107,10 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :
<?= $this->qlink(
'',
Url::fromRequest(),
array(
[
'page' => $nextXAxisPage . ',' . $currentYAxisPage
),
array(
],
[
'icon' => 'right-open',
'data-base-target' => '_self',
'title' => sprintf(
@ -121,7 +121,7 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :
$nextXAxisPage === $xAxisPages->last ? $xAxisPages->totalItemCount : $nextXAxisPage * $xAxisPages->itemCountPerPage,
$xAxisPages->totalItemCount
)
),
],
false
); ?>
<?php else: ?>
@ -136,10 +136,10 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :
<?= $this->qlink(
'',
Url::fromRequest(),
array(
[
'page' => $currentXAxisPage . ',' . $nextYAxisPage
),
array(
],
[
'icon' => 'down-open',
'data-base-target' => '_self',
'title' => sprintf(
@ -150,7 +150,7 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :
$nextYAxisPage === $yAxisPages->last ? $yAxisPages->totalItemCount : $nextYAxisPage * $yAxisPages->itemCountPerPage,
$yAxisPages->totalItemCount
)
)
]
); ?>
<?php else: ?>
<?= $this->icon('down-open'); ?>

View file

@ -10,7 +10,7 @@
$this->totalItemCount
) ?>
<li class="nav-item">
<a href="<?= $this->escape($this->url()->overwriteParams(array('page' => $this->previous))->getAbsoluteUrl()) ?>"
<a href="<?= $this->escape($this->url()->overwriteParams(['page' => $this->previous])->getAbsoluteUrl()) ?>"
title="<?= $label ?>"
aria-label="<?= $label ?>"
class="previous-page">
@ -44,7 +44,7 @@
);
?>
<li<?= $page === $this->current ? ' class="active nav-item"' : ' class="nav-item"' ?>>
<a href="<?= $this->escape($this->url()->overwriteParams(array('page' => $page))->getAbsoluteUrl()) ?>"
<a href="<?= $this->escape($this->url()->overwriteParams(['page' => $page])->getAbsoluteUrl()) ?>"
title="<?= $label ?>"
aria-label="<?= $label ?>">
<?= $page ?>
@ -60,7 +60,7 @@
$this->totalItemCount
) ?>
<li class="nav-item">
<a href="<?= $this->escape($this->url()->overwriteParams(array('page' => $this->next))->getAbsoluteUrl()) ?>"
<a href="<?= $this->escape($this->url()->overwriteParams(['page' => $this->next])->getAbsoluteUrl()) ?>"
title="<?= $label ?>"
aria-label="<?= $label ?>"
class="next-page">

View file

@ -15,7 +15,7 @@ use ipl\Web\Widget\Icon;
if (Str::startsWith($item->getIcon(), 'fa-') || substr($item->getUrl()->getPath(), 0, 9) === 'icingadb/') {
echo new Icon($item->getIcon() ?: 'share', [ 'aria-hidden' => 1]);
} else {
echo $this->icon($item->getIcon() ?: 'forward', null, array('aria-hidden' => true));
echo $this->icon($item->getIcon() ?: 'forward', null, ['aria-hidden' => true]);
}
?>
</div>

View file

@ -12,12 +12,12 @@
$this->translate('Create a New Navigation Item') ,
'navigation/add',
null,
array(
[
'class' => 'button-link',
'data-base-target' => '_next',
'icon' => 'plus',
'title' => $this->translate('Create a new navigation item')
)
]
) ?>
<?php if (count($items) === 0): ?>
<p><?= $this->translate('You did not create any navigation item yet.') ?></p>
@ -39,13 +39,13 @@
<?= $this->qlink(
$item->name,
'navigation/edit',
array(
[
'name' => $item->name,
'type' => $item->type
),
array(
],
[
'title' => sprintf($this->translate('Edit navigation item %s'), $item->name)
)
]
) ?>
</td>
<td>
@ -60,15 +60,15 @@
<?= $this->qlink(
'',
'navigation/remove',
array(
[
'name' => $item->name,
'type' => $item->type
),
array(
],
[
'class' => 'action-link',
'icon' => 'cancel',
'title' => sprintf($this->translate('Remove navigation item %s'), $item->name)
)
]
) ?>
</td>
</tr>

View file

@ -27,15 +27,15 @@ if (! $this->compact): ?>
<td><?= $this->qlink(
$item->name,
'navigation/edit',
array(
[
'name' => $item->name,
'type' => $item->type,
'owner' => $item->owner,
'referrer' => 'shared'
),
array(
],
[
'title' => sprintf($this->translate('Edit shared navigation item %s'), $item->name)
)
]
); ?></td>
<td><?= $item->type && isset($types[$item->type])
? $this->escape($types[$item->type])
@ -57,7 +57,7 @@ if (! $this->compact): ?>
->setDefault('name', $item->name)
->setAction(Url::fromPath(
'navigation/unshare',
array('type' => $item->type, 'owner' => $item->owner)
['type' => $item->type, 'owner' => $item->owner]
)); ?></td>
<?php endif ?>
</tr>

View file

@ -22,7 +22,7 @@ $yAxisPages = $yAxisPaginator->getPages('all');
<td<?= $xAxisPage === $xAxisPages->current && $yAxisPage === $yAxisPages->current ? ' class="active"' : ''; ?>>
<?php if ($xAxisPage !== $xAxisPages->current || $yAxisPage !== $yAxisPages->current): ?>
<a href="<?= Url::fromRequest()->overwriteParams(
array('page' => $xAxisPage . ',' . $yAxisPage)
['page' => $xAxisPage . ',' . $yAxisPage]
)->getAbsoluteUrl(); ?>" title="<?= sprintf(
$fromTo,
t('Hosts'),

View file

@ -12,12 +12,12 @@
$this->translate('Create a New Role') ,
'role/add',
null,
array(
[
'class' => 'button-link',
'data-base-target' => '_next',
'icon' => 'plus',
'title' => $this->translate('Create a new role')
)
]
) ?>
<?php /** @var \Icinga\Application\Config $roles */ if (! $roles->hasResult()): ?>
<p><?= $this->translate('No roles found.') ?></p>
@ -39,8 +39,8 @@
<?= $this->qlink(
$name,
'role/edit',
array('role' => $name),
array('title' => sprintf($this->translate('Edit role %s'), $name))
['role' => $name],
['title' => sprintf($this->translate('Edit role %s'), $name)]
) ?>
</td>
<td><?= $this->escape($role->users) ?></td>
@ -50,12 +50,12 @@
<?= $this->qlink(
'',
'role/remove',
array('role' => $name),
array(
['role' => $name],
[
'class' => 'action-link',
'icon' => 'cancel',
'title' => sprintf($this->translate('Remove role %s'), $name)
)
]
) ?>
</td>
</tr>

View file

@ -31,12 +31,12 @@ if (! isset($backend)) {
<?= $this->qlink(
$this->translate('Add a New User') ,
'user/add',
array('backend' => $backend->getName()),
array(
['backend' => $backend->getName()],
[
'class' => 'button-link',
'data-base-target' => '_next',
'icon' => 'plus'
)
]
) ?>
<?php endif ?>
@ -60,27 +60,27 @@ if (! isset($backend)) {
<td><?= $this->qlink(
$user->user_name,
'user/show',
array(
[
'backend' => $backend->getName(),
'user' => $user->user_name
),
array(
],
[
'title' => sprintf($this->translate('Show detailed information about %s'), $user->user_name)
)
]
) ?></td>
<?php if ($reducible): ?>
<td class="icon-col"><?= $this->qlink(
null,
'user/remove',
array(
[
'backend' => $backend->getName(),
'user' => $user->user_name
),
array(
],
[
'class' => 'action-link',
'icon' => 'cancel',
'title' => sprintf($this->translate('Remove user %s'), $user->user_name)
)
]
) ?></td>
<?php endif ?>
</tr>

View file

@ -15,15 +15,15 @@ use Icinga\Data\Selectable;
echo $this->qlink(
$this->translate('Edit User'),
'user/edit',
array(
[
'backend' => $backend->getName(),
'user' => $user->user_name
),
array(
],
[
'class' => 'button-link',
'icon' => 'edit',
'title' => sprintf($this->translate('Edit user %s'), $user->user_name)
)
]
);
}
?>
@ -83,14 +83,14 @@ use Icinga\Data\Selectable;
<?= $this->qlink(
$this->translate('Create New Membership'),
'user/createmembership',
array(
[
'backend' => $backend->getName(),
'user' => $user->user_name
),
array(
],
[
'icon' => 'plus',
'class' => 'button-link'
)
]
) ?>
<?php endif ?>
@ -111,22 +111,22 @@ use Icinga\Data\Selectable;
<tr>
<td>
<?php if ($this->hasPermission('config/access-control/groups') && $membership->backend instanceof Selectable): ?>
<?= $this->qlink($membership->group_name, 'group/show', array(
<?= $this->qlink($membership->group_name, 'group/show', [
'backend' => $membership->backend->getName(),
'group' => $membership->group_name
), array(
], [
'title' => sprintf($this->translate('Show detailed information for group %s'), $membership->group_name)
)); ?>
]); ?>
<?php else: ?>
<?= $this->escape($membership->group_name); ?>
<?php endif ?>
</td>
<td class="icon-col" data-base-target="_self">
<?php if (isset($removeForm) && $membership->backend instanceof Reducible): ?>
<?= $removeForm->setAction($this->url('group/removemember', array(
<?= $removeForm->setAction($this->url('group/removemember', [
'backend' => $membership->backend->getName(),
'group' => $membership->group_name
))); ?>
])); ?>
<?php else: ?>
-
<?php endif ?>