2015-05-20 14:07:24 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Icinga\Data\Extensible;
|
|
|
|
use Icinga\Data\Reducible;
|
|
|
|
|
|
|
|
if (! $this->compact): ?>
|
2015-05-05 09:24:28 +02:00
|
|
|
<div class="controls">
|
|
|
|
<?= $this->tabs; ?>
|
|
|
|
<?= $this->sortBox; ?>
|
|
|
|
<?= $this->limiter; ?>
|
|
|
|
<?= $this->paginator; ?>
|
2015-05-08 09:56:07 +02:00
|
|
|
<div>
|
|
|
|
<?= $this->backendSelection; ?>
|
|
|
|
<?= $this->filterEditor; ?>
|
|
|
|
</div>
|
2015-05-05 09:24:28 +02:00
|
|
|
</div>
|
|
|
|
<?php endif ?>
|
2015-05-20 14:07:24 +02:00
|
|
|
<div class="content groups">
|
2015-05-05 09:24:28 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
if ($backend === null) {
|
|
|
|
echo $this->translate('No backend found which is able to list groups') . '</div>';
|
|
|
|
return;
|
2015-05-20 14:07:24 +02:00
|
|
|
} else {
|
|
|
|
$extensible = $backend instanceof Extensible;
|
|
|
|
$reducible = $backend instanceof Reducible;
|
2015-05-05 09:24:28 +02:00
|
|
|
}
|
|
|
|
|
2015-05-13 13:50:32 +02:00
|
|
|
if (! isset($groups)) {
|
|
|
|
echo $this->translate('Failed to fetch any groups') . '</div>';
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-05-20 14:07:24 +02:00
|
|
|
if (count($groups) > 0): ?>
|
2015-05-05 09:24:28 +02:00
|
|
|
<table data-base-target="_next" class="action group-list">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th class="group-name"><?= $this->translate('Group'); ?></th>
|
2015-05-20 14:07:24 +02:00
|
|
|
<?php if ($reducible): ?>
|
|
|
|
<th class="group-remove"><?= $this->translate('Remove'); ?></th>
|
|
|
|
<?php endif ?>
|
2015-05-05 09:24:28 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<?php foreach ($groups as $group): ?>
|
|
|
|
<tr>
|
|
|
|
<td clas="group-name"><?= $this->escape($group->group_name); ?></td>
|
2015-05-20 14:07:24 +02:00
|
|
|
<?php if ($reducible): ?>
|
|
|
|
<td class="group-remove">
|
|
|
|
<?= $this->qlink(
|
|
|
|
null,
|
|
|
|
'group/remove',
|
|
|
|
array(
|
|
|
|
'backend' => $backend->getName(),
|
|
|
|
'group' => $group->group_name
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'title' => sprintf($this->translate('Remove group %s'), $group->group_name),
|
|
|
|
'icon' => 'trash'
|
|
|
|
)
|
|
|
|
); ?>
|
|
|
|
</td>
|
|
|
|
<?php endif ?>
|
2015-05-05 09:24:28 +02:00
|
|
|
</tr>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2015-05-20 14:07:24 +02:00
|
|
|
<?php else: ?>
|
|
|
|
<p><?= $this->translate('No groups found matching the filter'); ?></p>
|
|
|
|
<?php endif ?>
|
|
|
|
<?php if ($extensible): ?>
|
|
|
|
<?= $this->qlink($this->translate('Add a new group'), 'group/add', array('backend' => $backend->getName()), array(
|
|
|
|
'icon' => 'plus',
|
|
|
|
'data-base-target' => '_next',
|
|
|
|
'class' => 'group-add'
|
|
|
|
)); ?>
|
|
|
|
<?php endif ?>
|
2015-05-05 09:24:28 +02:00
|
|
|
</div>
|