From 64b73bdcf6c5555b7c14c5dcadc930adde001ca8 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 30 May 2023 04:15:41 +0200 Subject: [PATCH] continue with getter/setter removal --- .../Install/Application/Shop/Application.php | 24 +++++++++---------- Admin/Install/Application/Shop/index.tpl.php | 2 +- Controller/ApiController.php | 4 ++-- Controller/BackendController.php | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Admin/Install/Application/Shop/Application.php b/Admin/Install/Application/Shop/Application.php index 8252002..1df3092 100755 --- a/Admin/Install/Application/Shop/Application.php +++ b/Admin/Install/Application/Shop/Application.php @@ -154,7 +154,7 @@ final class Application if ($account->id > 0) { $response->header->l11n = $account->l11n; } elseif ($this->app->sessionManager->get('language') !== null - && $response->header->l11n->getLanguage() !== $this->app->sessionManager->get('language') + && $response->header->l11n->language !== $this->app->sessionManager->get('language') ) { $response->header->l11n ->loadFromLanguage( @@ -165,7 +165,7 @@ final class Application $this->app->setResponseLanguage($request, $response, $this->config); } - if (!\in_array($response->getLanguage(), $this->config['language'])) { + if (!\in_array($response->header->l11n->language, $this->config['language'])) { $response->header->l11n->setLanguage($this->app->l11nServer->getLanguage()); } @@ -190,14 +190,14 @@ final class Application return; } - UriFactory::setQuery('/lang', $response->getLanguage()); + UriFactory::setQuery('/lang', $response->header->l11n->language); $this->loadLanguageFromPath( - $response->getLanguage(), - __DIR__ . '/lang/' . $response->getLanguage() . '.lang.php' + $response->header->l11n->language, + __DIR__ . '/lang/' . $response->header->l11n->language . '.lang.php' ); - $response->header->set('content-language', $response->getLanguage(), true); + $response->header->set('content-language', $response->header->l11n->language, true); /* Create html head */ $this->initResponseHead($head, $request, $response); @@ -255,8 +255,8 @@ final class Application $response->header->status = RequestStatusCode::R_406; $pageView->setTemplate('/Web/{APPNAME}/Error/406'); $this->loadLanguageFromPath( - $response->getLanguage(), - __DIR__ . '/Error/lang/' . $response->getLanguage() . '.lang.php' + $response->header->l11n->language, + __DIR__ . '/Error/lang/' . $response->header->l11n->language . '.lang.php' ); } @@ -275,8 +275,8 @@ final class Application $response->header->status = RequestStatusCode::R_503; $pageView->setTemplate('/Web/{APPNAME}/Error/503'); $this->loadLanguageFromPath( - $response->getLanguage(), - __DIR__ . '/Error/lang/' . $response->getLanguage() . '.lang.php' + $response->header->l11n->language, + __DIR__ . '/Error/lang/' . $response->header->l11n->language . '.lang.php' ); } @@ -334,8 +334,8 @@ final class Application $response->header->status = RequestStatusCode::R_403; $pageView->setTemplate('/Web/{APPNAME}/Error/403'); $this->loadLanguageFromPath( - $response->getLanguage(), - __DIR__ . '/Error/lang/' . $response->getLanguage() . '.lang.php' + $response->header->l11n->language, + __DIR__ . '/Error/lang/' . $response->header->l11n->language . '.lang.php' ); } diff --git a/Admin/Install/Application/Shop/index.tpl.php b/Admin/Install/Application/Shop/index.tpl.php index 6e064d3..fd9d804 100755 --- a/Admin/Install/Application/Shop/index.tpl.php +++ b/Admin/Install/Application/Shop/index.tpl.php @@ -22,7 +22,7 @@ $head = $this->getData('head'); $dispatch = $this->getData('dispatch') ?? []; ?> - + diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 934b94f..a8da82e 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -516,7 +516,7 @@ final class ApiController extends Controller $attrL11n = new BaseStringL11n(); $attrL11n->ref = $request->getDataInt('type') ?? 0; $attrL11n->setLanguage( - $request->getDataString('language') ?? $request->getLanguage() + $request->getDataString('language') ?? $request->header->l11n->language ); $attrL11n->content = $request->getDataString('title') ?? ''; @@ -737,7 +737,7 @@ final class ApiController extends Controller $attrL11n = new BaseStringL11n(); $attrL11n->ref = $request->getDataInt('value') ?? 0; $attrL11n->setLanguage( - $request->getDataString('language') ?? $request->getLanguage() + $request->getDataString('language') ?? $request->header->l11n->language ); $attrL11n->content = $request->getDataString('title') ?? ''; diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 415872b..20dd558 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -130,7 +130,7 @@ final class BackendController extends Controller ->with('attributes') ->with('for') ->with('app') - ->where('task/tags/title/language', $request->getLanguage()); + ->where('task/tags/title/language', $request->header->l11n->language); /** @var \Modules\Support\Models\Ticket $ticket */ $ticket = $request->hasData('for')