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,70 +1,74 @@
<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> ?>
<th><?= $this->escape($this->translate('Name')) ?></th> <table class="avp">
<td><?= $this->escape($module->getName()) ?></td> <tr>
</tr> <th><?= $this->escape($this->translate('Name')) ?></th>
<tr> <td><?= $this->escape($module->getName()) ?></td>
<th><?= $this->translate('State') ?></th> </tr>
<td><?= $state ?><?php if ($state === 'enabled'): ?> <tr>
<?= $this->qlink($this->translate('disable'), 'config/moduledisable', array( <th><?= $this->translate('State') ?></th>
'name' => $module->getName() <td><?= $state ?><?php if ($state === 'enabled'): ?>
)) ?> <?= $this->qlink($this->translate('disable'), 'config/moduledisable', array(
<?php endif ?> 'name' => $module->getName()
<?php if ($state === 'disabled'): ?> )) ?>
<?= $this->qlink($this->translate('enable'), 'config/moduleenable', array( <?php endif ?>
'name' => $module->getName() <?php if ($state === 'disabled'): ?>
)) ?> <?= $this->qlink($this->translate('enable'), 'config/moduleenable', array(
<?php endif ?> 'name' => $module->getName()
</td> )) ?>
<tr> <?php endif ?>
<th><?= $this->escape($this->translate('Version')) ?></th> </td>
<td><?= $this->escape($module->getVersion()) ?></td></tr> <tr>
<tr> <th><?= $this->escape($this->translate('Version')) ?></th>
<th><?= $this->escape($this->translate('Description')) ?></th> <td><?= $this->escape($module->getVersion()) ?></td></tr>
<td><?= nl2br($this->escape($module->getDescription())) ?></td> <tr>
</tr> <th><?= $this->escape($this->translate('Description')) ?></th>
<tr> <td><?= nl2br($this->escape($module->getDescription())) ?></td>
<th><?= $this->escape($this->translate('Dependencies')) ?></th> </tr>
<td><?php <tr>
<th><?= $this->escape($this->translate('Dependencies')) ?></th>
if (empty($dependencies)): <td>
echo $this->translate('This module has no dependencies'); <?php
if (empty($dependencies)):
else: foreach ($dependencies as $name => $versionString): ?> echo $this->translate('This module has no dependencies');
<strong><?= $this->escape($name) ?></strong><?php if ($versionString !== true): ?>: <?= $this->escape($versionString) ?><?php endif ?><br /> else: foreach ($dependencies as $name => $versionString): ?>
<?php endforeach; endif ?></td> <strong><?= $this->escape($name) ?></strong><?php if ($versionString !== true): ?>: <?= $this->escape($versionString) ?><?php endif ?><br />
</tr> <?php endforeach; endif ?>
<?php if (! empty($permissions)): ?> </td>
<tr> </tr>
<th><?= $this->escape($this->translate('Permissions')) ?></th> <?php if (! empty($permissions)): ?>
<td><?php foreach ($permissions as $permission): ?> <tr>
<strong><?= $this->escape($permission->name) ?></strong>: <?= $this->escape($permission->description) ?><br /> <th><?= $this->escape($this->translate('Permissions')) ?></th>
<?php endforeach ?></td> <td>
</tr> <?php foreach ($permissions as $permission): ?>
<?php endif ?> <strong><?= $this->escape($permission->name) ?></strong>: <?= $this->escape($permission->description) ?><br />
<?php if (! empty($restrictions)): ?> <?php endforeach ?>
<tr> </td>
<th><?= $this->escape($this->translate('Restrictions')) ?></th> </tr>
<td><?php foreach ($restrictions as $restriction): ?> <?php endif ?>
<strong><?= $this->escape($restriction->name) ?></strong>: <?= $this->escape($restriction->description) ?><br /> <?php if (! empty($restrictions)): ?>
<?php endforeach ?></td> <tr>
</tr> <th><?= $this->escape($this->translate('Restrictions')) ?></th>
<?php endif ?> <td>
</table> <?php foreach ($restrictions as $restriction): ?>
<strong><?= $this->escape($restriction->name) ?></strong>: <?= $this->escape($restriction->description) ?><br />
<?php endforeach ?>
</td>
</tr>
<?php endif ?>
</table>
</div> </div>

View File

@ -1,36 +1,36 @@
<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>
<tbody> <table class="action" data-base-target="_next">
<?php foreach ($modules as $module): ?> <tbody>
<tr> <?php foreach ($modules as $module): ?>
<td> <tr>
<?php if ($module->enabled && $module->loaded) { <td>
$icon = $this->icon('thumbs-up'); <?php if ($module->enabled && $module->loaded) {
$title = sprintf($this->translate('Module %s is enabled'), $module->name); $icon = $this->icon('thumbs-up');
} elseif (! $module->enabled) { $title = sprintf($this->translate('Module %s is enabled'), $module->name);
$icon = $this->icon('thumbs-down'); } elseif (! $module->enabled) {
$title = sprintf($this->translate('Module %s is disabled'), $module->name); $icon = $this->icon('thumbs-down');
} else { // ! $module->loaded $title = sprintf($this->translate('Module %s is disabled'), $module->name);
$icon = $this->icon('thumbs-down'); } else { // ! $module->loaded
$title = sprintf($this->translate('Module %s has failed to load'), $module->name); $icon = $this->icon('thumbs-down');
} $title = sprintf($this->translate('Module %s has failed to load'), $module->name);
}
echo $this->qlink( echo $this->qlink(
$icon . $this->escape($module->name), $icon . $this->escape($module->name),
'config/module/', 'config/module/',
array('name' => $module->name), array('name' => $module->name),
array('title' => $title), array('title' => $title),
false false
); ?> ); ?>
</td> </td>
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>
</tbody> </tbody>
</table> </table>
</div> </div>