From 122ffcd7b95e3f4c0a08044d329388100a47e1c3 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 19 Sep 2020 21:25:04 +0200 Subject: [PATCH] draft directory usage based on media collections --- Controller/BackendController.php | 8 ++++++ Theme/Backend/editor-list.tpl.php | 44 ++++++++++++++++++++++++++++++- 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/Controller/BackendController.php b/Controller/BackendController.php index cf1fbbf..722ac46 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -23,6 +23,7 @@ use phpOMS\Message\Http\RequestStatusCode; use phpOMS\Message\RequestAbstract; use phpOMS\Message\ResponseAbstract; use phpOMS\Views\View; +use Modules\Media\Models\CollectionMapper; /** * Calendar controller class. @@ -99,6 +100,13 @@ final class BackendController extends Controller $view->setTemplate('/Modules/Editor/Theme/Backend/editor-list'); $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1005301001, $request, $response)); + $path = (string) ($request->getData('path') ?? '/'); + $collection = CollectionMapper::getByVirtualPath(\str_replace('+', ' ', $path)); + $parent = CollectionMapper::getParentCollection(\str_replace('+', ' ', $path)); + + $view->addData('collections', $collection); + $view->addData('path', $path); + if ($request->getData('ptype') === 'p') { $view->setData('docs', EditorDocMapper::withConditional('language', $response->getHeader()->getL11n()->getLanguage()) diff --git a/Theme/Backend/editor-list.tpl.php b/Theme/Backend/editor-list.tpl.php index 100f67f..b0c71c0 100755 --- a/Theme/Backend/editor-list.tpl.php +++ b/Theme/Backend/editor-list.tpl.php @@ -20,12 +20,43 @@ use phpOMS\Uri\UriFactory; */ $docs = $this->getData('docs'); +/** @var \Modules\Media\Models\Collection[] */ +$collections = $this->getData('collections'); + +$mediaPath = \urldecode($this->getData('path') ?? '/'); + $previous = empty($docs) ? '{/prefix}editor/list' : '{/prefix}editor/list?{?}&id=' . \reset($docs)->getId() . '&ptype=p'; $next = empty($docs) ? '{/prefix}editor/list' : '{/prefix}editor/list?{?}&id=' . \end($docs)->getId() . '&ptype=n'; $docs = $this->getData('docs'); echo $this->getData('nav')->render(); ?> +
+
+
+ +
+
+
+
@@ -33,13 +64,24 @@ echo $this->getData('nav')->render(); ?> + - $value) : ++$count; + $value) : ++$count; + $url = UriFactory::build('{/prefix}editor/list?path=' . \rtrim($value->getVirtualPath(), '/') . '/' . $value->getName()); + ?> + + +
getHtml('Title'); ?> getHtml('Creator'); ?> getHtml('Created'); ?>
+ printHtml($value->getName()); ?> + printHtml($value->getCreatedBy()->getName1()); ?> + printHtml($value->getCreatedAt()->format('Y-m-d')); ?> + + $value) : ++$count; $url = UriFactory::build('{/prefix}editor/single?{?}&id=' . $value->getId()); ?>
printHtml($value->getTitle()); ?> printHtml($value->getCreatedBy()->getName1()); ?> printHtml($value->getCreatedAt()->format('Y-m-d H:i:s')); ?>