[icinga-checkins] icinga.org: icingaweb2/bugfix/ remove-leading-and-trailing-whitespace-from-text-12208: Remove leading and trailing whitespace from service header partial

git at icinga.org git at icinga.org
Wed Aug 31 11:37:18 CEST 2016


Module: icingaweb2
Branch: bugfix/remove-leading-and-trailing-whitespace-from-text-12208
Commit: 3af68ef16601b3a761619472426f6a5c69d68d9d
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=3af68ef16601b3a761619472426f6a5c69d68d9d

Author: Alexander A. Klimov <alexander.klimov at netways.de>
Date:   Wed Aug 31 11:35:32 2016 +0200

Remove leading and trailing whitespace from service header partial

refs #12208

---

 .../scripts/partials/object/service-header.phtml   |   53 ++++++++++----------
 1 file changed, 27 insertions(+), 26 deletions(-)

diff --git a/modules/monitoring/application/views/scripts/partials/object/service-header.phtml b/modules/monitoring/application/views/scripts/partials/object/service-header.phtml
index 93eb41f..bc23fce 100644
--- a/modules/monitoring/application/views/scripts/partials/object/service-header.phtml
+++ b/modules/monitoring/application/views/scripts/partials/object/service-header.phtml
@@ -14,24 +14,24 @@ use Icinga\Module\Monitoring\Object\Service;
             <?php endif ?>
             </div>
         </td>
-        <td>
-            <?= $this->iconImage()->host($object) ?>
-            <span class="selectable"><?= $this->escape($object->host_display_name) ?></span>
-        <?php if ($object->host_display_name !== $object->host_name): ?>
-            <span class="selectable host-meta">(<?= $this->escape($object->host_name) ?>)</span>
-        <?php endif ?>
-            <?= $this->render('partials/host/statusicons.phtml') ?>
-        <?php if ($object->host_address6 && $object->host_address6 !== $object->host_name): ?>
-            <div class="selectable host-meta" title="<?= $this->translate('IPv6 address') ?>">
-                <?= $this->escape($object->host_address6) ?>
-            </div>
-        <?php endif ?>
-        <?php if ($object->host_address && $object->host_address !== $object->host_name): ?>
-            <div class="selectable host-meta" title="<?= $this->translate('IPv4 address') ?>">
-                <?= $this->escape($object->host_address) ?>
-            </div>
-        <?php endif ?>
-        </td>
+        <td><?php
+            echo $this->iconImage()->host($object);
+            echo '<span class="selectable">' . $this->escape($object->host_display_name) . '</span>';
+            if ($object->host_display_name !== $object->host_name) {
+                echo ' <span class="selectable host-meta">(' . $this->escape($object->host_name) . ')</span>';
+            }
+            echo $this->render('partials/host/statusicons.phtml');
+            if ($object->host_address6 && $object->host_address6 !== $object->host_name) {
+                echo '<div class="selectable host-meta" title="' . $this->translate('IPv6 address') . '">'
+                    . $this->escape($object->host_address6)
+                    . '</div>';
+            }
+            if ($object->host_address && $object->host_address !== $object->host_name) {
+                echo '<div class="selectable host-meta" title="' . $this->translate('IPv4 address') . '">'
+                    . $this->escape($object->host_address)
+                    . '</div>';
+            }
+        ?></td>
     </tr>
     <tr>
         <td class="state-col state-<?= Service::getStateText($object->service_state) ?><?= $object->service_handled ? ' handled' : '' ?>">
@@ -43,13 +43,14 @@ use Icinga\Module\Monitoring\Object\Service;
             <?php endif ?>
             </div>
         </td>
-        <td>
-            <?= $this->iconImage()->service($object) ?>
-            <?= $this->translate('Service') ?>: <span class="selectable"><?= $this->escape($object->service_display_name) ?></span>
-            <?php if ($object->service_display_name !== $object->service_description): ?>
-                <span class="selectable service-meta">(<?= $this->escape($object->service_description) ?>)</span>
-            <?php endif ?>
-            <?= $this->render('partials/service/statusicons.phtml') ?>
-        </td>
+        <td><?php
+            echo $this->iconImage()->service($object);
+            echo $this->translate('Service')
+                . ': <span class="selectable">' . $this->escape($object->service_display_name) . '</span>';
+            if ($object->service_display_name !== $object->service_description) {
+                echo ' <span class="selectable service-meta">(' . $this->escape($object->service_description) . ')</span>';
+            }
+            echo $this->render('partials/service/statusicons.phtml');
+        ?></td>
     </tr>
 </table>



More information about the icinga-checkins mailing list