From a07ced226bfafcafa62f8a9fa28ac0ad8913c915 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 24 Jun 2021 00:06:05 +0200 Subject: [PATCH] fix l11n call and add comments --- Theme/Backend/helper-list.tpl.php | 6 ++++-- Theme/Backend/helper-single.tpl.php | 27 ++++++++++++++++++++------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/Theme/Backend/helper-list.tpl.php b/Theme/Backend/helper-list.tpl.php index 7757cd6..2987c56 100755 --- a/Theme/Backend/helper-list.tpl.php +++ b/Theme/Backend/helper-list.tpl.php @@ -19,7 +19,9 @@ use phpOMS\Uri\UriFactory; * @var \Modules\Helper\Models\Template[] $templates */ $templates = $this->getData('reports'); -$account = $this->getData('account'); + +/** @var \Modules\Admin\Models\Account $account */ +$account = $this->getData('account'); $accountDir = $account->getId() . ' ' . $account->login; @@ -160,7 +162,7 @@ echo $this->getData('nav')->render(); ?> printHtml($template->name); ?> getTags(); foreach ($tags as $tag) : ?> - icon !== null ? '' : ''; ?>printHtml($tag->getTitle()); ?> + icon !== null ? '' : ''; ?>printHtml($tag->getL11n()); ?> printHtml($template->createdBy->name1); ?> printHtml($template->createdAt->format('Y-m-d')); ?> diff --git a/Theme/Backend/helper-single.tpl.php b/Theme/Backend/helper-single.tpl.php index 40800e0..d64e84f 100755 --- a/Theme/Backend/helper-single.tpl.php +++ b/Theme/Backend/helper-single.tpl.php @@ -18,16 +18,29 @@ use phpOMS\Uri\UriFactory; /** * @var \phpOMS\Views\View $this */ -$tcoll = $this->getData('tcoll'); -$rcoll = $this->getData('rcoll'); -$cLang = $this->getData('lang'); + +/** @var \Modules\Media\Models\Collection $tcoll */ +$tcoll = $this->getData('tcoll'); + +/** @var \Modules\Media\Models\Collection $rcoll */ +$rcoll = $this->getData('rcoll'); + +/** @var string $cLang */ +$cLang = $this->getData('lang'); + +/** @var \Modules\Helper\Models\Template $template */ $template = $this->getData('template'); -$report = $this->getData('report'); + +/** @var \Modules\Helper\Models\Report $report */ +$report = $this->getData('report'); /** @noinspection PhpIncludeInspection */ +/** @var array> $reportLanguage */ $reportLanguage = isset($tcoll['lang']) ? include __DIR__ . '/../../../../' . \ltrim($tcoll['lang']->getPath(), '/') : []; -$lang = $reportLanguage[$cLang] ?? []; -$settings = isset($tcoll['cfg']) ? \json_decode(\file_get_contents(__DIR__ . '/../../../../' . \ltrim($tcoll['cfg']->getPath(), '/')), true) : []; + +/** @var array $lang */ +$lang = $reportLanguage[$cLang] ?? []; +$settings = isset($tcoll['cfg']) ? \json_decode(\file_get_contents(__DIR__ . '/../../../../' . \ltrim($tcoll['cfg']->getPath(), '/')), true) : []; echo $this->getData('nav')->render(); ?>
@@ -141,7 +154,7 @@ echo $this->getData('nav')->render(); ?> getHtml('Tags'); ?> getTags(); foreach ($tags as $tag) : ?> - icon !== null ? '' : ''; ?>printHtml($tag->getTitle()); ?> + icon !== null ? '' : ''; ?>printHtml($tag->getL11n()); ?>