summaryrefslogtreecommitdiffstats
path: root/application/views/scripts/form/reorder-authbackend.phtml
blob: 34b10b323db858a0c403d053a29838bdc8b41206 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<form id="<?=
$this->escape($form->getId())
?>" name="<?=
$this->escape($form->getName())
?>" enctype="<?=
$this->escape($form->getEncType())
?>" method="<?=
$this->escape($form->getMethod())
?>" action="<?=
$this->escape($form->getAction())
?>">
  <table class="table-row-selectable common-table" data-base-target="_next">
    <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('Edit user backend %s'), $backendNames[$i])
            )
          ) ?>
        </td>
        <td class="icon-col 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="icon-col text-right" data-base-target="_self">
<?php if ($i > 0): ?>
          <button type="submit" name="backend_newpos" class="link-button icon-only animated move-up" value="<?= $this->escape(
            $backendNames[$i] . '|' . ($i - 1)
          ) ?>" title="<?= $this->translate(
            'Move up in authentication order'
          ) ?>" aria-label="<?= $this->escape(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-button icon-only animated move-down" value="<?= $this->escape(
            $backendNames[$i] . '|' . ($i + 1)
          ) ?>" title="<?= $this->translate(
            'Move down in authentication order'
          ) ?>" aria-label="<?= $this->escape(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>