monitoring/viewscripts: avoid errors in comments

PHP code may cause errors even if sitting in HTML comments. Also fixed a
HTML nesting error in list/servicematrix and reduced indentation.
This commit is contained in:
Thomas Gelf 2014-05-20 22:26:21 +00:00
parent 8b28bdc82a
commit 79f3b32474
2 changed files with 45 additions and 47 deletions

View File

@ -1,9 +1,7 @@
<div class="controls"> <div class="controls">
<?= $this->tabs->render($this); ?> <?= $this->tabs->render($this); ?>
<div style="margin: 1em" class="dontprint"> <div style="margin: 1em" class="dontprint">
<!--<?= $this->filterBox->render($this); ?>-->
Sort by <?= $this->sortControl->render($this); ?> Sort by <?= $this->sortControl->render($this); ?>
<!--<?= $this->selectionToolbar('single'); ?>-->
</div> </div>
<?= $this->paginationControl($history, null, null, array('preserve' => $this->preserve)); ?> <?= $this->paginationControl($history, null, null, array('preserve' => $this->preserve)); ?>
</div> </div>

View File

@ -2,7 +2,7 @@
<div class="controls"> <div class="controls">
<?= $this->tabs; ?> <?= $this->tabs; ?>
<div style="margin: 1em;" class="dontprint"> <div style="margin: 1em;" class="dontprint">
<!--<?= $this->filterBox; ?>-->Sort by <?= $this->sortControl->render($this); ?> <!--<?= $this->filterBox ?>-->Sort by <?= $this->sortControl ?>
</div> </div>
<?= $this->partial( <?= $this->partial(
'pivottablePagination.phtml', 'pivottablePagination.phtml',
@ -15,7 +15,7 @@
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content" data-base-target="_next"> <div class="content" data-base-target="_next">
<table class="pivot servicestates"> <table class="pivot servicestates">
<?php <?php
$hasHeader = false; $hasHeader = false;
$pivotData = $this->pivot->toArray(); $pivotData = $this->pivot->toArray();
@ -23,57 +23,57 @@ $hostFilter = implode(',', array_keys($pivotData));
?> ?>
<?php foreach ($pivotData as $host_name => $serviceStates): ?> <?php foreach ($pivotData as $host_name => $serviceStates): ?>
<?php if (!$hasHeader): ?> <?php if (!$hasHeader): ?>
<thead> <thead>
<tr> <tr>
<th>&nbsp;</th> <th>&nbsp;</th>
<th colspan="<?= count($serviceStates); ?>"> <th colspan="<?= count($serviceStates); ?>">
<div> <div>
<?php foreach (array_keys($serviceStates) as $service_description): ?> <?php foreach (array_keys($serviceStates) as $service_description): ?>
<span> <span>
<a href="<?= $this->href( <a href="<?= $this->href(
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_description' => $service_description, 'service_description' => $service_description,
'host_name' => $hostFilter 'host_name' => $hostFilter
) )
); ?>"> ); ?>">
<abbr title="<?= $service_description; ?>"> <abbr title="<?= $service_description; ?>"><?=
<?= strlen($service_description) > 18 ? substr($service_description, 0, 18) . '...' : $service_description; ?> strlen($service_description) > 18 ?
</abbr> substr($service_description, 0, 18) . '...' :
</a> $service_description
</span> ?></abbr>
</a>
</span>
<?php endforeach ?> <?php endforeach ?>
</div> </div>
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php $hasHeader = true; ?> <?php $hasHeader = true; ?>
<?php endif ?> <?php endif ?>
<tr> <tr>
<th> <th>
<a href="<?= $this->href('monitoring/show/host', array('host' => $host_name)); ?>"> <a href="<?=
<?= $host_name; ?> $this->href('monitoring/show/host', array('host' => $host_name))
</a> ?>"><?= $host_name ?></a>
</th> </th>
<?php foreach (array_values($serviceStates) as $service): ?> <?php foreach (array_values($serviceStates) as $service): ?>
<?php if ($service !== null): ?> <?php if ($service !== null): ?>
<td> <td>
<a href="<?= $this->href( <a href="<?= $this->href('monitoring/show/service', array(
'monitoring/show/service', 'host' => $service->host_name,
array( 'service' => $service->service_description
'host' => $service->host_name, )) ?>" title="<?= $this->escape($service->service_output)
'service' => $service->service_description ?>" class="state_<?= $this->monitoringState($service, 'service') ?> <?= $service->service_handled ? 'handled' : '' ?>"></a>
) </td>
); ?>" title="<?= $this->escape($service->service_output); ?>" class="state_<?= $this->monitoringState($service, 'service'); ?> <?= $service->service_handled ? 'handled' : ''; ?>"></a>
<?php else: ?> <?php else: ?>
<td> <td>&middot;</td>
&middot;
<?php endif ?> <?php endif ?>
</td>
<?php endforeach ?> <?php endforeach ?>
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>
</tbody> </tbody>
</table> </table>
</div> </div>