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

78 lines
2.8 KiB
PHTML

<form id="<?= $form->getId(); ?>" name="<?= $form->getName(); ?>" enctype="<?= $form->getEncType(); ?>" method="<?= $form->getMethod(); ?>" action="<?= $form->getAction(); ?>">
<table class="action-table listing-table">
<thead>
<th><?= $this->translate('Backend') ?></th>
<th></th>
<th></th>
</thead>
<tbody>
<?php
$backendNames = $form->getBackendOrder();
$backendConfigs = $form->getConfig();
for ($i = 0; $i < count($backendNames); $i++):
$type = $backendConfigs->getSection($backendNames[$i])->get('backend');
?>
<tr>
<td class="action">
<?= $this->qlink(
$backendNames[$i],
'config/edituserbackend',
array('backend' => $backendNames[$i]),
array(
'icon' => $type === 'external' ?
'magic' : ($type === 'ldap' || $type === 'msldap' ? 'sitemap' : 'database'),
'class' => 'rowaction',
'title' => sprintf($this->translate('rEdit user backend %s'), $backendNames[$i])
)
); ?>
</td>
<td class="text-right">
<?= $this->qlink(
'',
'config/removeuserbackend',
array('backend' => $backendNames[$i]),
array(
'class' => 'action-link',
'icon' => 'cancel',
'title' => sprintf($this->translate('Remove user backend %s'), $backendNames[$i])
)
); ?>
</td>
<td class="text-right" data-base-target="_self">
<?php if ($i > 0): ?>
<button type="submit" name="backend_newpos" class="link-like icon-only animated move-up" value="<?= sprintf(
'%s|%s',
$backendNames[$i],
$i - 1
); ?>" title="<?= $this->translate(
'Move up in authentication order'
); ?>" aria-label="<?= sprintf(
$this->translate('Move user backend %s upwards'),
$backendNames[$i]
); ?>">
<?= $this->icon('up-small'); ?>
</button>
<?php endif; ?>
<?php if ($i + 1 < count($backendNames)): ?>
<button type="submit" name="backend_newpos" class="link-like icon-only animated move-down" value="<?= sprintf(
'%s|%s',
$backendNames[$i],
$i + 1
); ?>" title="<?= $this->translate(
'Move down in authentication order'
); ?>" aria-label="<?= sprintf(
$this->translate('Move user backend %s downwards'),
$backendNames[$i]
); ?>">
<?= $this->icon('down-small'); ?>
</button>
<?php endif; ?>
</td>
</tr>
<?php endfor; ?>
</tbody>
</table>
<?= $form->getElement($form->getTokenElementName()); ?>
<?= $form->getElement($form->getUidElementName()); ?>
</form>