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