[icinga-checkins] icinga.org: icingaweb2/master: Header: Add header to module configuration

git at icinga.org git at icinga.org
Mon Feb 23 16:08:16 CET 2015


Module: icingaweb2
Branch: master
Commit: fe0bcdbbafbd7aa619023bf47152a94371905034
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=fe0bcdbbafbd7aa619023bf47152a94371905034

Author: Marius Hein <marius.hein at netways.de>
Date:   Tue Feb 17 16:19:03 2015 +0100

Header: Add header to module configuration

refs #7976

---

 application/views/scripts/config/module.phtml  |  136 ++++++++++++------------
 application/views/scripts/config/modules.phtml |   56 +++++-----
 2 files changed, 98 insertions(+), 94 deletions(-)

diff --git a/application/views/scripts/config/module.phtml b/application/views/scripts/config/module.phtml
index cd6ad5a..c41fdbf 100644
--- a/application/views/scripts/config/module.phtml
+++ b/application/views/scripts/config/module.phtml
@@ -1,70 +1,74 @@
 <div class="controls">
-<?= $this->tabs ?>
-<h1><?= $this->escape($module->getTitle()) ?></h1>
+  <?= $this->tabs ?>
 </div>
 <div class="content">
-<?php if (! $module): ?>
-<?= $this->translate('There is no such module installed.') ?>
-<?php return; endif ?>
-<?php
-$dependencies = $module->getDependencies();
-$restrictions = $module->getProvidedRestrictions();
-$permissions = $module->getProvidedPermissions();
-$state = $moduleData->enabled ? ($moduleData->loaded ? 'enabled' : 'failed') : 'disabled'
-
-?>
-<table class="avp">
-<tr>
-  <th><?= $this->escape($this->translate('Name')) ?></th>
-  <td><?= $this->escape($module->getName()) ?></td>
-</tr>
-<tr>
-  <th><?= $this->translate('State') ?></th>
-  <td><?= $state ?><?php if ($state === 'enabled'): ?>
-  <?= $this->qlink($this->translate('disable'), 'config/moduledisable', array(
-      'name' => $module->getName()
-  )) ?>
-  <?php endif ?>
-  <?php if ($state === 'disabled'): ?>
-  <?= $this->qlink($this->translate('enable'), 'config/moduleenable', array(
-      'name' => $module->getName()
-  )) ?>
-  <?php endif ?>
-  </td>
-<tr>
-  <th><?= $this->escape($this->translate('Version')) ?></th>
-  <td><?= $this->escape($module->getVersion()) ?></td></tr>
-<tr>
-  <th><?= $this->escape($this->translate('Description')) ?></th>
-  <td><?= nl2br($this->escape($module->getDescription())) ?></td>
-</tr>
-<tr>
-  <th><?= $this->escape($this->translate('Dependencies')) ?></th>
-  <td><?php
-  
-if (empty($dependencies)):
-    echo $this->translate('This module has no dependencies');
-
-else: foreach ($dependencies as $name => $versionString): ?>
-<strong><?= $this->escape($name) ?></strong><?php if ($versionString !== true): ?>: <?= $this->escape($versionString) ?><?php endif ?><br />
-<?php endforeach; endif ?></td>
-</tr>
-<?php if (! empty($permissions)): ?>
-<tr>
-  <th><?= $this->escape($this->translate('Permissions')) ?></th>
-  <td><?php foreach ($permissions as $permission): ?>
-<strong><?= $this->escape($permission->name) ?></strong>: <?= $this->escape($permission->description) ?><br />
-<?php endforeach ?></td>
-</tr>
-<?php endif ?>
-<?php if (! empty($restrictions)): ?>
-<tr>
-  <th><?= $this->escape($this->translate('Restrictions')) ?></th>
-  <td><?php foreach ($restrictions as $restriction): ?>
-<strong><?= $this->escape($restriction->name) ?></strong>: <?= $this->escape($restriction->description) ?><br />
-<?php endforeach ?></td>
-</tr>
-<?php endif ?>
-</table>
-
+  <h1 tabindex="-1">
+    <?= $this->escape($module->getTitle()) ?>
+  </h1>
+  <?php if (! $module): ?>
+    <?= $this->translate('There is no such module installed.') ?>
+  <?php return; endif ?>
+  <?php
+    $dependencies = $module->getDependencies();
+    $restrictions = $module->getProvidedRestrictions();
+    $permissions = $module->getProvidedPermissions();
+    $state = $moduleData->enabled ? ($moduleData->loaded ? 'enabled' : 'failed') : 'disabled'
+  ?>
+  <table class="avp">
+    <tr>
+      <th><?= $this->escape($this->translate('Name')) ?></th>
+      <td><?= $this->escape($module->getName()) ?></td>
+    </tr>
+    <tr>
+      <th><?= $this->translate('State') ?></th>
+      <td><?= $state ?><?php if ($state === 'enabled'): ?>
+      <?= $this->qlink($this->translate('disable'), 'config/moduledisable', array(
+          'name' => $module->getName()
+      )) ?>
+      <?php endif ?>
+      <?php if ($state === 'disabled'): ?>
+      <?= $this->qlink($this->translate('enable'), 'config/moduleenable', array(
+          'name' => $module->getName()
+      )) ?>
+      <?php endif ?>
+      </td>
+    <tr>
+      <th><?= $this->escape($this->translate('Version')) ?></th>
+      <td><?= $this->escape($module->getVersion()) ?></td></tr>
+    <tr>
+      <th><?= $this->escape($this->translate('Description')) ?></th>
+      <td><?= nl2br($this->escape($module->getDescription())) ?></td>
+    </tr>
+    <tr>
+      <th><?= $this->escape($this->translate('Dependencies')) ?></th>
+      <td>
+        <?php
+          if (empty($dependencies)):
+            echo $this->translate('This module has no dependencies');
+          else: foreach ($dependencies as $name => $versionString): ?>
+            <strong><?= $this->escape($name) ?></strong><?php if ($versionString !== true): ?>: <?= $this->escape($versionString) ?><?php endif ?><br />
+        <?php endforeach; endif ?>
+      </td>
+    </tr>
+    <?php if (! empty($permissions)): ?>
+      <tr>
+        <th><?= $this->escape($this->translate('Permissions')) ?></th>
+        <td>
+          <?php foreach ($permissions as $permission): ?>
+            <strong><?= $this->escape($permission->name) ?></strong>: <?= $this->escape($permission->description) ?><br />
+          <?php endforeach ?>
+        </td>
+      </tr>
+    <?php endif ?>
+    <?php if (! empty($restrictions)): ?>
+      <tr>
+        <th><?= $this->escape($this->translate('Restrictions')) ?></th>
+        <td>
+          <?php foreach ($restrictions as $restriction): ?>
+            <strong><?= $this->escape($restriction->name) ?></strong>: <?= $this->escape($restriction->description) ?><br />
+          <?php endforeach ?>
+        </td>
+      </tr>
+    <?php endif ?>
+  </table>
 </div>
