icingaweb2/application/views/scripts/form/reorder-authbackend.phtml

71 lines
2.5 KiB
PHTML

<form id="<?= $form->getId(); ?>" name="<?= $form->getName(); ?>" enctype="<?= $form->getEncType(); ?>" method="<?= $form->getMethod(); ?>" action="<?= $form->getAction(); ?>">
<table class="action">
<thead>
<th>Backend</th>
<th style="width: 5em"><?= $this->translate('Remove'); ?></th>
<th style="width: 5em"><?= $this->translate('Order'); ?></th>
</thead>
<tbody>
<?php $backendNames = $form->getBackendOrder(); ?>
<?php for ($i = 0; $i < count($backendNames); $i++): ?>
<tr>
<td class="action">
<?= $this->qlink(
$backendNames[$i],
'config/editAuthenticationBackend',
array('auth_backend' => $backendNames[$i]),
array(
'icon' => 'edit',
'title' => sprintf($this->translate('Edit authentication backend %s'), $backendNames[$i])
)
); ?>
</td>
<td>
<?= $this->qlink(
'',
'config/removeAuthenticationBackend',
array('auth_backend' => $backendNames[$i]),
array(
'icon' => 'trash',
'title' => sprintf($this->translate('Remove authentication backend %s'), $backendNames[$i])
)
); ?>
</td>
<td data-base-target="_self">
<?php if ($i > 0): ?>
<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
); ?>" 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>
</tr>
<?php endfor; ?>
</tbody>
</table>
<?= $form->getElement($form->getTokenElementName()); ?>
<?= $form->getElement($form->getUidElementName()); ?>
</form>