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

git at icinga.org git at icinga.org
Tue Aug 30 17:36:52 CEST 2016


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

Author: Alexander A. Klimov <alexander.klimov at netways.de>
Date:   Tue Aug 30 17:35:49 2016 +0200

Remove leading and trailing whitespace from host header partial

refs #12208

---

 .../scripts/partials/object/host-header.phtml      |   46 ++++++++++----------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/modules/monitoring/application/views/scripts/partials/object/host-header.phtml b/modules/monitoring/application/views/scripts/partials/object/host-header.phtml
index a77a95d..4ea68ef 100644
--- a/modules/monitoring/application/views/scripts/partials/object/host-header.phtml
+++ b/modules/monitoring/application/views/scripts/partials/object/host-header.phtml
@@ -13,28 +13,28 @@ use Icinga\Module\Monitoring\Object\Host;
             <?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 ?>
-        <?php if ($object->host_alias !== $object->host_display_name && $object->host_alias !== $object->host_name): ?>
-            <div class="selectable host-meta">
-                <?= $this->escape($this->translate('Alias', 'host') . ': ' . $object->host_alias) ?>
-            </div>
-        <?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>';
+            }
+            if ($object->host_alias !== $object->host_display_name && $object->host_alias !== $object->host_name) {
+                echo '<div class="selectable host-meta">'
+                    . $this->escape($this->translate('Alias', 'host') . ': ' . $object->host_alias)
+                    . '</div>';
+            }
+            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>
 </table>



More information about the icinga-checkins mailing list