show l11n tags

This commit is contained in:
Dennis Eichhorn 2020-03-24 18:01:30 +01:00
parent 107fa4978a
commit 9b33990c5b
5 changed files with 46 additions and 14 deletions

View File

@ -20,6 +20,7 @@ use phpOMS\Contract\RenderableInterface;
use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract;
use phpOMS\Views\View;
use Modules\Tag\Models\L11nTagMapper;
/**
* Calendar controller class.
@ -99,6 +100,9 @@ final class BackendController extends Controller
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1007501001, $request, $response));
$view->addData('tag', $tag);
$l11n = L11nTagMapper::withConditional('tag', $tag->getId())::getAll();
$view->addData('l11n', $l11n);
return $view;
}
}

View File

@ -106,7 +106,7 @@ class L11nTag implements ArrayableInterface, \JsonSerializable
*/
public function getLanguage() : string
{
return $this->title;
return $this->language;
}
/**

View File

@ -13,10 +13,11 @@
declare(strict_types=1);
return ['Tag' => [
'Color' => 'Farbe',
'Create' => 'Erstellen',
'List' => 'Liste',
'Tag' => 'Tag',
'Tags' => 'Tags',
'Title' => 'Titel',
'Color' => 'Farbe',
'Create' => 'Erstellen',
'Language' => 'Sprache',
'List' => 'Liste',
'Tag' => 'Tag',
'Tags' => 'Tags',
'Title' => 'Titel',
]];

View File

@ -13,10 +13,11 @@
declare(strict_types=1);
return ['Tag' => [
'Color' => 'Color',
'Create' => 'Create',
'List' => 'List',
'Tag' => 'Tag',
'Tags' => 'Tags',
'Title' => 'Title',
'Color' => 'Color',
'Create' => 'Create',
'Language' => 'Language',
'List' => 'List',
'Tag' => 'Tag',
'Tags' => 'Tags',
'Title' => 'Title',
]];

View File

@ -13,8 +13,10 @@
declare(strict_types=1);
use phpOMS\Uri\UriFactory;
use phpOMS\Localization\ISO639Enum;
$tag = $this->getData('tag');
$tag = $this->getData('tag');
$l11n = $this->getData('l11n') ?? [];
/**
* @var \phpOMS\Views\View $this
@ -39,4 +41,28 @@ echo $this->getData('nav')->render(); ?>
</form>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Permissions') ?><i class="fa fa-download floatRight download btn"></i></div>
<table class="default">
<thead>
<tr>
<td>
<td>
<td><?= $this->getHtml('Language'); ?>
<td class="wf-100"><?= $this->getHtml('Title'); ?>
<tbody>
<?php $c = 0; foreach ($l11n as $key => $value) : ++$c; ?>
<tr>
<td><a href="#"><i class="fa fa-times"></i></a>
<td><a href="#"><i class="fa fa-cogs"></i></a>
<td><?= ISO639Enum::getByName('_' . \strtoupper($value->getLanguage())); ?>
<td><?= $value->getTitle(); ?>
<?php endforeach; ?>
<?php if ($c === 0) : ?>
<tr><td colspan="3" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
</div>