diff --git a/application/views/scripts/config/modules.phtml b/application/views/scripts/config/modules.phtml
index 01fc1c4..25b5753 100644
--- a/application/views/scripts/config/modules.phtml
+++ b/application/views/scripts/config/modules.phtml
@@ -1,36 +1,36 @@
 <div class="controls">
 <?= $this->tabs ?>
-<h1><?= $this->translate('Installed Modules') ?></h1>
 <?= $this->paginationControl($modules) ?>
 </div>
 
 <div class="content">
-<table class="action" data-base-target="_next">
-  <tbody>
-  <?php foreach ($modules as $module): ?>
-    <tr>
-      <td>
-        <?php if ($module->enabled && $module->loaded) {
-          $icon = $this->icon('thumbs-up');
-          $title = sprintf($this->translate('Module %s is enabled'), $module->name);
-        } elseif (! $module->enabled) {
-          $icon = $this->icon('thumbs-down');
-          $title = sprintf($this->translate('Module %s is disabled'), $module->name);
-        } else { // ! $module->loaded
-          $icon = $this->icon('thumbs-down');
-          $title = sprintf($this->translate('Module %s has failed to load'), $module->name);
-        }
+  <h1 tabindex="-1"><?= $this->translate('Installed Modules') ?></h1>
+  <table class="action" data-base-target="_next">
+    <tbody>
+    <?php foreach ($modules as $module): ?>
+      <tr>
+        <td>
+          <?php if ($module->enabled && $module->loaded) {
+            $icon = $this->icon('thumbs-up');
+            $title = sprintf($this->translate('Module %s is enabled'), $module->name);
+          } elseif (! $module->enabled) {
+            $icon = $this->icon('thumbs-down');
+            $title = sprintf($this->translate('Module %s is disabled'), $module->name);
+          } else { // ! $module->loaded
+            $icon = $this->icon('thumbs-down');
+            $title = sprintf($this->translate('Module %s has failed to load'), $module->name);
+          }
 
-        echo $this->qlink(
-          $icon . $this->escape($module->name),
-          'config/module/',
-          array('name' => $module->name),
-          array('title' => $title),
-          false
-        ); ?>
-      </td>
-    </tr>
-  <?php endforeach ?>
-  </tbody>
-</table>
+          echo $this->qlink(
+            $icon . $this->escape($module->name),
+            'config/module/',
+            array('name' => $module->name),
+            array('title' => $title),
+            false
+          ); ?>
+        </td>
+      </tr>
+    <?php endforeach ?>
+    </tbody>
+  </table>
 </div>



More information about the icinga-checkins mailing list