summaryrefslogtreecommitdiffstats
path: root/modules/monitoring/application/views/scripts/form/reorder-command-transports.phtml
blob: 2f81610faef1fad22185060b27d3fde4531d978b (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
84
85
86
87
88
89
90
91
92
93
<?php
/** @var \Icinga\Web\View $this */
/** @var \Icinga\Module\Monitoring\Forms\Config\TransportReorderForm $form */
?>
<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>
            <tr>
                <th><?= $this->translate('Transport') ?></th>
                <th></th>
                <th></th>
            </tr>
        </thead>
        <tbody>
        <?php
        $i = -1;
        $transportConfig = $form->getConfig();
        $total = $transportConfig->count();
        foreach ($transportConfig as $transportName => $config):
            ++$i;
        ?>
            <tr>
                <td>
                    <?= $this->qlink(
                        $transportName,
                        'monitoring/config/edittransport',
                        array('transport' => $transportName),
                        array(
                            'icon'  => 'edit',
                            'title' => sprintf($this->translate('Edit command transport %s'), $transportName)
                        )
                    ); ?>
                    <span class="config-label-meta">&#40;<?= sprintf(
                            $this->translate('Type: %s'),
                            ucfirst($config->get('transport', 'local'))
                        ) ?>&#41;
                    </span>
                </td>
                <td class="text-right">
                    <?= $this->qlink(
                        '',
                        'monitoring/config/removetransport',
                        array('transport' => $transportName),
                        array(
                            'class' => 'action-link',
                            'icon'  => 'cancel',
                            'title' => sprintf($this->translate('Remove command transport %s'), $transportName)
                        )
                    ); ?>
                </td>
                <td class="icon-col text-right" data-base-target="_self">
                    <?php if ($i > 0): ?>
                        <button type="submit" name="transport_newpos" class="link-button icon-only animated move-up" value="<?= $this->escape(
                            ($i - 1) . '|' . $transportName
                        ) ?>" title="<?= $this->translate(
                            'Move up in order'
                        ) ?>" aria-label="<?= $this->escape(sprintf(
                            $this->translate('Move command transport %s upwards'),
                            $transportName
                        )) ?>"><?=
                            $this->icon('up-small')
                        ?></button>
                    <?php endif ?>
                    <?php if ($i + 1 < $total): ?>
                        <button type="submit" name="transport_newpos" class="link-button icon-only animated move-down" value="<?= $this->escape(
                            ($i + 1) . '|' . $transportName
                        ) ?>" title="<?= $this->translate(
                            'Move down in order'
                        ) ?>" aria-label="<?= $this->escape(sprintf(
                            $this->translate('Move command transport %s downwards'),
                            $transportName
                        )) ?>"><?=
                            $this->icon('down-small')
                        ?></button>
                    <?php endif ?>
                </td>
            </tr>
        <?php endforeach ?>
        </tbody>
    </table>
    <?= $form->getElement($form->getTokenElementName()) ?>
    <?= $form->getElement($form->getUidElementName()) ?>
</form>