cleanup tpl

This commit is contained in:
Dennis Eichhorn 2020-11-22 01:59:06 +01:00
parent 31a2973496
commit 639ca300f0

View File

@ -13,6 +13,7 @@
declare(strict_types=1);
use phpOMS\Module\ModuleStatus;
use phpOMS\Uri\UriFactory;
/**
* @var \phpOMS\Views\View $this
@ -34,26 +35,25 @@ $isntalled = $this->getData('isntalled') ?? [];
<td class="wf-100"><?= $this->getHtml('Name'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td><?= $this->getHtml('Version'); ?>
<td><?= $this->getHtml('Status'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<tbody>
<?php $count = 0; foreach ($modules as $key => $module) : ++$count;
$url = \phpOMS\Uri\UriFactory::build('{/prefix}admin/module/settings?{?}&id=' . $module['name']['internal']);
if (isset($active[$module['name']['internal']])) { $status = ModuleStatus::ACTIVE; }
elseif (isset($installed[$module['name']['internal']])) { $status = ModuleStatus::INACTIVE; }
else { $status = ModuleStatus::AVAILABLE; }
?>
<tbody>
<?php $count = 0;
foreach ($modules as $key => $module) : ++$count;
$url = UriFactory::build('{/prefix}admin/module/settings?{?}&id=' . $module['name']['internal']);
if (isset($active[$module['name']['internal']])) {
$status = ModuleStatus::ACTIVE;
} elseif (isset($installed[$module['name']['internal']])) {
$status = ModuleStatus::INACTIVE;
} else {
$status = ModuleStatus::AVAILABLE;
}
?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($module['name']['id']); ?></a>
<td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($module['name']['external']); ?></a>
<td data-label="<?= $this->getHtml('Version'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($module['version']); ?></a>
<td data-label="<?= $this->getHtml('Status'); ?>">
<span class="tag <?php
if ($status === ModuleStatus::ACTIVE)
echo 'green';
elseif ($status === ModuleStatus::INACTIVE)
echo 'red';
else
echo 'blue';
?>">
<span class="tag">
<a href="<?= $url; ?>">
<?php if ($status === ModuleStatus::ACTIVE)
echo \mb_strtolower($this->getHtml('Active'));
@ -65,7 +65,7 @@ $isntalled = $this->getData('isntalled') ?? [];
<?php endforeach; ?>
</span>
<?php if ($count === 0) : ?>
<tr><td colspan="4" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<tr><td colspan="4" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
<div class="portlet-foot"></div>