summaryrefslogtreecommitdiffstats
path: root/application/views/scripts/group/list.phtml
blob: d362db4e35ed00e930a9df96f178d8609abe53eb (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
94
95
96
<?php

use Icinga\Data\Extensible;
use Icinga\Data\Reducible;

if (! $this->compact): ?>
<div class="controls separated">
    <?= $this->tabs ?>
    <?= $this->paginator ?>
    <div class="sort-controls-container">
        <?= $this->limiter ?>
        <?= $this->sortBox ?>
    </div>
    <?= $this->backendSelection ?>
    <?= $this->filterEditor ?>
</div>
<?php endif ?>
<div class="content">
<?php

if (! isset($backend)) {
    echo $this->translate('No backend found which is able to list user groups') . '</div>';
    return;
} else {
    $extensible = $this->hasPermission('config/access-control/groups') && $backend instanceof Extensible;
    $reducible = $this->hasPermission('config/access-control/groups') && $backend instanceof Reducible;
}
?>

<?php if ($extensible): ?>
    <?= $this->qlink(
        $this->translate('Add a New User Group'),
        'group/add',
        array('backend' => $backend->getName()),
        array(
            'class'             => 'button-link',
            'data-base-target'  => '_next',
            'icon'              => 'plus'
        )
    ) ?>
<?php endif ?>

<?php if (! $groups->hasResult()): ?>
    <p><?= $this->translate('No user groups found matching the filter'); ?></p>
</div>
<?php return; endif ?>
    <table data-base-target="_next" class="table-row-selectable common-table">
        <thead>
            <tr>
                <th><?= $this->translate('User Group'); ?></th>
            <?php if ($reducible): ?>
                <th><?= $this->translate('Remove'); ?></th>
            <?php endif ?>
            </tr>
        </thead>
        <tbody>
        <?php foreach ($groups as $group): ?>
            <tr>
                <td>
                    <?= $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): ?>
                <td class="icon-col">
                    <?= $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 ?>
            </tr>
        <?php endforeach ?>
        </tbody>
    </table>
</div>