icingaweb2/application/views/scripts/config/module.phtml

71 lines
2.2 KiB
PHTML

<div class="controls">
<?= $this->tabs ?>
</div>
<div class="content">
<?php if (! $module): ?>
<?= $this->translate('There is no such module installed.') ?>
<?php return; endif ?>
<?php
$dependencies = $module->getDependencies();
$restrictions = $module->getProvidedRestrictions();
$permissions = $module->getProvidedPermissions();
$state = $moduleData->enabled ? ($moduleData->loaded ? 'enabled' : 'failed') : 'disabled'
?>
<h1><?= $this->escape($module->getTitle()) ?></h1>
<table class="avp">
<tr>
<th><?= $this->escape('Name') ?></th>
<td><?= $this->escape($module->getName()) ?></td>
</tr>
<tr>
<th><?= $this->translate('State') ?></th>
<td><?= $state ?><?php if ($state === 'enabled'): ?>
<?= $this->qlink('disable', 'config/moduledisable', array(
'name' => $module->getName()
)) ?>
<?php endif ?>
<?php if ($state === 'disabled'): ?>
<?= $this->qlink('enable', 'config/moduleenable', array(
'name' => $module->getName()
)) ?>
<?php endif ?>
</td>
<tr>
<th><?= $this->escape('Version') ?></th>
<td><?= $this->escape($module->getVersion()) ?></td></tr>
<tr>
<th><?= $this->escape('Description') ?></th>
<td><?= nl2br($this->escape($module->getDescription())) ?></td>
</tr>
<tr>
<th><?= $this->escape('Dependencies') ?></th>
<td><?php
if (empty($dependencies)):
echo $this->translate('This module has no dependencies');
else: foreach ($dependencies as $name => $versionString): ?>
<strong><?= $this->escape($name) ?></strong><?php if ($versionString !== true): ?>: <?= $this->escape($versionString) ?><?php endif ?><br />
<?php endforeach; endif ?></td>
</tr>
<?php if (! empty($permissions)): ?>
<tr>
<th><?= $this->escape('Permissions') ?></th>
<td><?php foreach ($permissions as $permission): ?>
<strong><?= $this->escape($permission->name) ?></strong>: <?= $this->escape($permission->description) ?><br />
<?php endforeach ?></td>
</tr>
<?php endif ?>
<?php if (! empty($restrictions)): ?>
<tr>
<th><?= $this->escape('Restrictions') ?></th>
<td><?php foreach ($restrictions as $restriction): ?>
<strong><?= $this->escape($restriction->name) ?></strong>: <?= $this->escape($restriction->description) ?><br />
<?php endforeach ?></td>
</tr>
<?php endif ?>
</table>
</div>