Make app,localization in url optional+tld+subdomain

This commit is contained in:
Dennis Eichhorn 2019-03-09 23:21:29 +01:00
parent 75bb2f6627
commit e069e55bb8
8 changed files with 28 additions and 28 deletions

View File

@ -1,11 +1,11 @@
[ [
{ {
"id": 1000301001, "id": 1000301001,
"pid": "/backend", "pid": "/",
"type": 2, "type": 2,
"subtype": 1, "subtype": 1,
"name": "Profiles", "name": "Profiles",
"uri": "{/lang}/backend/profile/list?{?}", "uri": "{/prefix}profile/list?{?}",
"target": "self", "target": "self",
"icon": null, "icon": null,
"order": 10, "order": 10,
@ -15,11 +15,11 @@
"children": [ "children": [
{ {
"id": 1000302001, "id": 1000302001,
"pid": "/backend/profile", "pid": "/profile",
"type": 3, "type": 3,
"subtype": 1, "subtype": 1,
"name": "List", "name": "List",
"uri": "{/lang}/backend/profile/list?{?}", "uri": "{/prefix}profile/list?{?}",
"target": "self", "target": "self",
"icon": null, "icon": null,
"order": 1, "order": 1,
@ -30,11 +30,11 @@
}, },
{ {
"id": 1000303001, "id": 1000303001,
"pid": "/backend/profile", "pid": "/profile",
"type": 5, "type": 5,
"subtype": 1, "subtype": 1,
"name": "Profile", "name": "Profile",
"uri": "{/lang}/backend/profile/single/front?{?}", "uri": "{/prefix}profile/single/front?{?}",
"target": "self", "target": "self",
"icon": null, "icon": null,
"order": 3, "order": 3,
@ -45,11 +45,11 @@
}, },
{ {
"id": 1000303002, "id": 1000303002,
"pid": "/backend/profile", "pid": "/profile",
"type": 5, "type": 5,
"subtype": 1, "subtype": 1,
"name": "Settings", "name": "Settings",
"uri": "{/lang}/backend/profile/single/settings?{?}", "uri": "{/prefix}profile/single/settings?{?}",
"target": "self", "target": "self",
"icon": null, "icon": null,
"order": 999, "order": 999,
@ -62,11 +62,11 @@
}, },
{ {
"id": 1000304001, "id": 1000304001,
"pid": "/backend/admin/module/settings", "pid": "/admin/module/settings",
"type": 3, "type": 3,
"subtype": 1, "subtype": 1,
"name": "Overview", "name": "Overview",
"uri": "{/lang}/backend/admin/module/settings?{?}", "uri": "{/prefix}admin/module/settings?{?}",
"target": "self", "target": "self",
"icon": null, "icon": null,
"order": 1, "order": 1,
@ -77,11 +77,11 @@
}, },
{ {
"id": 1000304002, "id": 1000304002,
"pid": "/backend/admin/module/settings", "pid": "/admin/module/settings",
"type": 3, "type": 3,
"subtype": 1, "subtype": 1,
"name": "Settings", "name": "Settings",
"uri": "{/lang}/backend/admin/module/settings/profile/settings?{?}", "uri": "{/prefix}admin/module/settings/profile/settings?{?}",
"target": "self", "target": "self",
"icon": null, "icon": null,
"order": 1, "order": 1,
@ -92,11 +92,11 @@
}, },
{ {
"id": 1000304003, "id": 1000304003,
"pid": "/backend/admin/module/settings", "pid": "/admin/module/settings",
"type": 3, "type": 3,
"subtype": 1, "subtype": 1,
"name": "Create", "name": "Create",
"uri": "{/lang}/backend/admin/module/settings/profile/create?{?}", "uri": "{/prefix}admin/module/settings/profile/create?{?}",
"target": "self", "target": "self",
"icon": null, "icon": null,
"order": 2, "order": 2,

View File

@ -6,7 +6,7 @@ use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb; use phpOMS\Router\RouteVerb;
return [ return [
'^.*/api/profile.*$' => [ '^.*/profile.*$' => [
[ [
'dest' => '\Modules\Profile\Controller\ApiController:apiProfileCreate', 'dest' => '\Modules\Profile\Controller\ApiController:apiProfileCreate',
'verb' => RouteVerb::PUT, 'verb' => RouteVerb::PUT,

View File

@ -6,7 +6,7 @@ use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb; use phpOMS\Router\RouteVerb;
return [ return [
'^.*/backend/profile.*$' => [ '^.*/profile.*$' => [
[ [
'dest' => '\Modules\Profile\Controller\BackendController:setupProfileStyles', 'dest' => '\Modules\Profile\Controller\BackendController:setupProfileStyles',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
@ -17,7 +17,7 @@ return [
], ],
], ],
], ],
'^.*/backend/profile/list.*$' => [ '^.*/profile/list.*$' => [
[ [
'dest' => '\Modules\Profile\Controller\BackendController:viewProfileList', 'dest' => '\Modules\Profile\Controller\BackendController:viewProfileList',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
@ -28,7 +28,7 @@ return [
], ],
], ],
], ],
'^.*/backend/profile/single.*$' => [ '^.*/profile/single.*$' => [
[ [
'dest' => '\Modules\Profile\Controller\BackendController:viewProfileSingle', 'dest' => '\Modules\Profile\Controller\BackendController:viewProfileSingle',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
@ -39,7 +39,7 @@ return [
], ],
], ],
], ],
'^.*/backend/admin/module/settings/profile/settings.*$' => [ '^.*/admin/module/settings/profile/settings.*$' => [
[ [
'dest' => '\Modules\Profile\Controller\BackendController:viewProfileAdminSettings', 'dest' => '\Modules\Profile\Controller\BackendController:viewProfileAdminSettings',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
@ -50,7 +50,7 @@ return [
], ],
], ],
], ],
'^.*/backend/admin/module/settings/profile/create.*$' => [ '^.*/admin/module/settings/profile/create.*$' => [
[ [
'dest' => '\Modules\Profile\Controller\BackendController:viewProfileAdminCreate', 'dest' => '\Modules\Profile\Controller\BackendController:viewProfileAdminCreate',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,

View File

@ -5,9 +5,9 @@
{ {
"key": 1, "listener": "click", "action": [ "key": 1, "listener": "click", "action": [
{"key": 1, "type": "dom.popup", "selector": "#acc-grp-tpl", "aniIn": "fadeIn", "id": "<?= $this->printHtml($this->getId()); ?>"}, {"key": 1, "type": "dom.popup", "selector": "#acc-grp-tpl", "aniIn": "fadeIn", "id": "<?= $this->printHtml($this->getId()); ?>"},
{"key": 2, "type": "message.request", "uri": "<?= \phpOMS\Uri\UriFactory::build('{/lang}/api/admin/account?filter=some&limit=10'); ?>", "method": "GET", "request_type": "json"}, {"key": 2, "type": "message.request", "uri": "<?= \phpOMS\Uri\UriFactory::build('{/prefix}admin/account?filter=some&limit=10'); ?>", "method": "GET", "request_type": "json"},
{"key": 3, "type": "dom.table.append", "id": "acc-table", "aniIn": "fadeIn", "data": [], "bindings": {"id": "id", "name": "name/0"}, "position": -1}, {"key": 3, "type": "dom.table.append", "id": "acc-table", "aniIn": "fadeIn", "data": [], "bindings": {"id": "id", "name": "name/0"}, "position": -1},
{"key": 4, "type": "message.request", "uri": "<?= \phpOMS\Uri\UriFactory::build('{/lang}/api/admin/account?filter=some&limit=10'); ?>", "method": "GET", "request_type": "json"}, {"key": 4, "type": "message.request", "uri": "<?= \phpOMS\Uri\UriFactory::build('{/prefix}admin/account?filter=some&limit=10'); ?>", "method": "GET", "request_type": "json"},
{"key": 5, "type": "dom.table.append", "id": "grp-table", "aniIn": "fadeIn", "data": [], "bindings": {"id": "id", "name": "name/0"}, "position": -1} {"key": 5, "type": "dom.table.append", "id": "grp-table", "aniIn": "fadeIn", "data": [], "bindings": {"id": "id", "name": "name/0"}, "position": -1}
] ]
} }

View File

@ -9,7 +9,7 @@ echo $this->getData('nav')->render();
<header><h1><?= $this->getHtml('CreateProfile'); ?></h1></header> <header><h1><?= $this->getHtml('CreateProfile'); ?></h1></header>
<div class="inner"> <div class="inner">
<form id="fProfileCreate" method="PUT" action="<?= \phpOMS\Uri\UriFactory::build('{/lang}/api/profile?{?}&csrf={$CSRF}'); ?>"> <form id="fProfileCreate" method="PUT" action="<?= \phpOMS\Uri\UriFactory::build('{/api}profile?{?}&csrf={$CSRF}'); ?>">
<table class="layout wf-100" style="table-layout: fixed"> <table class="layout wf-100" style="table-layout: fixed">
<tbody> <tbody>
<tr><td><label for="iAccount"><?= $this->getHtml('Account') ?></label> <tr><td><label for="iAccount"><?= $this->getHtml('Account') ?></label>

View File

@ -37,7 +37,7 @@ $accounts = $this->getData('accounts');
<td colspan="3"> <td colspan="3">
<tbody> <tbody>
<?php $count = 0; foreach ($accounts as $key => $account) : ++$count; <?php $count = 0; foreach ($accounts as $key => $account) : ++$count;
$url = \phpOMS\Uri\UriFactory::build('{/lang}/backend/profile/single?{?}&id=' . $account->getAccount()->getId()); ?> $url = \phpOMS\Uri\UriFactory::build('{/prefix}profile/single?{?}&id=' . $account->getAccount()->getId()); ?>
<tr data-href="<?= $url; ?>"> <tr data-href="<?= $url; ?>">
<td data-label="<?= $this->getHtml('ID', 0, 0) ?>"><a href="<?= $url; ?>"><?= $this->printHtml($account->getAccount()->getId()); ?></a> <td data-label="<?= $this->getHtml('ID', 0, 0) ?>"><a href="<?= $url; ?>"><?= $this->printHtml($account->getAccount()->getId()); ?></a>
<td data-label="<?= $this->getHtml('Name') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($account->getAccount()->getName3() . ' ' . $account->getAccount()->getName2() . ' ' . $account->getAccount()->getName1()); ?></a> <td data-label="<?= $this->getHtml('Name') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($account->getAccount()->getName3() . ' ' . $account->getAccount()->getName2() . ' ' . $account->getAccount()->getName1()); ?></a>

View File

@ -49,7 +49,7 @@ echo $this->getData('nav')->render();
<header><h1><span itemprop="familyName"><?= $this->printHtml(empty($account->getAccount()->getName3()) ? $account->getAccount()->getName2() : $account->getAccount()->getName3()); ?></span>, <span itemprop="givenName"><?= $this->printHtml($account->getAccount()->getName1()); ?></span></h1></header> <header><h1><span itemprop="familyName"><?= $this->printHtml(empty($account->getAccount()->getName3()) ? $account->getAccount()->getName2() : $account->getAccount()->getName3()); ?></span>, <span itemprop="givenName"><?= $this->printHtml($account->getAccount()->getName1()); ?></span></h1></header>
<div class="inner"> <div class="inner">
<!-- @formatter:off --> <!-- @formatter:off -->
<span class="rf"><img class="m-profile rf" alt="<?= $this->getHtml('ProfileImage'); ?>" data-lazyload="<?= $account->getImage() instanceof \Modules\Media\Models\NullMedia ? \phpOMS\Uri\UriFactory::build('Web/Backend/img/user_default_' . mt_rand(1, 6) .'.png') : \phpOMS\Uri\UriFactory::build('' . $account->getImage()->getPath()); ?>"> <span class="rf"><img class="m-profile rf" alt="<?= $this->getHtml('ProfileImage'); ?>" data-lazyload="<?= $account->getImage() instanceof \Modules\Media\Models\NullMedia ? \phpOMS\Uri\UriFactory::build('Web/Backend/img/user_default_' . mt_rand(1, 6) .'.png') : \phpOMS\Uri\UriFactory::build('{/prefix}' . $account->getImage()->getPath()); ?>">
</span> </span>
<table class="list" style="table-layout: fixed"> <table class="list" style="table-layout: fixed">
<tr> <tr>
@ -128,7 +128,7 @@ echo $this->getData('nav')->render();
<section class="box wf-100"> <section class="box wf-100">
<header><h1><?= $this->getHtml('Localization'); ?></h1></header> <header><h1><?= $this->getHtml('Localization'); ?></h1></header>
<div class="inner"> <div class="inner">
<form id="fLocalization" name="fLocalization" action="<?= \phpOMS\Uri\UriFactory::build('{/lang}/api/admin/settings/localization'); ?>" method="post"> <form id="fLocalization" name="fLocalization" action="<?= \phpOMS\Uri\UriFactory::build('{/api}admin/settings/localization'); ?>" method="post">
<table class="layout wf-100"> <table class="layout wf-100">
<tbody> <tbody>
<tr><td><label for="iDefaultLocalizations"><?= $this->getHtml('Defaults'); ?></label> <tr><td><label for="iDefaultLocalizations"><?= $this->getHtml('Defaults'); ?></label>

View File

@ -29,7 +29,7 @@
"load": [ "load": [
{ {
"pid": [ "pid": [
"/backend/profile" "/profile"
], ],
"type": 4, "type": 4,
"for": "Content", "for": "Content",
@ -38,7 +38,7 @@
}, },
{ {
"pid": [ "pid": [
"/backend" "/"
], ],
"type": 5, "type": 5,
"from": "Profile", "from": "Profile",