Header: Add header to module configuration

refs #7976
This commit is contained in:
Marius Hein 2015-02-17 16:19:03 +01:00
parent 32226418af
commit fe0bcdbbaf
2 changed files with 98 additions and 94 deletions

View File

@ -1,24 +1,25 @@
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs ?>
<h1><?= $this->escape($module->getTitle()) ?></h1>
</div> </div>
<div class="content"> <div class="content">
<?php if (! $module): ?> <h1 tabindex="-1">
<?= $this->translate('There is no such module installed.') ?> <?= $this->escape($module->getTitle()) ?>
<?php return; endif ?> </h1>
<?php <?php if (! $module): ?>
$dependencies = $module->getDependencies(); <?= $this->translate('There is no such module installed.') ?>
$restrictions = $module->getProvidedRestrictions(); <?php return; endif ?>
$permissions = $module->getProvidedPermissions(); <?php
$state = $moduleData->enabled ? ($moduleData->loaded ? 'enabled' : 'failed') : 'disabled' $dependencies = $module->getDependencies();
$restrictions = $module->getProvidedRestrictions();
?> $permissions = $module->getProvidedPermissions();
<table class="avp"> $state = $moduleData->enabled ? ($moduleData->loaded ? 'enabled' : 'failed') : 'disabled'
<tr> ?>
<table class="avp">
<tr>
<th><?= $this->escape($this->translate('Name')) ?></th> <th><?= $this->escape($this->translate('Name')) ?></th>
<td><?= $this->escape($module->getName()) ?></td> <td><?= $this->escape($module->getName()) ?></td>
</tr> </tr>
<tr> <tr>
<th><?= $this->translate('State') ?></th> <th><?= $this->translate('State') ?></th>
<td><?= $state ?><?php if ($state === 'enabled'): ?> <td><?= $state ?><?php if ($state === 'enabled'): ?>
<?= $this->qlink($this->translate('disable'), 'config/moduledisable', array( <?= $this->qlink($this->translate('disable'), 'config/moduledisable', array(
@ -31,40 +32,43 @@ $state = $moduleData->enabled ? ($moduleData->loaded ? 'enabled' : 'failed') : '
)) ?> )) ?>
<?php endif ?> <?php endif ?>
</td> </td>
<tr> <tr>
<th><?= $this->escape($this->translate('Version')) ?></th> <th><?= $this->escape($this->translate('Version')) ?></th>
<td><?= $this->escape($module->getVersion()) ?></td></tr> <td><?= $this->escape($module->getVersion()) ?></td></tr>
<tr> <tr>
<th><?= $this->escape($this->translate('Description')) ?></th> <th><?= $this->escape($this->translate('Description')) ?></th>
<td><?= nl2br($this->escape($module->getDescription())) ?></td> <td><?= nl2br($this->escape($module->getDescription())) ?></td>
</tr> </tr>
<tr> <tr>
<th><?= $this->escape($this->translate('Dependencies')) ?></th> <th><?= $this->escape($this->translate('Dependencies')) ?></th>
<td><?php <td>
<?php
if (empty($dependencies)): if (empty($dependencies)):
echo $this->translate('This module has no dependencies'); echo $this->translate('This module has no dependencies');
else: foreach ($dependencies as $name => $versionString): ?>
else: foreach ($dependencies as $name => $versionString): ?> <strong><?= $this->escape($name) ?></strong><?php if ($versionString !== true): ?>: <?= $this->escape($versionString) ?><?php endif ?><br />
<strong><?= $this->escape($name) ?></strong><?php if ($versionString !== true): ?>: <?= $this->escape($versionString) ?><?php endif ?><br /> <?php endforeach; endif ?>
<?php endforeach; endif ?></td> </td>
</tr> </tr>
<?php if (! empty($permissions)): ?> <?php if (! empty($permissions)): ?>
<tr> <tr>
<th><?= $this->escape($this->translate('Permissions')) ?></th> <th><?= $this->escape($this->translate('Permissions')) ?></th>
<td><?php foreach ($permissions as $permission): ?> <td>
<strong><?= $this->escape($permission->name) ?></strong>: <?= $this->escape($permission->description) ?><br /> <?php foreach ($permissions as $permission): ?>
<?php endforeach ?></td> <strong><?= $this->escape($permission->name) ?></strong>: <?= $this->escape($permission->description) ?><br />
</tr> <?php endforeach ?>
<?php endif ?> </td>
<?php if (! empty($restrictions)): ?> </tr>
<tr> <?php endif ?>
<?php if (! empty($restrictions)): ?>
<tr>
<th><?= $this->escape($this->translate('Restrictions')) ?></th> <th><?= $this->escape($this->translate('Restrictions')) ?></th>
<td><?php foreach ($restrictions as $restriction): ?> <td>
<strong><?= $this->escape($restriction->name) ?></strong>: <?= $this->escape($restriction->description) ?><br /> <?php foreach ($restrictions as $restriction): ?>
<?php endforeach ?></td> <strong><?= $this->escape($restriction->name) ?></strong>: <?= $this->escape($restriction->description) ?><br />
</tr> <?php endforeach ?>
<?php endif ?> </td>
</table> </tr>
<?php endif ?>
</table>
</div> </div>

View File

@ -1,11 +1,11 @@
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs ?>
<h1><?= $this->translate('Installed Modules') ?></h1>
<?= $this->paginationControl($modules) ?> <?= $this->paginationControl($modules) ?>
</div> </div>
<div class="content"> <div class="content">
<table class="action" data-base-target="_next"> <h1 tabindex="-1"><?= $this->translate('Installed Modules') ?></h1>
<table class="action" data-base-target="_next">
<tbody> <tbody>
<?php foreach ($modules as $module): ?> <?php foreach ($modules as $module): ?>
<tr> <tr>
@ -32,5 +32,5 @@
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>
</tbody> </tbody>
</table> </table>
</div> </div>