Merge branch 'develop' of https://github.com/Karaka-Management/oms-Shop into develop

This commit is contained in:
Dennis Eichhorn 2023-05-30 13:58:56 +00:00
commit b87ccce07e
3 changed files with 18 additions and 18 deletions

View File

@ -154,7 +154,7 @@ final class Application
if ($account->id > 0) { if ($account->id > 0) {
$response->header->l11n = $account->l11n; $response->header->l11n = $account->l11n;
} elseif ($this->app->sessionManager->get('language') !== null } 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 $response->header->l11n
->loadFromLanguage( ->loadFromLanguage(
@ -165,7 +165,7 @@ final class Application
$this->app->setResponseLanguage($request, $response, $this->config); $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()); $response->header->l11n->setLanguage($this->app->l11nServer->getLanguage());
} }
@ -173,7 +173,7 @@ final class Application
$head = new Head(); $head = new Head();
$pageView->setData('unitId', $this->app->unitId); $pageView->setData('unitId', $this->app->unitId);
$pageView->setData('head', $head); $pageView->data['head'] = $head;
$response->set('Content', $pageView); $response->set('Content', $pageView);
/* App only allows GET */ /* App only allows GET */
@ -190,14 +190,14 @@ final class Application
return; return;
} }
UriFactory::setQuery('/lang', $response->getLanguage()); UriFactory::setQuery('/lang', $response->header->l11n->language);
$this->loadLanguageFromPath( $this->loadLanguageFromPath(
$response->getLanguage(), $response->header->l11n->language,
__DIR__ . '/lang/' . $response->getLanguage() . '.lang.php' __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 */ /* Create html head */
$this->initResponseHead($head, $request, $response); $this->initResponseHead($head, $request, $response);
@ -255,8 +255,8 @@ final class Application
$response->header->status = RequestStatusCode::R_406; $response->header->status = RequestStatusCode::R_406;
$pageView->setTemplate('/Web/{APPNAME}/Error/406'); $pageView->setTemplate('/Web/{APPNAME}/Error/406');
$this->loadLanguageFromPath( $this->loadLanguageFromPath(
$response->getLanguage(), $response->header->l11n->language,
__DIR__ . '/Error/lang/' . $response->getLanguage() . '.lang.php' __DIR__ . '/Error/lang/' . $response->header->l11n->language . '.lang.php'
); );
} }
@ -275,8 +275,8 @@ final class Application
$response->header->status = RequestStatusCode::R_503; $response->header->status = RequestStatusCode::R_503;
$pageView->setTemplate('/Web/{APPNAME}/Error/503'); $pageView->setTemplate('/Web/{APPNAME}/Error/503');
$this->loadLanguageFromPath( $this->loadLanguageFromPath(
$response->getLanguage(), $response->header->l11n->language,
__DIR__ . '/Error/lang/' . $response->getLanguage() . '.lang.php' __DIR__ . '/Error/lang/' . $response->header->l11n->language . '.lang.php'
); );
} }
@ -334,8 +334,8 @@ final class Application
$response->header->status = RequestStatusCode::R_403; $response->header->status = RequestStatusCode::R_403;
$pageView->setTemplate('/Web/{APPNAME}/Error/403'); $pageView->setTemplate('/Web/{APPNAME}/Error/403');
$this->loadLanguageFromPath( $this->loadLanguageFromPath(
$response->getLanguage(), $response->header->l11n->language,
__DIR__ . '/Error/lang/' . $response->getLanguage() . '.lang.php' __DIR__ . '/Error/lang/' . $response->header->l11n->language . '.lang.php'
); );
} }

View File

@ -16,13 +16,13 @@ declare(strict_types=1);
use phpOMS\Uri\UriFactory; use phpOMS\Uri\UriFactory;
/** @var phpOMS\Model\Html\Head $head */ /** @var phpOMS\Model\Html\Head $head */
$head = $this->getData('head'); $head = $this->head;
/** @var array $dispatch */ /** @var array $dispatch */
$dispatch = $this->getData('dispatch') ?? []; $dispatch = $this->getData('dispatch') ?? [];
?> ?>
<!DOCTYPE HTML> <!DOCTYPE HTML>
<html lang="<?= $this->printHtml($this->response->getLanguage()); ?>"> <html lang="<?= $this->printHtml($this->response->header->l11n->language); ?>">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">

View File

@ -61,7 +61,7 @@ final class ApiController extends Controller
->where('id', $request->getDataInt('item')) ->where('id', $request->getDataInt('item'))
->execute(); ->execute();
$itemFiles = $item->getFiles(); $itemFiles = $item->files;
foreach ($itemFiles as $file) { foreach ($itemFiles as $file) {
if ($file->id === $request->getDataInt('id') if ($file->id === $request->getDataInt('id')
&& ($file->hasMediaTypeName('item_demo_download') && ($file->hasMediaTypeName('item_demo_download')
@ -104,7 +104,7 @@ final class ApiController extends Controller
} }
foreach ($items as $item) { foreach ($items as $item) {
$files = $item->getFiles(); $files = $item->files;
foreach ($files as $file) { foreach ($files as $file) {
if ($file->id === $request->getDataInt('id') if ($file->id === $request->getDataInt('id')
@ -236,7 +236,7 @@ final class ApiController extends Controller
->with('attributes/value') ->with('attributes/value')
->with('l11n/type') ->with('l11n/type')
->where('l11n/type/title', ['name1', 'name2', 'name3'], 'IN') ->where('l11n/type/title', ['name1', 'name2', 'name3'], 'IN')
->where('l11n/language', $bill->getLanguage()); ->where('l11n/language', $bill->language);
/** @var \Modules\ItemManagement\Models\Item $item */ /** @var \Modules\ItemManagement\Models\Item $item */
$item = $itemMapper->execute(); $item = $itemMapper->execute();