mirror of
https://github.com/Karaka-Management/oms-Media.git
synced 2026-02-14 08:18:41 +00:00
Fix #13
This commit is contained in:
parent
04d8ae82c3
commit
23bcfcb5f7
|
|
@ -5,7 +5,7 @@
|
||||||
"type": 2,
|
"type": 2,
|
||||||
"subtype": 1,
|
"subtype": 1,
|
||||||
"name": "Media",
|
"name": "Media",
|
||||||
"uri": "{/base}/{/lang}/backend/media/list?{?}",
|
"uri": "/{/lang}/backend/media/list?{?}",
|
||||||
"target": "self",
|
"target": "self",
|
||||||
"icon": null,
|
"icon": null,
|
||||||
"order": 20,
|
"order": 20,
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
"type": 3,
|
"type": 3,
|
||||||
"subtype": 1,
|
"subtype": 1,
|
||||||
"name": "List",
|
"name": "List",
|
||||||
"uri": "{/base}/{/lang}/backend/media/list?{?}",
|
"uri": "/{/lang}/backend/media/list?{?}",
|
||||||
"target": "self",
|
"target": "self",
|
||||||
"icon": null,
|
"icon": null,
|
||||||
"order": 1,
|
"order": 1,
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
"type": 3,
|
"type": 3,
|
||||||
"subtype": 5,
|
"subtype": 5,
|
||||||
"name": "Create",
|
"name": "Create",
|
||||||
"uri": "{/base}/{/lang}/backend/media/create?{?}",
|
"uri": "/{/lang}/backend/media/create?{?}",
|
||||||
"target": "self",
|
"target": "self",
|
||||||
"icon": null,
|
"icon": null,
|
||||||
"order": 5,
|
"order": 5,
|
||||||
|
|
@ -51,7 +51,7 @@
|
||||||
"type": 2,
|
"type": 2,
|
||||||
"subtype": 2,
|
"subtype": 2,
|
||||||
"name": "Media",
|
"name": "Media",
|
||||||
"uri": "{/base}/{/lang}/backend/profile/single/media?{?}",
|
"uri": "/{/lang}/backend/profile/single/media?{?}",
|
||||||
"target": "self",
|
"target": "self",
|
||||||
"icon": null,
|
"icon": null,
|
||||||
"order": 3,
|
"order": 3,
|
||||||
|
|
@ -66,7 +66,7 @@
|
||||||
"type": 3,
|
"type": 3,
|
||||||
"subtype": 1,
|
"subtype": 1,
|
||||||
"name": "Media",
|
"name": "Media",
|
||||||
"uri": "{/base}/{/lang}/backend/admin/account/single/media?{?}",
|
"uri": "/{/lang}/backend/admin/account/single/media?{?}",
|
||||||
"target": "self",
|
"target": "self",
|
||||||
"icon": null,
|
"icon": null,
|
||||||
"order": 3,
|
"order": 3,
|
||||||
|
|
|
||||||
|
|
@ -106,8 +106,8 @@ class Controller extends ModuleAbstract implements WebInterface
|
||||||
{
|
{
|
||||||
/** @var Head $head */
|
/** @var Head $head */
|
||||||
$head = $response->get('Content')->getData('head');
|
$head = $response->get('Content')->getData('head');
|
||||||
$head->addAsset(AssetType::JSLATE, $request->getUri()->getBase() . 'Modules/Media/Models/Upload.js');
|
$head->addAsset(AssetType::JSLATE, '/Modules/Media/Models/Upload.js');
|
||||||
$head->addAsset(AssetType::JSLATE, $request->getUri()->getBase() . 'Modules/Media/Controller.js');
|
$head->addAsset(AssetType::JSLATE, '/Modules/Media/Controller.js');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,6 @@ trait FileUploaderTrait
|
||||||
public function setUpFileUploader(RequestAbstract $request, ResponseAbstract $response, $data = null)
|
public function setUpFileUploader(RequestAbstract $request, ResponseAbstract $response, $data = null)
|
||||||
{
|
{
|
||||||
$head = $response->getHead();
|
$head = $response->getHead();
|
||||||
$head->addAsset(AssetType::JS, $request->getUri()->getBase() . 'Modules/Media/ModuleMedia.js');
|
$head->addAsset(AssetType::JS, '/Modules/Media/ModuleMedia.js');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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('{/base}/{/lang}/backend/media/single?{?}&id=' . $value->getId());
|
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/media/single?{?}&id=' . $value->getId());
|
||||||
|
|
||||||
$icon = '';
|
$icon = '';
|
||||||
$extensionType = \phpOMS\System\File\FileUtils::getExtensionType($value->getExtension());
|
$extensionType = \phpOMS\System\File\FileUtils::getExtensionType($value->getExtension());
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,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('{/base}/{/lang}/api/media'); ?>">
|
<form method="POST" id="media-uploader" action="<?= \phpOMS\Uri\UriFactory::build('/{/lang}/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="">
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ echo $this->getData('nav')->render(); ?>
|
||||||
<td colspan="3"><?= $footerView->render(); ?>
|
<td colspan="3"><?= $footerView->render(); ?>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php $count = 0; foreach ($media as $key => $value) : $count++;
|
<?php $count = 0; foreach ($media as $key => $value) : $count++;
|
||||||
$url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/media/single?{?}&id=' . $value->getId());
|
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/media/single?{?}&id=' . $value->getId());
|
||||||
|
|
||||||
$icon = '';
|
$icon = '';
|
||||||
$extensionType = \phpOMS\System\File\FileUtils::getExtensionType($value->getExtension());
|
$extensionType = \phpOMS\System\File\FileUtils::getExtensionType($value->getExtension());
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ echo $this->getData('nav')->render();
|
||||||
<td><?= $this->getHtml('Created') ?>
|
<td><?= $this->getHtml('Created') ?>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php if (!is_dir($media->getPath())) : foreach ($media as $key => $value) :
|
<?php if (!is_dir($media->getPath())) : foreach ($media as $key => $value) :
|
||||||
$url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/media/single?{?}&id=' . $value->getId());
|
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/media/single?{?}&id=' . $value->getId());
|
||||||
|
|
||||||
$icon = '';
|
$icon = '';
|
||||||
$extensionType = \phpOMS\System\File\FileUtils::getExtensionType($value->getExtension());
|
$extensionType = \phpOMS\System\File\FileUtils::getExtensionType($value->getExtension());
|
||||||
|
|
@ -102,7 +102,7 @@ echo $this->getData('nav')->render();
|
||||||
<?php endforeach; else : $path = is_dir($media->getPath() . $this->request->getData('sub')) && phpOMS\Utils\StringUtils::startsWith(str_replace('\\', '/', realpath($media->getPath() . $this->request->getData('sub'))), $media->getPath()) ? $media->getPath() . $this->request->getData('sub') : $media->getPath(); ?>
|
<?php endforeach; else : $path = is_dir($media->getPath() . $this->request->getData('sub')) && phpOMS\Utils\StringUtils::startsWith(str_replace('\\', '/', realpath($media->getPath() . $this->request->getData('sub'))), $media->getPath()) ? $media->getPath() . $this->request->getData('sub') : $media->getPath(); ?>
|
||||||
<?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 = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/media/single?{?}&id=' . $media->getId() . '&sub=' . substr($value, strlen($media->getPath())));
|
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/media/single?{?}&id=' . $media->getId() . '&sub=' . substr($value, strlen($media->getPath())));
|
||||||
$icon = '';
|
$icon = '';
|
||||||
$extensionType = \phpOMS\System\File\FileUtils::getExtensionType(!is_dir($value) ? \phpOMS\System\File\Local\File::extension($value) : 'collection');
|
$extensionType = \phpOMS\System\File\FileUtils::getExtensionType(!is_dir($value) ? \phpOMS\System\File\Local\File::extension($value) : 'collection');
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user