icingaweb2/modules/setup/application/views/scripts/form/setup-requirements.phtml

67 lines
2.1 KiB
PHTML
Raw Normal View History

2014-09-29 12:26:54 +02:00
<?php
use \RecursiveIteratorIterator;
2014-09-29 12:26:54 +02:00
use Icinga\Web\Wizard;
$requirements = $form->getRequirements();
$iterator = new RecursiveIteratorIterator($requirements);
2014-09-29 12:26:54 +02:00
?>
<table class="requirements">
2014-09-29 12:26:54 +02:00
<tbody>
<?php foreach ($iterator as $requirement): ?>
2014-09-29 12:26:54 +02:00
<tr>
<td><h2><?= $requirement->getTitle(); ?></h2></td>
<td style="width: 50%">
<?php $descriptions = $requirement->getDescriptions(); ?>
<?php if (count($descriptions) > 1): ?>
<ul>
<?php foreach ($descriptions as $desc): ?>
<li><?= $desc; ?></li>
<?php endforeach ?>
</ul>
<?php elseif (! empty($descriptions)): ?>
<?= $descriptions[0]; ?>
<?php endif ?>
</td>
<td class="state <?= $requirement->getState() ? 'fulfilled' : (
$requirement->isOptional() ? 'not-available' : 'missing'
); ?>"><?= $requirement->getStateText(); ?></td>
2014-09-29 12:26:54 +02:00
</tr>
<?php endforeach ?>
<tr>
<td></td>
<td></td>
<td class="btn-update">
<div class="buttons">
<?php $title = $this->translate('You may also need to restart the web-server for the changes to take effect!'); ?>
<?= $this->qlink(
$this->translate('Refresh'),
null,
null,
array(
'class' => 'button-like',
'title' => $title,
'aria-label' => sprintf($this->translate('Refresh the page; %s'), $title)
)
); ?>
</div>
</td>
</tr>
2014-09-29 12:26:54 +02:00
</tbody>
</table>
<form id="<?= $form->getName(); ?>" name="<?= $form->getName(); ?>" enctype="<?= $form->getEncType(); ?>" method="<?= $form->getMethod(); ?>" action="<?= $form->getAction(); ?>">
2014-09-29 12:26:54 +02:00
<?= $form->getElement($form->getTokenElementName()); ?>
<?= $form->getElement($form->getUidElementName()); ?>
<div class="buttons" style="margin: 0 0 1.5em;">
<?= $form->getElement(Wizard::BTN_PREV); ?>
<?php
$btn = $form->getElement(Wizard::BTN_NEXT);
if (false === $requirements->fulfilled()) {
$btn->setAttrib('disabled', 1);
}
echo $btn;
?>
</div>
2014-11-13 17:20:06 +01:00
</form>