From 84872a3e10d7e80e45d71db5376a27ba2418220f Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Sat, 2 Nov 2024 12:39:41 +0100 Subject: [PATCH] add a cancel button in pagedelete view close #473 + pagedelete route accept optionnal GET param "route" used for the cancel button + added icons + search for page links is now a button too --- app/class/Controllerpage.php | 2 ++ app/view/templates/delete.php | 17 +++++++++++++++-- app/view/templates/home.php | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/app/class/Controllerpage.php b/app/class/Controllerpage.php index 08935eee..66772c6f 100644 --- a/app/class/Controllerpage.php +++ b/app/class/Controllerpage.php @@ -405,10 +405,12 @@ public function delete(string $page): void $linksto = new Opt(); $linksto->setlinkto($this->page->id()); $pageslinkingto = $this->pagemanager->pagetable($this->pagemanager->pagelist(), $linksto); + $cancelroute = isset($_GET['route']) ? $_GET['route'] : 'pageread'; $this->showtemplate('delete', [ 'page' => $this->page, 'pageexist' => true, 'pageslinkingtocount' => count($pageslinkingto), + 'cancelroute' => $cancelroute, ]); } else { $this->routedirect('pageread', ['page' => $this->page->id()]); diff --git a/app/view/templates/delete.php b/app/view/templates/delete.php index 3faaa830..9d81cd6c 100644 --- a/app/view/templates/delete.php +++ b/app/view/templates/delete.php @@ -14,7 +14,7 @@

Page linking to this one : 0) : ?> - + @@ -22,7 +22,20 @@

- + + + + + Cancel + + + + Cancel + +
diff --git a/app/view/templates/home.php b/app/view/templates/home.php index 97cfb064..0aa22748 100644 --- a/app/view/templates/home.php +++ b/app/view/templates/home.php @@ -290,7 +290,7 @@ class="redirection" candeletepage($item)) : ?> - +