diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 044a6db..94d20a2 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -26,6 +26,7 @@ use phpOMS\Message\RequestAbstract; use phpOMS\Message\ResponseAbstract; use phpOMS\Utils\StringUtils; use phpOMS\Views\View; +use Modules\Media\Models\CollectionMapper; /** * Helper controller class. @@ -56,6 +57,13 @@ final class BackendController extends Controller $view->setTemplate('/Modules/Helper/Theme/Backend/helper-list'); $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002701001, $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('reports', TemplateMapper::withConditional('language', $response->getHeader()->getL11n()->getLanguage()) diff --git a/Theme/Backend/helper-list.tpl.php b/Theme/Backend/helper-list.tpl.php index e4e40b5..f520f01 100755 --- a/Theme/Backend/helper-list.tpl.php +++ b/Theme/Backend/helper-list.tpl.php @@ -20,10 +20,39 @@ use phpOMS\Uri\UriFactory; */ $templates = $this->getData('reports'); +/** @var \Modules\Media\Models\Collection[] */ +$collections = $this->getData('collections'); +$mediaPath = \urldecode($this->getData('path') ?? '/'); + $previous = empty($templates) ? '{/prefix}helper/list' : '{/prefix}helper/list?{?}&id=' . \reset($templates)->getId() . '&ptype=p'; $next = empty($templates) ? '{/prefix}helper/list' : '{/prefix}helper/list?{?}&id=' . \end($templates)->getId() . '&ptype=n'; echo $this->getData('nav')->render(); ?> +
+
+
+ +
+
+
@@ -32,18 +61,26 @@ echo $this->getData('nav')->render(); ?> + - - - + + +
getHtml('Name'); ?> getHtml('Tag'); ?> getHtml('Creator'); ?> getHtml('Updated'); ?>
getHtml('Empty', '0', '0'); ?> - - $template) : + $value) : ++$count; + $url = UriFactory::build('{/prefix}helper/list?path=' . \rtrim($value->getVirtualPath(), '/') . '/' . $value->getName()); + ?> +
+ printHtml($value->getName()); ?> + + printHtml($value->getCreatedBy()->getName1()); ?> + printHtml($value->getCreatedAt()->format('Y-m-d')); ?> + + $template) : ++$count; $url = UriFactory::build('{/prefix}helper/report/view?{?}&id=' . $template->getId()); ?>
printHtml($template->getName()); ?> getTags(); foreach ($tags as $tag) : ?> @@ -52,6 +89,10 @@ echo $this->getData('nav')->render(); ?> printHtml($template->getCreatedBy()->getName1()); ?> printHtml($template->getCreatedAt()->format('Y-m-d')); ?> + +
getHtml('Empty', '0', '0'); ?> +