diff --git a/Controller/BackendController.php b/Controller/BackendController.php index f842fac..eb0f0d4 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -49,7 +49,7 @@ final class BackendController extends Controller $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Tag/Theme/Backend/tag-create'); - $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1007501001, $request, $response)); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1007501001, $request, $response); return $view; } @@ -71,35 +71,29 @@ final class BackendController extends Controller $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Tag/Theme/Backend/tag-list'); - $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1007501001, $request, $response)); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1007501001, $request, $response); if ($request->getData('ptype') === 'p') { - $view->setData('tags', - TagMapper::getAll() + $view->data['tags'] = TagMapper::getAll() ->with('title') ->where('id', $request->getDataInt('id') ?? 0, '<') ->where('title/language', $request->header->l11n->language) ->limit(25) - ->execute() - ); + ->execute(); } elseif ($request->getData('ptype') === 'n') { - $view->setData('tags', - TagMapper::getAll() + $view->data['tags'] = TagMapper::getAll() ->with('title') ->where('id', $request->getDataInt('id') ?? 0, '>') ->where('title/language', $request->header->l11n->language) ->limit(25) - ->execute() - ); + ->execute(); } else { - $view->setData('tags', - TagMapper::getAll() + $view->data['tags'] = TagMapper::getAll() ->with('title') ->where('id', 0, '>') ->where('title/language', $request->header->l11n->language) ->limit(25) - ->execute() - ); + ->execute(); } return $view; @@ -129,15 +123,15 @@ final class BackendController extends Controller ->execute(); $view->setTemplate('/Modules/Tag/Theme/Backend/tag-single'); - $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1007501001, $request, $response)); - $view->addData('tag', $tag); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1007501001, $request, $response); + $view->data['tag'] = $tag; /** @var \phpOMS\Localization\BaseStringL11n[] $l11n */ $l11n = TagL11nMapper::getAll() ->where('ref', $tag->id) ->execute(); - $view->addData('l11n', $l11n); + $view->data['l11n'] = $l11n; return $view; } diff --git a/Theme/Backend/tag-create.tpl.php b/Theme/Backend/tag-create.tpl.php index 12181fe..3db259b 100755 --- a/Theme/Backend/tag-create.tpl.php +++ b/Theme/Backend/tag-create.tpl.php @@ -15,7 +15,7 @@ declare(strict_types=1); use phpOMS\Uri\UriFactory; /** @var \phpOMS\Views\View $this */ -echo $this->getData('nav')->render(); ?> +echo $this->data['nav']->render(); ?>
diff --git a/Theme/Backend/tag-list.tpl.php b/Theme/Backend/tag-list.tpl.php index d086102..109a9b1 100755 --- a/Theme/Backend/tag-list.tpl.php +++ b/Theme/Backend/tag-list.tpl.php @@ -18,12 +18,12 @@ use phpOMS\Uri\UriFactory; * @var \phpOMS\Views\View $this * @var \Modules\Tag\Models\Tag[] $tags */ -$tags = $this->getData('tags'); +$tags = $this->data['tags']; $previous = empty($tags) ? '{/base}/tag/list' : '{/base}/tag/list?{?}&id=' . \reset($tags)->id . '&ptype=p'; $next = empty($tags) ? '{/base}/tag/list' : '{/base}/tag/list?{?}&id=' . \end($tags)->id . '&ptype=n'; -echo $this->getData('nav')->render(); ?> +echo $this->data['nav']->render(); ?>
diff --git a/Theme/Backend/tag-single.tpl.php b/Theme/Backend/tag-single.tpl.php index 7906229..1379443 100755 --- a/Theme/Backend/tag-single.tpl.php +++ b/Theme/Backend/tag-single.tpl.php @@ -16,11 +16,11 @@ use phpOMS\Localization\ISO639Enum; use phpOMS\Uri\UriFactory; /** @var \Modules\Tag\Models\Tag */ -$tag = $this->getData('tag'); -$l11n = $this->getData('l11n') ?? []; +$tag = $this->data['tag']; +$l11n = $this->data['l11n'] ?? []; /** @var \phpOMS\Views\View $this */ -echo $this->getData('nav')->render(); ?> +echo $this->data['nav']->render(); ?>