From 3884f7e2d5f05a0a153da644dd3aec6ab29e1641 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 17 Apr 2024 17:45:07 +0000 Subject: [PATCH] fix templates --- Controller/BackendController.php | 6 ++ .../Components/Compound/compound.tpl.php | 4 +- Theme/Backend/Components/Note/base.tpl.php | 4 +- Theme/Backend/editor-create.tpl.php | 16 ++-- Theme/Backend/editor-list.tpl.php | 95 ++++++++++--------- 5 files changed, 66 insertions(+), 59 deletions(-) diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 11fd4e0..9764b7b 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -132,6 +132,12 @@ final class BackendController extends Controller public function viewEditorView(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface { $view = new View($this->app->l11nManager, $request, $response); + if (!$request->hasData('id')) { + $response->header->status = RequestStatusCode::R_404; + $view->setTemplate('/Web/Backend/Error/404'); + + return $view; + } /** @var \Modules\Editor\Models\EditorDoc $doc */ $doc = EditorDocMapper::get() diff --git a/Theme/Backend/Components/Compound/compound.tpl.php b/Theme/Backend/Components/Compound/compound.tpl.php index d8ed6aa..ecd1a64 100644 --- a/Theme/Backend/Components/Compound/compound.tpl.php +++ b/Theme/Backend/Components/Compound/compound.tpl.php @@ -1,6 +1,6 @@
-
+
getHtml('Editor', 'Editor', 'Backend'); ?>
@@ -17,7 +17,7 @@
-
+
diff --git a/Theme/Backend/Components/Note/base.tpl.php b/Theme/Backend/Components/Note/base.tpl.php index 3e5a071..2c4c592 100644 --- a/Theme/Backend/Components/Note/base.tpl.php +++ b/Theme/Backend/Components/Note/base.tpl.php @@ -17,7 +17,7 @@ use phpOMS\Uri\UriFactory; ?>
-
+
getHtml('Note', 'Editor', 'Backend'); ?>
@@ -32,7 +32,7 @@ use phpOMS\Uri\UriFactory;
-
+
getHtml('Notes', 'Editor', 'Backend'); ?>download
diff --git a/Theme/Backend/editor-create.tpl.php b/Theme/Backend/editor-create.tpl.php index 283371c..37ec5fd 100755 --- a/Theme/Backend/editor-create.tpl.php +++ b/Theme/Backend/editor-create.tpl.php @@ -24,7 +24,7 @@ echo $this->data['nav']->render(); ?>
-
+
@@ -33,13 +33,13 @@ echo $this->data['nav']->render(); ?>
-
+
-
+
getData('editor')->render('editor'); ?>
-
+
@@ -55,14 +55,14 @@ echo $this->data['nav']->render(); ?>
-
+
getHtml('Tags', 'Tag'); ?>
getData('tagSelector')->render('iTag', 'tag', 'fEditor', false); ?>
-
+
-
+
@@ -75,6 +75,6 @@ echo $this->data['nav']->render(); ?>
-
+
diff --git a/Theme/Backend/editor-list.tpl.php b/Theme/Backend/editor-list.tpl.php index bcf4070..cc61f33 100755 --- a/Theme/Backend/editor-list.tpl.php +++ b/Theme/Backend/editor-list.tpl.php @@ -67,7 +67,7 @@ echo $this->data['nav']->render(); ?>
-
+
getHtml('Documents'); ?>download
@@ -114,51 +114,52 @@ echo $this->data['nav']->render(); ?> - - - - - -
- folder_open - .. - - - - - $value) : ++$count; - $url = UriFactory::build('{/base}/editor/list?path=' . \rtrim($value->getVirtualPath(), '/') . '/' . $value->name); - ?> -
- folder_open - printHtml($value->name); ?> - printHtml($value->createdBy->name1); ?> - printHtml($value->createdAt->format('Y-m-d')); ?> - - $value) : ++$count; - $url = UriFactory::build('{/base}/editor/view?{?}&id=' . $value->id); ?> -
- article - printHtml($value->title); ?> - printHtml($this->renderUserName('%3$s %2$s %1$s', [$value->createdBy->name1, $value->createdBy->name2, $value->createdBy->name3, $value->createdBy->login ?? ''])); ?> - printHtml($value->createdAt->format('Y-m-d')); ?> - - -
getHtml('Empty', '0', '0'); ?> - -
-
- + + + + + folder_open + .. + + + + + $value) : ++$count; + $url = UriFactory::build('{/base}/editor/list?path=' . \rtrim($value->getVirtualPath(), '/') . '/' . $value->name); + ?> + + + folder_open + printHtml($value->name); ?> + printHtml($value->createdBy->name1); ?> + printHtml($value->createdAt->format('Y-m-d')); ?> + + $value) : ++$count; + $url = UriFactory::build('{/base}/editor/view?{?}&id=' . $value->id); ?> + + + article + printHtml($value->title); ?> + printHtml($this->renderUserName('%3$s %2$s %1$s', [$value->createdBy->name1, $value->createdBy->name2, $value->createdBy->name3, $value->createdBy->login ?? ''])); ?> + printHtml($value->createdAt->format('Y-m-d')); ?> + + + getHtml('Empty', '0', '0'); ?> + + +
+ +