Fix PHP short open tags, DO NOT use <? ...

refs #4301
This commit is contained in:
Eric Lippmann 2013-06-27 13:13:31 +02:00
parent 6eade9c023
commit df7a3a4cbe
12 changed files with 73 additions and 73 deletions

View File

@ -1,7 +1,7 @@
<?php if (empty($this->hosts)): ?>
- no hosts is matching this filter -
<? return; endif ?>
<? $hosts = $this->hosts->paginate(); ?>
<?php return; endif; ?>
<?php $hosts = $this->hosts->paginate(); ?>
<table class="hosts action">
<thead>
<tr>
@ -10,7 +10,7 @@
</tr>
</thead>
<tbody>
<? foreach ($hosts as $host): ?>
<?php foreach ($hosts as $host): ?>
<?php
$icons = array();
@ -54,6 +54,6 @@ $state_title = strtoupper($this->monitoringState($host, 'host'))
array('class' => 'row-action')
) ?></td>
</tr>
<? endforeach ?>
<?php endforeach; ?>
</tbody>
</table>

View File

@ -43,9 +43,9 @@ if (isset($_GET['dir'])) {
$always['dir'] = $_GET['dir'];
}
?>
<? if (! empty($fparams)): ?>
<?php if (! empty($fparams)): ?>
<div style="float: right; width: 20em; font-size: 0.8em;"><b>Filters</b><br>
<? foreach ($fparams as $k => $v): ?>
<?php foreach ($fparams as $k => $v): ?>
<?= $this->qlink(
'x',
'monitoring/list/hosts',
@ -54,9 +54,9 @@ if (isset($_GET['dir'])) {
'style' => array('color' => 'red')
)
) ?> <?= $this->escape("$k = $v") ?></br>
<? endforeach ?>
<?php endforeach; ?>
</div>
<? endif ?>
<?php endif; ?>
<form method="get" action="<?= $this->qUrl(
'monitoring/list/hosts?' . http_build_query(
$this->hosts->getAppliedFilter()->toParams()
@ -77,19 +77,19 @@ Sort by <?= $this->formSelect(
<input type="text" placeholder="Add filter..." name="search" />
</form>
<?php // end filter ?>
<? if (empty($hosts)): ?>
<?php if (empty($hosts)): ?>
<div class="alert alert-info fullpage_infobox">
Sorry, no host found for this search
</div>
<? return; endif ?>
<?php return; endif; ?>
<?= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)) ?>
<table class="action">
<tbody>
<? foreach ($hosts as $host):
<?php foreach ($hosts as $host):
list($icons,$state_classes,$state_title) = getRowProperties($host,$this); ?>
<tr class="<?= implode(' ', $state_classes) ?>">
<td class="state" title="<?= $state_title ?>"><?= $this->qlink(

View File

@ -1,8 +1,8 @@
<? if (empty($this->services)): ?>
<?php if (empty($this->services)): ?>
<div class="alert alert-info fullpage_infobox">
Sorry, no services found for this search
</div>
<? return; endif ?>
<?php return; endif; ?>
<?
$services = $this->services->paginate();
@ -16,7 +16,7 @@ $services = $this->services->paginate();
</tr>
</thead>
<tbody>
<? foreach ($services as $service): ?>
<?php foreach ($services as $service): ?>
<?php
$icons = array();
@ -68,6 +68,6 @@ if (isset($this->preserve['backend'])) {
<?= $this->qlink($service->service_description, 'monitoring/show/service', $params, array('class' => 'row-action')) ?>
</td>
</tr>
<? endforeach ?>
<?php endforeach; ?>
</tbody>
</table>

View File

@ -63,9 +63,9 @@ if (isset($_GET['dir'])) {
}
?>
<div class="dontprint">
<? if (! empty($fparams)): ?>
<?php if (! empty($fparams)): ?>
<div style="float: right; width: 20em; font-size: 0.8em;"><b>Filters</b><br>
<? foreach ($fparams as $k => $v): ?>
<?php foreach ($fparams as $k => $v): ?>
<?= $this->qlink(
'x',
'monitoring/list/services',
@ -74,9 +74,9 @@ if (isset($_GET['dir'])) {
'style' => array('color' => 'red')
)
) ?> <?= $this->escape("$k = $v") ?></br>
<? endforeach ?>
<?php endforeach; ?>
</div>
<? endif ?>
<?php endif; ?>
<form method="get" action="<?= $this->qUrl(
'monitoring/list/services?' . http_build_query(
$this->services->getAppliedFilter()->toParams()
@ -106,11 +106,11 @@ Sort by <?= $this->formSelect(
Sorry, no services found for this search
</div>
<?php return; endif ?>
<?php return; endif; ?>
<?= $this->paginationControl($services, null, null, array('preserve' => $this->preserve )); ?>
<table class="action">
<tbody>
<? foreach ($services as $service):
<?php foreach ($services as $service):
list($host_col,$icons,$state_classes,$state_title,$graph) = getRowProperties($service,$last_host,$this); ?>
<tr class="<?= implode(' ', $state_classes) ?>">
<td class="state" title="<?= $state_title ?>">

View File

@ -1,5 +1,5 @@
<? if (! empty($this->comments)): ?>
<?php if (! empty($this->comments)): ?>
<?
$list = array();
foreach ($this->comments as $comment) {
@ -22,4 +22,4 @@ foreach ($this->comments as $comment) {
}
?>
<b>Comments:</b><blockquote> <?= implode('<br />', $list) ?></blockquote>
<? endif ?>
<?php endif; ?>

View File

@ -1,4 +1,4 @@
<? if (! empty($this->contacts)): ?>
<?php if (! empty($this->contacts)): ?>
<?
$list = array();
foreach ($this->contacts as $contact) {
@ -8,9 +8,9 @@ foreach ($this->contacts as $contact) {
}
?>
<b>Contacts:</b> <?= implode(', ', $list) ?><br />
<? endif ?>
<?php endif; ?>
<? if (! empty($this->contactgroups)): ?>
<?php if (! empty($this->contactgroups)): ?>
<?
$list = array();
foreach ($this->contactgroups as $contactgroup) {
@ -20,5 +20,5 @@ foreach ($this->contactgroups as $contactgroup) {
}
?>
<b>Contactgroups:</b> <?= implode(', ', $list) ?><br />
<? endif ?>
<?php endif; ?>

View File

@ -1,22 +1,22 @@
<?php
$showService = isset($this->service) && $this->tabs->getActiveName() !== 'host';
?>
<? if (! $this->compact): ?>
<?php if (! $this->compact): ?>
<?= $this->tabs ?>
<? endif ?>
<?php endif; ?>
<table style="margin-bottom: 1em">
<tr class="<?= $this->monitoringState($this->host, 'host') ?><?= $this->host->host_handled ? ' handled' : '' ?>">
<td><b><?= $this->escape($this->host->host_name) ?><?
if ($this->host->host_address && $this->host->host_address !== $this->host->host_name): ?>
(<?= $this->escape($this->host->host_address) ?>)
<? endif ?>
<?php endif; ?>
</b></td>
<td class="state"<?= $showService ? '' : ' rowspan="2"' ?>>
<?= $this->util()->getHostStateName($this->host->host_state); ?><br />
since <?= $this->timeSince($this->host->host_last_state_change) ?>
</td>
</tr>
<? if ($showService): ?>
<?php if ($showService): ?>
<tr class="<?= $this->monitoringState($this->service, 'service'); ?><?= $this->service->service_handled ? ' handled' : '' ?>">
<td><b>Service: <?= $this->escape($this->service->service_description) ?></b></td>
<td class="state">
@ -24,7 +24,7 @@ $showService = isset($this->service) && $this->tabs->getActiveName() !== 'host';
since <?= $this->timeSince($this->service->service_last_state_change) ?>
</td>
</tr>
<? else: ?>
<?php else: ?>
<tr><td><b>Host state</b></td></tr>
<? endif ?>
<?php endif; ?>
</table>

View File

@ -8,13 +8,13 @@ $history = $this->history->paginate();
?>
<? if (empty($history)): ?>
<?php if (empty($history)): ?>
There are no matching history entries right now
<? else: ?>
<?php else: ?>
<?= $this->paginationControl($history, null, null, array('preserve' => $this->preserve)); ?>
<table class="paginatable">
<tbody>
<? foreach ($history as $event): ?>
<?php foreach ($history as $event): ?>
<?php
if ($event->object_type == 'host') {
@ -27,11 +27,11 @@ $row_class = array_key_exists($event->state, $states) ? $states[$event->state] :
?>
<tr class="<?= $row_class ?>"><td class="state"><?= date('d.m. H:i', $event->timestamp ) ?></td>
<? if (! isset($this->host)): ?>
<?php if (! isset($this->host)): ?>
<td><?= $this->escape($event->host_name) ?></td>
<? endif ?>
<? if (! isset($this->service)): ?>
<td><? if (isset($this->host)): ?>
<?php endif; ?>
<?php if (! isset($this->service)): ?>
<td><?php if (isset($this->host)): ?>
<?= $this->qlink(
$event->service_description,
'monitoring/show/service',
@ -40,11 +40,11 @@ $row_class = array_key_exists($event->state, $states) ? $states[$event->state] :
'service' => $event->service_description
)
) ?>
<? else: ?>
<?php else: ?>
<?= $this->escape($event->service_description) ?>
<? endif ?>
<?php endif; ?>
</td>
<? endif ?>
<?php endif; ?>
<td style="padding: 0.2em;"><?php
$imgparams = array(
@ -83,9 +83,9 @@ switch ($event->type) {
break;
}
?>
<? if ($event->attempt !== null): ?>
<?php if ($event->attempt !== null): ?>
[ <?= $event->attempt ?>/<?=$event->max_attempts ?> ]
<? endif ?>
<?php endif; ?>
<?= $this->ticket_pattern ? preg_replace(
$this->ticket_pattern,
$this->ticket_link,
@ -93,7 +93,7 @@ switch ($event->type) {
) : $this->pluginOutput($event->output) ?>
</td>
</tr>
<? endforeach ?>
<?php endforeach; ?>
</tbody>
</table>
<? endif ?>
<?php endif; ?>

View File

@ -12,7 +12,7 @@
'<b>Command:</b> ' . array_shift(preg_split('|!|', $this->host->host_check_command)),
$this->commandArguments($this->host->host_check_command)
) ?>
<? if (! empty($this->hostgroups)): ?>
<?php if (! empty($this->hostgroups)): ?>
<?
$list = array();
foreach ($this->hostgroups as $name => $alias) {
@ -22,19 +22,19 @@ foreach ($this->hostgroups as $name => $alias) {
}
?>
<b>Hostgroups:</b> <?= implode(', ', $list) ?><br />
<? endif ?>
<?php endif; ?>
<?= $this->render('show/components/contacts.phtml') ?>
<?= $this->render('show/components/comments.phtml') ?>
<? foreach ($this->customvars as $name => $value): ?>
<?php foreach ($this->customvars as $name => $value): ?>
<b><?= $this->escape($name) ?>:</b> <?= $this->escape($value) ?><br />
<? endforeach ?>
<? if ($this->host->host_perfdata): ?>
<?php endforeach; ?>
<?php if ($this->host->host_perfdata): ?>
<?= $this->expandable(
'<b>Performance data</b>',
$this->perfdata($this->host->host_perfdata),
array('collapsed' => false)
) ?>
<? endif ?>
<?php endif; ?>
<?= $this->preview_image ?>

View File

@ -2,7 +2,7 @@
<div class="alert alert-info fullpage_infobox">
No service selected
</div>
<?php return; endif ?>
<?php return; endif; ?>
<br>
<?= $this->expandable(
'<b>'

View File

@ -12,20 +12,20 @@
<?= $this->render('show/components/contacts.phtml') ?>
<?= $this->render('show/components/comments.phtml') ?>
<? foreach ($this->customvars as $name => $value): ?>
<?php foreach ($this->customvars as $name => $value): ?>
<b><?= $this->escape($name) ?>:</b> <?= $this->escape($value) ?><br />
<? endforeach ?>
<?php endforeach; ?>
<?= $this->expandable(
'<b>Command:</b> ' . array_shift(preg_split('|!|', $this->service->service_check_command)),
$this->commandArguments($this->service->service_check_command)
) ?>
<? if ($this->service->service_perfdata): ?>
<?php if ($this->service->service_perfdata): ?>
<?= $this->expandable(
'<b>Performance data</b>:',
$this->perfdata($this->service->service_perfdata),
array('collapsed' => false)
) ?>
<? endif ?>
<?php endif; ?>
<?= $this->partial('show/legacy-service.phtml', array('service' => $this->service)) ?>
<?= $this->preview_image ?>

View File

@ -1,17 +1,17 @@
<? if (! $this->compact): ?>
<?php if (! $this->compact): ?>
<?= $this->tabs ?>
<? endif ?>
<? if (empty($this->summary)): ?>
<?php endif; ?>
<?php if (empty($this->summary)): ?>
There are no such services right now
<? else: ?>
<?php else: ?>
<?php
$now = time();
?>
<? if (! $this->compact && $this->summary instanceof \Zend_Paginator): ?>
<?php if (! $this->compact && $this->summary instanceof \Zend_Paginator): ?>
<?= $this->paginationControl($this->summary, null, null, array('preserve' => $this->preserve)); ?>
<? endif ?>
<?php endif; ?>
<table class="pivot action">
<thead>
<tr>
@ -20,11 +20,11 @@ $now = time();
<th style="width: 5em;">Critical</th>
<th style="width: 5em;">Unknown</th>
<th style="width: 5em;">Warning</th>
<? if (! $this->compact): ?> <th style="width: 9%;">OK</th><? endif ?>
<?php if (! $this->compact): ?> <th style="width: 9%;">OK</th><?php endif; ?>
</tr>
</thead>
<tbody>
<? foreach ($this->summary as $row): ?>
<?php foreach ($this->summary as $row): ?>
<?php
$class_ok = '';
@ -149,19 +149,19 @@ if (isset($row->hostgroup_name)) {
}
?>
<tr>
<!-- <td class="<?= $name_class ?>"><? if ($row->last_state_change + 600 > $now): ?>
<!-- <td class="<?= $name_class ?>"><?php if ($row->last_state_change + 600 > $now): ?>
<blink><?= $this->timeSince($row->last_state_change) ?></blink>
<? else: ?>
<?php else: ?>
<?= $this->timeSince($row->last_state_change) ?>
<? endif ?></td>-->
<?php endif; ?></td>-->
<td style="text-align: left;"><?= $name_html ?></td>
<td class="<?= $class_critical ?>"><?= $html_critical ?></td>
<td class="<?= $class_unknown ?>"><?= $html_unknown ?></td>
<td class="<?= $class_warning ?>"><?= $html_warning ?></td>
<? if (! $this->compact): ?><td class="ok"><?= $html_ok ?></td><? endif ?>
<?php if (! $this->compact): ?><td class="ok"><?= $html_ok ?></td><?php endif; ?>
</tr>
<? endforeach ?>
<?php endforeach; ?>
</tbody>
</table>
<? endif ?>
<? if ($this->compact): ?><a href="<?= $this->baseUrl('monitoring/summary/group') ?>">more</a><? endif ?>
<?php endif; ?>
<?php if ($this->compact): ?><a href="<?= $this->baseUrl('monitoring/summary/group') ?>">more</a><?php endif; ?>