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

38 lines
1012 B
PHTML
Raw Normal View History

<?php
use Icinga\Web\Url;
$this->modules->limit(10);
$modules = $this->modules->paginate();
?>
<?= $this->tabs->render($this); ?>
<h3>Installed Modules</h3>
<?= $this->paginationControl($modules, null, null, array(
'preserve' => $this->preserve
));
?>
<table class="table">
<tbody>
<? foreach ($modules as $module): ?>
<?php
$enableUrl = Url::fromPath('config/moduleenable/',array('name' => $module->name))->getAbsoluteUrl();
$disableUrl = Url::fromPath('config/moduledisable/',array('name' => $module->name))->getAbsoluteUrl();
?>
<tr>
<td>
<? if ($module->enabled): ?>
<i>ICON OK</i>
<a href="<?= $disableUrl ?>"><?= $this->escape($module->name); ?></a>
<? else: ?>
<i>ICON REMOVE</i>
<a href="<?= $enableUrl ?>"><?= $this->escape($module->name); ?></a>
<? endif ?>
(<?=
$module->enabled ? ($module->loaded ? 'enabled' : 'failed') : 'disabled' ?>)
</td>
</tr>
<? endforeach ?>
</tbody>
</table>