Make app,localization in url optional+tld+subdomain

This commit is contained in:
Dennis Eichhorn 2019-03-09 23:21:29 +01:00
parent 7ea75292a6
commit 9f95efa77f
8 changed files with 24 additions and 24 deletions

View File

@ -1,11 +1,11 @@
[
{
"id": 1000401001,
"pid": "/backend",
"pid": "/",
"type": 2,
"subtype": 1,
"name": "Media",
"uri": "{/lang}/backend/media/list?{?}",
"uri": "{/prefix}media/list?{?}",
"target": "self",
"icon": null,
"order": 20,
@ -15,11 +15,11 @@
"children": [
{
"id": 1000402001,
"pid": "/backend/media",
"pid": "/media",
"type": 3,
"subtype": 1,
"name": "List",
"uri": "{/lang}/backend/media/list?{?}",
"uri": "{/prefix}media/list?{?}",
"target": "self",
"icon": null,
"order": 1,
@ -30,11 +30,11 @@
},
{
"id": 1000403001,
"pid": "/backend/media",
"pid": "/media",
"type": 3,
"subtype": 5,
"name": "Create",
"uri": "{/lang}/backend/media/create?{?}",
"uri": "{/prefix}media/create?{?}",
"target": "self",
"icon": null,
"order": 5,
@ -47,11 +47,11 @@
},
{
"id": 1000410001,
"pid": "/backend/profile/single",
"pid": "/profile/single",
"type": 2,
"subtype": 2,
"name": "Media",
"uri": "{/lang}/backend/profile/single/media?{?}",
"uri": "{/prefix}profile/single/media?{?}",
"target": "self",
"icon": null,
"order": 3,
@ -62,11 +62,11 @@
},
{
"id": 1000410002,
"pid": "/backend/admin/account",
"pid": "/admin/account",
"type": 3,
"subtype": 1,
"name": "Media",
"uri": "{/lang}/backend/admin/account/single/media?{?}",
"uri": "{/prefix}admin/account/single/media?{?}",
"target": "self",
"icon": null,
"order": 3,

View File

@ -6,7 +6,7 @@ use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb;
return [
'^.*/api/media$' => [
'^.*/media$' => [
[
'dest' => '\Modules\Media\Controller\ApiController:apiMediaUpload',
'verb' => RouteVerb::SET,
@ -22,7 +22,7 @@ return [
],
],
],
'^.*/api/media/create.*$' => [
'^.*/media/create.*$' => [
[
'dest' => '\Modules\Media\Controller\ApiController:apiMediaCreate',
'verb' => RouteVerb::SET,
@ -34,7 +34,7 @@ return [
],
],
// todo: the order of find is bad but needed for now.
'^.*/api/media/find.*$' => [
'^.*/media/find.*$' => [
[
'dest' => '\Modules\Media\Controller\ApiController:apiMediaFind',
'verb' => RouteVerb::GET,

View File

@ -6,7 +6,7 @@ use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb;
return [
'^.*/backend/media/list.*$' => [
'^.*/media/list.*$' => [
[
'dest' => '\Modules\Media\Controller\BackendController:viewMediaList',
'verb' => RouteVerb::GET,
@ -17,7 +17,7 @@ return [
],
],
],
'^.*/backend/media/create.*$' => [
'^.*/media/create.*$' => [
[
'dest' => '\Modules\Media\Controller\BackendController:setUpFileUploader',
'verb' => RouteVerb::GET,
@ -37,7 +37,7 @@ return [
],
],
],
'^.*/backend/media/single.*$' => [
'^.*/media/single.*$' => [
[
'dest' => '\Modules\Media\Controller\BackendController:viewMediaSingle',
'verb' => RouteVerb::GET,

View File

@ -11,7 +11,7 @@
<tfoot>
<tbody>
<?php $count = 0; foreach ($this->media as $key => $value) : ++$count;
$url = \phpOMS\Uri\UriFactory::build('{/lang}/backend/media/single?{?}&id=' . $value->getId());
$url = \phpOMS\Uri\UriFactory::build('{/prefix}media/single?{?}&id=' . $value->getId());
$icon = '';
$extensionType = \phpOMS\System\File\FileUtils::getExtensionType($value->getExtension());

View File

@ -20,7 +20,7 @@ echo $this->getData('nav')->render(); ?>
<section class="box wf-100">
<header><h1><?= $this->getHtml('Upload') ?></h1></header>
<div class="inner">
<form method="POST" id="media-uploader" action="<?= \phpOMS\Uri\UriFactory::build('{/lang}/api/media'); ?>">
<form method="POST" id="media-uploader" action="<?= \phpOMS\Uri\UriFactory::build('{/api}media'); ?>">
<table class="layout wf-100">
<tr><td><label for="iName"><?= $this->getHtml('Name') ?></label>
<tr><td><input type="text" id="iName" name="name" placeholder="&#xf040;">

View File

@ -38,7 +38,7 @@ echo $this->getData('nav')->render(); ?>
<?php $count = 0;
foreach ($media as $key => $value) :
++$count;
$url = \phpOMS\Uri\UriFactory::build('{/lang}/backend/media/single?{?}&id=' . $value->getId());
$url = \phpOMS\Uri\UriFactory::build('{/prefix}media/single?{?}&id=' . $value->getId());
$icon = $fileIconFunction(\phpOMS\System\File\FileUtils::getExtensionType($value->getExtension()));
?>
<tr data-href="<?= $url; ?>">

View File

@ -64,7 +64,7 @@ echo $this->getData('nav')->render();
|| $media->getPath() === ''
) :
foreach ($media as $key => $value) :
$url = UriFactory::build('{/lang}/backend/media/single?{?}&id=' . $value->getId());
$url = UriFactory::build('{/prefix}media/single?{?}&id=' . $value->getId());
$icon = $fileIconFunction(FileUtils::getExtensionType($value->getExtension()));
?>
<tr data-href="<?= $url; ?>">
@ -77,7 +77,7 @@ echo $this->getData('nav')->render();
<?php endforeach; else : $path = $this->dirPathFunction($media, $this->request->getData('sub') ?? ''); ?>
<?php $list = \phpOMS\System\File\Local\Directory::list($path);
foreach ($list as $key => $value) :
$url = UriFactory::build('{/lang}/backend/media/single?{?}&id=' . $media->getId() . '&sub=' . \substr($value, \strlen($media->getPath())));
$url = UriFactory::build('{/prefix}media/single?{?}&id=' . $media->getId() . '&sub=' . \substr($value, \strlen($media->getPath())));
$icon = $this->fileIconFunction(FileUtils::getExtensionType(!\is_dir($value) ? File::extension($value) : 'collection'));
?>
<tr data-href="<?= $url; ?>">

View File

@ -26,7 +26,7 @@
"load": [
{
"pid": [
"/backend/media"
"/media"
],
"type": 4,
"for": "Content",
@ -35,7 +35,7 @@
},
{
"pid": [
"/backend/admin"
"/admin"
],
"type": 4,
"for": "Admin",
@ -44,7 +44,7 @@
},
{
"pid": [
"/backend"
"/"
],
"type": 5,
"from": "Media",