Fix absolute path to relative paths

This commit is contained in:
Dennis Eichhorn 2019-02-11 11:38:15 +01:00
parent afc2285249
commit e4c0255dfb
6 changed files with 12 additions and 12 deletions

View File

@ -5,7 +5,7 @@
"type": 2,
"subtype": 1,
"name": "Media",
"uri": "/{/lang}/backend/media/list?{?}",
"uri": "{/lang}/backend/media/list?{?}",
"target": "self",
"icon": null,
"order": 20,
@ -19,7 +19,7 @@
"type": 3,
"subtype": 1,
"name": "List",
"uri": "/{/lang}/backend/media/list?{?}",
"uri": "{/lang}/backend/media/list?{?}",
"target": "self",
"icon": null,
"order": 1,
@ -34,7 +34,7 @@
"type": 3,
"subtype": 5,
"name": "Create",
"uri": "/{/lang}/backend/media/create?{?}",
"uri": "{/lang}/backend/media/create?{?}",
"target": "self",
"icon": null,
"order": 5,
@ -51,7 +51,7 @@
"type": 2,
"subtype": 2,
"name": "Media",
"uri": "/{/lang}/backend/profile/single/media?{?}",
"uri": "{/lang}/backend/profile/single/media?{?}",
"target": "self",
"icon": null,
"order": 3,
@ -66,7 +66,7 @@
"type": 3,
"subtype": 1,
"name": "Media",
"uri": "/{/lang}/backend/admin/account/single/media?{?}",
"uri": "{/lang}/backend/admin/account/single/media?{?}",
"target": "self",
"icon": null,
"order": 3,

View File

@ -98,8 +98,8 @@ final class BackendController extends Controller
{
/** @var \phpOMS\Model\Html\Head $head */
$head = $response->get('Content')->getData('head');
$head->addAsset(AssetType::JSLATE, '/Modules/Media/Models/Upload.js');
$head->addAsset(AssetType::JSLATE, '/Modules/Media/Controller.js');
$head->addAsset(AssetType::JSLATE, 'Modules/Media/Models/Upload.js');
$head->addAsset(AssetType::JSLATE, 'Modules/Media/Controller.js');
}
/**

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('{/lang}/backend/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('{/lang}/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('{/lang}/backend/media/single?{?}&id=' . $value->getId());
$icon = $fileIconFunction(\phpOMS\System\File\FileUtils::getExtensionType($value->getExtension()));
?>
<tr data-href="<?= $url; ?>">

View File

@ -63,7 +63,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('{/lang}/backend/media/single?{?}&id=' . $value->getId());
$icon = $fileIconFunction(FileUtils::getExtensionType($value->getExtension()));
?>
<tr data-href="<?= $url; ?>">
@ -76,7 +76,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('{/lang}/backend/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; ?>">