diff --git a/Controller/BackendController.php b/Controller/BackendController.php index aee7521..04d77bc 100644 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -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(); diff --git a/Theme/Backend/media-list.tpl.php b/Theme/Backend/media-list.tpl.php index 576a920..a3b6994 100644 --- a/Theme/Backend/media-list.tpl.php +++ b/Theme/Backend/media-list.tpl.php @@ -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); ?>
  • printHtml($paths[$i]); ?>
  • @@ -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())); ?>