From 9603017f4983e45a6c8f55e585efbc0fd0ed8d26 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 30 Jul 2019 20:23:16 +0200 Subject: [PATCH] cleanup, media fixes, news fixes --- Admin/Install/Navigation.install.json | 2 +- Controller/ApiController.php | 4 ++-- Theme/Backend/dashboard-news.tpl.php | 2 +- Theme/Backend/news-single.tpl.php | 5 ++++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json index 7f3b0b0..77a3565 100644 --- a/Admin/Install/Navigation.install.json +++ b/Admin/Install/Navigation.install.json @@ -69,7 +69,7 @@ "icon": null, "order": 15, "from": "News", - "permission": { "permission": 2, "type": null, "element": null }, + "permission": { "permission": 4, "type": null, "element": null }, "parent": 1000701001, "children": [] } diff --git a/Controller/ApiController.php b/Controller/ApiController.php index bcb3856..eae5cfe 100644 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -159,8 +159,8 @@ final class ApiController extends Controller $newsArticle->setPlain($request->getData('plain') ?? ''); $newsArticle->setContent(Markdown::parse((string) ($request->getData('plain') ?? ''))); $newsArticle->setLanguage(\strtolower((string) ($request->getData('lang') ?? $request->getHeader()->getL11n()->getLanguage()))); - $newsArticle->setType((int) ($request->getData('type') ?? 1)); - $newsArticle->setStatus((int) ($request->getData('status') ?? 1)); + $newsArticle->setType((int) ($request->getData('type') ?? NewsType::ARTICLE)); + $newsArticle->setStatus((int) ($request->getData('status') ?? NewsStatus::VISIBLE)); $newsArticle->setFeatured((bool) ($request->getData('featured') ?? true)); return $newsArticle; diff --git a/Theme/Backend/dashboard-news.tpl.php b/Theme/Backend/dashboard-news.tpl.php index 0b3acdd..b1361f3 100644 --- a/Theme/Backend/dashboard-news.tpl.php +++ b/Theme/Backend/dashboard-news.tpl.php @@ -18,7 +18,7 @@ $newsList = $this->getData('news'); ?>
- +
diff --git a/Theme/Backend/news-single.tpl.php b/Theme/Backend/news-single.tpl.php index a69e92c..4fa4386 100644 --- a/Theme/Backend/news-single.tpl.php +++ b/Theme/Backend/news-single.tpl.php @@ -20,7 +20,10 @@ echo $this->getData('nav')->render(); ?>
-
getContent(); ?>
+
+

printHtml($news->getTitle()); ?>

+ getContent(); ?> +
\ No newline at end of file
getHtml('News', 'News'); ?>