From 13acdbd444b0ae26e83ab8cf62d60a7f59268545 Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Tue, 4 Dec 2018 13:55:04 +0100 Subject: admin panel --- app/class/controllerart.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'app/class/controllerart.php') diff --git a/app/class/controllerart.php b/app/class/controllerart.php index 67ec280..0dee8e7 100644 --- a/app/class/controllerart.php +++ b/app/class/controllerart.php @@ -90,14 +90,14 @@ class Controllerart extends Controller $artexist = $this->importart(); $canread = $this->user->level() >= $this->art->secure(); $alerts = ['alertnotexist' => 'This page does not exist yet', 'alertprivate' => 'You cannot see this page']; - $page = ['head' => '', 'body' => '']; + $page = ['head' => '', 'body' => '']; if ($artexist) { if ($this->art->daterender() < $this->art->datemodif()) { $page = $this->renderart(); } else { - $page = ['head' => $this->art->renderhead(), 'body' => $this->art->renderbody()]; + $page = ['head' => $this->art->renderhead(), 'body' => $this->art->renderbody()]; } $this->art->addaffcount(); $this->artmanager->update($this->art); @@ -148,6 +148,16 @@ class Controllerart extends Controller $this->setart($id, 'artadd'); if ($this->user->iseditor() && !$this->importart()) { $this->art->reset(); + if (!empty(Config::defaultart())) { + $defaultart = $this->artmanager->get(Config::defaultart()); + if ($defaultart !== false) { + $defaultbody = $defaultart->body(); + } + } + if(empty(Config::defaultart()) || $defaultart === false) { + $defaultbody = Config::defaultbody(); + } + $this->art->setbody($defaultbody); $this->artmanager->add($this->art); $this->routedirect('artedit', ['art' => $this->art->id()]); } else { -- cgit v1.2.3