From 01822cdccffc71465e9bcf3fa751c38fd3bd66e5 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Sun, 12 Mar 2023 01:00:50 +0100 Subject: [PATCH] Fix Button, ConfirmDeletePage, WarningDialog templates --- controllers/ViewPhoto.php | 2 +- templates/Button.php | 4 ++-- templates/ConfirmDeletePage.php | 6 +++--- templates/PhotoPage.php | 2 +- templates/WarningDialog.php | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/controllers/ViewPhoto.php b/controllers/ViewPhoto.php index e46929d..5e29ea8 100644 --- a/controllers/ViewPhoto.php +++ b/controllers/ViewPhoto.php @@ -39,7 +39,7 @@ class ViewPhoto extends HTMLController $page = new ConfirmDeletePage($photo->getImage()); $this->page->adopt($page); } - else if (isset($_REQUEST['delete_confirmed'])) + elseif (isset($_REQUEST['delete_confirmed'])) { $album_url = $photo->getSubdir(); $photo->delete(); diff --git a/templates/Button.php b/templates/Button.php index 29024e1..c978c42 100644 --- a/templates/Button.php +++ b/templates/Button.php @@ -6,7 +6,7 @@ * Kabuki CMS (C) 2013-2015, Aaron van Geffen *****************************************************************************/ -class Button extends SubTemplate +class Button extends Template { private $content = ''; private $href = ''; @@ -19,7 +19,7 @@ class Button extends SubTemplate $this->class = $class; } - protected function html_content() + public function html_main() { echo ' ', $this->content, ''; diff --git a/templates/ConfirmDeletePage.php b/templates/ConfirmDeletePage.php index bdba97c..80075c5 100644 --- a/templates/ConfirmDeletePage.php +++ b/templates/ConfirmDeletePage.php @@ -13,7 +13,7 @@ class ConfirmDeletePage extends PhotoPage parent::__construct($photo); } - protected function html_content() + public function html_main() { $this->confirm(); $this->photo(); @@ -22,7 +22,7 @@ class ConfirmDeletePage extends PhotoPage private function confirm() { $buttons = []; - $buttons[] = new Button("Delete", BASEURL . '/' . $this->photo->getSlug() . '?delete_confirmed', "btn btn-red"); + $buttons[] = new Button("Delete", BASEURL . '/' . $this->photo->getSlug() . '/?delete_confirmed', "btn btn-danger"); $buttons[] = new Button("Cancel", $this->photo->getPageUrl(), "btn"); $alert = new WarningDialog( @@ -30,6 +30,6 @@ class ConfirmDeletePage extends PhotoPage "You are about to permanently delete the following photo.", $buttons ); - $alert->html_content(); + $alert->html_main(); } } diff --git a/templates/PhotoPage.php b/templates/PhotoPage.php index b2d663f..49ac58b 100644 --- a/templates/PhotoPage.php +++ b/templates/PhotoPage.php @@ -251,7 +251,7 @@ class PhotoPage extends Template

Actions

Edit photo - Delete photo + Delete photo
'; } } diff --git a/templates/WarningDialog.php b/templates/WarningDialog.php index 198b7e0..6a9c93e 100644 --- a/templates/WarningDialog.php +++ b/templates/WarningDialog.php @@ -24,6 +24,6 @@ class WarningDialog extends Alert private function addButtons() { foreach ($this->buttons as $button) - $button->html_content(); + $button->html_main(); } }