fix l11n call

This commit is contained in:
Dennis Eichhorn 2021-06-24 00:07:38 +02:00
parent b753404db5
commit 015802e069
4 changed files with 11 additions and 8 deletions

View File

@ -17,7 +17,7 @@ use phpOMS\Uri\UriFactory;
/** @var \phpOMS\Views\View $this */
/** @var \Modules\News\Models\NewsArticle[] $newsList */
$articles = $this->getData('news') ?? [];
$newsList = $this->getData('news') ?? [];
$previous = empty($newsList) ? '{/prefix}news/archive' : '{/prefix}news/archive?{?}&id=' . \reset($newsList)->getId() . '&ptype=p';
$next = empty($newsList) ? '{/prefix}news/archive' : '{/prefix}news/archive?{?}&id=' . \end($newsList)->getId() . '&ptype=n';
@ -83,7 +83,7 @@ echo $this->getData('nav')->render(); ?>
<?php
$count = 0;
foreach ($articles as $key => $news) : ++$count;
foreach ($newsList as $key => $news) : ++$count;
$url = UriFactory::build('{/prefix}news/article?{?}&id=' . $news->getId());
$color = 'darkred';

View File

@ -49,7 +49,7 @@ echo $this->getData('nav')->render(); ?>
<div class="portlet-foot">
<div class="overflowfix">
<?php $tags = $news->getTags(); foreach ($tags as $tag) : ?>
<span class="tag" style="background: <?= $this->printHtml($tag->color); ?>"><?= $tag->icon !== null ? '<i class="' . $this->printHtml($tag->icon ?? '') . '"></i>' : ''; ?><?= $this->printHtml($tag->getTitle()); ?></span>
<span class="tag" style="background: <?= $this->printHtml($tag->color); ?>"><?= $tag->icon !== null ? '<i class="' . $this->printHtml($tag->icon ?? '') . '"></i>' : ''; ?><?= $this->printHtml($tag->getL11n()); ?></span>
<?php endforeach; ?>
<a tabindex="0" href="<?= $url; ?>" class="button floatRight"><?= $this->getHtml('More', '0', '0'); ?></a>
</div>

View File

@ -17,7 +17,7 @@ use phpOMS\Uri\UriFactory;
/** @var \phpOMS\Views\View $this */
/** @var \Modules\News\Models\NewsArticle[] $newsList */
$articles = $this->getData('news') ?? [];
$newsList = $this->getData('news') ?? [];
$previous = empty($newsList) ? '{/prefix}news/draft/list' : '{/prefix}news/draft/list?{?}&id=' . \reset($newsList)->getId() . '&ptype=p';
$next = empty($newsList) ? '{/prefix}news/draft/list' : '{/prefix}news/draft/list?{?}&id=' . \end($newsList)->getId() . '&ptype=n';
@ -80,8 +80,11 @@ echo $this->getData('nav')->render(); ?>
<i class="filter fa fa-filter"></i>
</label>
<tbody>
<?php $count = 0; foreach ($articles as $key => $news) : ++$count; $url = UriFactory::build('{/prefix}news/edit?{?}&id=' . $news->getId());
$color = 'darkred';
<?php $count = 0;
foreach ($newsList as $key => $news) : ++$count;
$url = UriFactory::build('{/prefix}news/edit?{?}&id=' . $news->getId());
$color = 'darkred';
if ($news->getType() === NewsType::ARTICLE) { $color = 'green'; }
elseif ($news->getType() === NewsType::HEADLINE) { $color = 'purple'; }
elseif ($news->getType() === NewsType::LINK) { $color = 'yellow'; }

View File

@ -21,7 +21,7 @@ $news = $this->getData('news');
/** @var bool $editable */
$editable = $this->getData('editable');
/** @var \Modules\Tag\Models\Tag[] $tag */
/** @var \Modules\Tag\Models\Tag[] $tags */
$tags = $news->getTags();
$profile = UriFactory::build('{/prefix}profile/single?{?}&id=' . $news->createdBy->getId());
@ -40,7 +40,7 @@ echo $this->getData('nav')->render(); ?>
<div class="row">
<div class="col-xs-6 overflowfix">
<?php foreach ($tags as $tag) : ?>
<span class="tag" style="background: <?= $this->printHtml($tag->color); ?>"><?= $tag->icon !== null ? '<i class="' . $this->printHtml($tag->icon ?? '') . '"></i>' : ''; ?><?= $this->printHtml($tag->getTitle()); ?></span>
<span class="tag" style="background: <?= $this->printHtml($tag->color); ?>"><?= $tag->icon !== null ? '<i class="' . $this->printHtml($tag->icon ?? '') . '"></i>' : ''; ?><?= $this->printHtml($tag->getL11n()); ?></span>
<?php endforeach; ?>
</div>
<?php if ($editable) : ?>