icingaweb2-module-businessp.../application/views/scripts/process/toplevel.phtml

48 lines
1.6 KiB
PHTML
Raw Normal View History

2014-11-30 06:20:39 -05:00
<?php
use Icinga\Module\Businessprocess\ImportedNode;
use Icinga\Module\Businessprocess\BpNode;
2014-11-30 06:20:39 -05:00
$count = $this->bp->countChildren();
$howMany = 'normal';
if ($count < 20) {
$howMany = 'few';
} elseif ($count > 50) {
$howMany = 'many';
}
?>
<?php if (! $this->compact): ?>
2014-11-30 06:20:39 -05:00
<div class="controls">
<?= $this->tabs ?>
<h1><form method="post" action="<?= $this->url()->without('node')->without('unlocked') ?>">
<?= $this->formSelect('config', $this->configName, array('class' => 'autosubmit'), $this->processList) ?>
2015-03-16 04:08:00 -04:00
</form>
2014-11-30 06:20:39 -05:00
<a href="<?= $this->url()->without('mode') ?>" title="<?= $this->escape('Switch to tree view') ?>" style="float: right"><?= $this->icon('sitemap') ?></a>
</h1>
</div>
<?php endif ?>
2014-11-30 06:20:39 -05:00
<div class="content<?= $this->compact ? ' compact' : '' ?>" data-base-target="_next">
2014-11-30 06:20:39 -05:00
<div class="toplevel <?= $howMany ?>" data-base-target="_next">
<?php foreach ($this->bp->getChildren() as $name => $node): ?>
<div class="<?= strtolower($node->getStateName()) ?><?= $node->isHandled() ? ' handled' : '' ?>">
<?php if ($node instanceof ImportedNode): ?>
<a href="<?= $this->url('businessprocess/process/show', array('config' => $node->getConfigName(), 'node' => $name)) ?>">
<?php else: ?>
<a href="<?= $this->url('businessprocess/process/show', array('config' => $this->configName, 'node' => $name)) ?>">
<?php endif ?>
<?= $this->escape($node->getAlias()) ?><?php
if ($node instanceof BpNode) {
echo $this->renderStateBadges($node->getStateSummary());
}
?></a>
2014-11-30 06:20:39 -05:00
</div>
<?php endforeach ?>
</div>
<?= $this->render('warnings.phtml') ?>
</div>