Implement status tags

This commit is contained in:
Dennis Eichhorn 2017-08-23 15:19:15 +02:00
parent 6382691c4f
commit 7aed7f587a
2 changed files with 12 additions and 2 deletions

View File

@ -129,4 +129,9 @@ return ['Admin' => [
'i:rem' => 'IP address or URL for remote access.',
'i:rc' => 'Forcing re-cache for every user.',
'i:timef' => 'Time format.',
'Status0' => 'None',
'Status1' => 'Active',
'Status2' => 'Inactive',
'Status3' => 'Timehout',
'Status4' => 'Banned',
]];

View File

@ -42,10 +42,15 @@ echo $this->getData('nav')->render();
<tr><td colspan="5"><?= $footerView->render(); ?>
<tbody>
<?php $c = 0; foreach ($this->getData('list:elements') as $key => $value) : $c++;
$url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/admin/account/settings?{?}&id=' . $value->getId()); ?>
$url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/admin/account/settings?{?}&id=' . $value->getId());
$color = 'darkred';
if($value->getStatus() === \phpOMS\Account\AccountStatus::ACTIVE) { $color = 'green'; }
elseif($value->getStatus() === \phpOMS\Account\AccountStatus::INACTIVE) { $color = 'darkblue'; }
elseif($value->getStatus() === \phpOMS\Account\AccountStatus::TIMEOUT) { $color = 'purple'; }
elseif($value->getStatus() === phpOMS\Account\AccountStatus::BANNED) { $color = 'red'; } ?>
<tr data-href="<?= $url; ?>">
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getId(), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getStatus(), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><span class="tag <?= $color; ?>"><?= $this->getHtml('Status'. $value->getStatus()); ?></span></a>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getName1(), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getLastActive()->format('Y-m-d H:i:s'), ENT_COMPAT, 'utf-8'); ?></a>
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getCreatedAt()->format('Y-m-d H:i:s'), ENT_COMPAT, 'utf-8'); ?></a>