mirror of
https://github.com/Karaka-Management/oms-Media.git
synced 2026-01-27 00:08:40 +00:00
partially fix url encoding
This commit is contained in:
parent
207f9e9293
commit
8ff4e532d3
|
|
@ -129,7 +129,7 @@ final class BackendController extends Controller
|
|||
/** @var Media[] $media */
|
||||
$media = MediaMapper::getByVirtualPath($path);
|
||||
|
||||
$collection = CollectionMapper::getParentCollection($path);
|
||||
$collection = CollectionMapper::getParentCollection(\str_replace('+', ' ', $path));
|
||||
if ($collection instanceof Collection) {
|
||||
$media += $collection->getSources();
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ include __DIR__ . '/template-functions.php';
|
|||
* @var \phpOMS\Views\View $this
|
||||
* @var string $parent
|
||||
*/
|
||||
$mediaPath = $this->getData('path') ?? '/';
|
||||
$mediaPath = \urldecode($this->getData('path') ?? '/');
|
||||
|
||||
/**
|
||||
* @var \Modules\Media\Models\Media[] $media
|
||||
|
|
@ -55,7 +55,7 @@ $media = $this->getData('media');
|
|||
|
||||
$subPath .= '/' . $paths[$i];
|
||||
|
||||
$url = $i === $length - 1 ? UriFactory::build('{%}') : UriFactory::build('{/prefix}media/list?path=' . $subPath);
|
||||
$url = UriFactory::build('{/prefix}media/list?path=' . $subPath);
|
||||
?>
|
||||
<li data-href="<?= $url; ?>"><a href="<?= $url; ?>"><?= $this->printHtml($paths[$i]); ?></a></li>
|
||||
<?php endfor; ?>
|
||||
|
|
@ -82,11 +82,10 @@ $media = $this->getData('media');
|
|||
foreach ($media as $key => $value) :
|
||||
++$count;
|
||||
|
||||
if ($value->getExtension() === 'collection') {
|
||||
$url = UriFactory::build('{/prefix}media/list?path=' . \rtrim($value->getVirtualPath(), '/') . '/' . $value->getName());
|
||||
} else {
|
||||
$url = UriFactory::build('{/prefix}media/single?id=' . $value->getId());
|
||||
}
|
||||
$url = $value->getExtension() === 'collection'
|
||||
? UriFactory::build('{/prefix}media/list?path=' . \rtrim($value->getVirtualPath(), '/') . '/' . $value->getName())
|
||||
: UriFactory::build('{/prefix}media/single?id=' . $value->getId());
|
||||
|
||||
$icon = $fileIconFunction(\phpOMS\System\File\FileUtils::getExtensionType($value->getExtension()));
|
||||
?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user