mirror of
https://github.com/Karaka-Management/oms-Media.git
synced 2026-02-16 17:28:41 +00:00
Make app,localization in url optional+tld+subdomain
This commit is contained in:
parent
7ea75292a6
commit
9f95efa77f
|
|
@ -1,11 +1,11 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"id": 1000401001,
|
"id": 1000401001,
|
||||||
"pid": "/backend",
|
"pid": "/",
|
||||||
"type": 2,
|
"type": 2,
|
||||||
"subtype": 1,
|
"subtype": 1,
|
||||||
"name": "Media",
|
"name": "Media",
|
||||||
"uri": "{/lang}/backend/media/list?{?}",
|
"uri": "{/prefix}media/list?{?}",
|
||||||
"target": "self",
|
"target": "self",
|
||||||
"icon": null,
|
"icon": null,
|
||||||
"order": 20,
|
"order": 20,
|
||||||
|
|
@ -15,11 +15,11 @@
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"id": 1000402001,
|
"id": 1000402001,
|
||||||
"pid": "/backend/media",
|
"pid": "/media",
|
||||||
"type": 3,
|
"type": 3,
|
||||||
"subtype": 1,
|
"subtype": 1,
|
||||||
"name": "List",
|
"name": "List",
|
||||||
"uri": "{/lang}/backend/media/list?{?}",
|
"uri": "{/prefix}media/list?{?}",
|
||||||
"target": "self",
|
"target": "self",
|
||||||
"icon": null,
|
"icon": null,
|
||||||
"order": 1,
|
"order": 1,
|
||||||
|
|
@ -30,11 +30,11 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 1000403001,
|
"id": 1000403001,
|
||||||
"pid": "/backend/media",
|
"pid": "/media",
|
||||||
"type": 3,
|
"type": 3,
|
||||||
"subtype": 5,
|
"subtype": 5,
|
||||||
"name": "Create",
|
"name": "Create",
|
||||||
"uri": "{/lang}/backend/media/create?{?}",
|
"uri": "{/prefix}media/create?{?}",
|
||||||
"target": "self",
|
"target": "self",
|
||||||
"icon": null,
|
"icon": null,
|
||||||
"order": 5,
|
"order": 5,
|
||||||
|
|
@ -47,11 +47,11 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 1000410001,
|
"id": 1000410001,
|
||||||
"pid": "/backend/profile/single",
|
"pid": "/profile/single",
|
||||||
"type": 2,
|
"type": 2,
|
||||||
"subtype": 2,
|
"subtype": 2,
|
||||||
"name": "Media",
|
"name": "Media",
|
||||||
"uri": "{/lang}/backend/profile/single/media?{?}",
|
"uri": "{/prefix}profile/single/media?{?}",
|
||||||
"target": "self",
|
"target": "self",
|
||||||
"icon": null,
|
"icon": null,
|
||||||
"order": 3,
|
"order": 3,
|
||||||
|
|
@ -62,11 +62,11 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 1000410002,
|
"id": 1000410002,
|
||||||
"pid": "/backend/admin/account",
|
"pid": "/admin/account",
|
||||||
"type": 3,
|
"type": 3,
|
||||||
"subtype": 1,
|
"subtype": 1,
|
||||||
"name": "Media",
|
"name": "Media",
|
||||||
"uri": "{/lang}/backend/admin/account/single/media?{?}",
|
"uri": "{/prefix}admin/account/single/media?{?}",
|
||||||
"target": "self",
|
"target": "self",
|
||||||
"icon": null,
|
"icon": null,
|
||||||
"order": 3,
|
"order": 3,
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ use phpOMS\Account\PermissionType;
|
||||||
use phpOMS\Router\RouteVerb;
|
use phpOMS\Router\RouteVerb;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'^.*/api/media$' => [
|
'^.*/media$' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\Media\Controller\ApiController:apiMediaUpload',
|
'dest' => '\Modules\Media\Controller\ApiController:apiMediaUpload',
|
||||||
'verb' => RouteVerb::SET,
|
'verb' => RouteVerb::SET,
|
||||||
|
|
@ -22,7 +22,7 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'^.*/api/media/create.*$' => [
|
'^.*/media/create.*$' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\Media\Controller\ApiController:apiMediaCreate',
|
'dest' => '\Modules\Media\Controller\ApiController:apiMediaCreate',
|
||||||
'verb' => RouteVerb::SET,
|
'verb' => RouteVerb::SET,
|
||||||
|
|
@ -34,7 +34,7 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
// todo: the order of find is bad but needed for now.
|
// todo: the order of find is bad but needed for now.
|
||||||
'^.*/api/media/find.*$' => [
|
'^.*/media/find.*$' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\Media\Controller\ApiController:apiMediaFind',
|
'dest' => '\Modules\Media\Controller\ApiController:apiMediaFind',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ use phpOMS\Account\PermissionType;
|
||||||
use phpOMS\Router\RouteVerb;
|
use phpOMS\Router\RouteVerb;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'^.*/backend/media/list.*$' => [
|
'^.*/media/list.*$' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\Media\Controller\BackendController:viewMediaList',
|
'dest' => '\Modules\Media\Controller\BackendController:viewMediaList',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
@ -17,7 +17,7 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'^.*/backend/media/create.*$' => [
|
'^.*/media/create.*$' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\Media\Controller\BackendController:setUpFileUploader',
|
'dest' => '\Modules\Media\Controller\BackendController:setUpFileUploader',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
@ -37,7 +37,7 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'^.*/backend/media/single.*$' => [
|
'^.*/media/single.*$' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\Media\Controller\BackendController:viewMediaSingle',
|
'dest' => '\Modules\Media\Controller\BackendController:viewMediaSingle',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php $count = 0; foreach ($this->media as $key => $value) : ++$count;
|
<?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 = '';
|
$icon = '';
|
||||||
$extensionType = \phpOMS\System\File\FileUtils::getExtensionType($value->getExtension());
|
$extensionType = \phpOMS\System\File\FileUtils::getExtensionType($value->getExtension());
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ echo $this->getData('nav')->render(); ?>
|
||||||
<section class="box wf-100">
|
<section class="box wf-100">
|
||||||
<header><h1><?= $this->getHtml('Upload') ?></h1></header>
|
<header><h1><?= $this->getHtml('Upload') ?></h1></header>
|
||||||
<div class="inner">
|
<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">
|
<table class="layout wf-100">
|
||||||
<tr><td><label for="iName"><?= $this->getHtml('Name') ?></label>
|
<tr><td><label for="iName"><?= $this->getHtml('Name') ?></label>
|
||||||
<tr><td><input type="text" id="iName" name="name" placeholder="">
|
<tr><td><input type="text" id="iName" name="name" placeholder="">
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ echo $this->getData('nav')->render(); ?>
|
||||||
<?php $count = 0;
|
<?php $count = 0;
|
||||||
foreach ($media as $key => $value) :
|
foreach ($media as $key => $value) :
|
||||||
++$count;
|
++$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()));
|
$icon = $fileIconFunction(\phpOMS\System\File\FileUtils::getExtensionType($value->getExtension()));
|
||||||
?>
|
?>
|
||||||
<tr data-href="<?= $url; ?>">
|
<tr data-href="<?= $url; ?>">
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ echo $this->getData('nav')->render();
|
||||||
|| $media->getPath() === ''
|
|| $media->getPath() === ''
|
||||||
) :
|
) :
|
||||||
foreach ($media as $key => $value) :
|
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()));
|
$icon = $fileIconFunction(FileUtils::getExtensionType($value->getExtension()));
|
||||||
?>
|
?>
|
||||||
<tr data-href="<?= $url; ?>">
|
<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 endforeach; else : $path = $this->dirPathFunction($media, $this->request->getData('sub') ?? ''); ?>
|
||||||
<?php $list = \phpOMS\System\File\Local\Directory::list($path);
|
<?php $list = \phpOMS\System\File\Local\Directory::list($path);
|
||||||
foreach ($list as $key => $value) :
|
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'));
|
$icon = $this->fileIconFunction(FileUtils::getExtensionType(!\is_dir($value) ? File::extension($value) : 'collection'));
|
||||||
?>
|
?>
|
||||||
<tr data-href="<?= $url; ?>">
|
<tr data-href="<?= $url; ?>">
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
"load": [
|
"load": [
|
||||||
{
|
{
|
||||||
"pid": [
|
"pid": [
|
||||||
"/backend/media"
|
"/media"
|
||||||
],
|
],
|
||||||
"type": 4,
|
"type": 4,
|
||||||
"for": "Content",
|
"for": "Content",
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pid": [
|
"pid": [
|
||||||
"/backend/admin"
|
"/admin"
|
||||||
],
|
],
|
||||||
"type": 4,
|
"type": 4,
|
||||||
"for": "Admin",
|
"for": "Admin",
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pid": [
|
"pid": [
|
||||||
"/backend"
|
"/"
|
||||||
],
|
],
|
||||||
"type": 5,
|
"type": 5,
|
||||||
"from": "Media",
|
"from": "Media",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user