diff options
Diffstat (limited to 'app/class')
-rw-r--r-- | app/class/Controllerhome.php | 28 | ||||
-rw-r--r-- | app/class/Routes.php | 2 |
2 files changed, 28 insertions, 2 deletions
diff --git a/app/class/Controllerhome.php b/app/class/Controllerhome.php index d8c126d..80644d1 100644 --- a/app/class/Controllerhome.php +++ b/app/class/Controllerhome.php @@ -127,6 +127,22 @@ class Controllerhome extends Controllerpage $this->routedirect('home'); } + public function multi() + { + if(isset($_POST['action'])) { + switch ($_POST['action']) { + case 'edit': + $this->multiedit(); + break; + + case 'render': + $this->multirender(); + break; + } + } + $this->routedirect('home'); + } + public function multiedit() { if ($this->user->issupereditor() && isset($_POST['pagesid'])) { @@ -141,7 +157,17 @@ class Controllerhome extends Controllerpage $this->pagemanager->pageedit($id, $datas, $reset, $addtag, $addauthor); } } - $this->routedirect('home'); + } + + public function multirender() + { + $pagelist = $_POST['pagesid'] ?? []; + $pagelist = $this->pagemanager->getlisterid($pagelist); + foreach ($pagelist as $page) { + $page = $this->renderpage($page); + $this->pagemanager->update($page); + } + } } diff --git a/app/class/Routes.php b/app/class/Routes.php index 7bd373a..4a87fc8 100644 --- a/app/class/Routes.php +++ b/app/class/Routes.php @@ -22,7 +22,7 @@ class Routes ['POST', '/columns', 'Controllerhome#columns', 'homecolumns'], ['GET', '//renderall', 'Controllerhome#renderall', 'homerenderall'], ['POST', '/bookmark', 'Controllerhome#bookmark', 'homebookmark'], - ['POST', '/multiedit', 'Controllerhome#multiedit', 'multiedit'], + ['POST', '/multi', 'Controllerhome#multi', 'multi'], ['POST', '/upload', 'Controllerpage#upload', 'pageupload'], ['POST', '/!co', 'Controllerconnect#log', 'log'], ['GET', '/!co', 'Controllerconnect#connect', 'connect'], |