Dennis Brentjes
16ec547064
The ConfirmDelete page now uses parts of the photopage. The Confirmation dialog is its own template which is based on Alert. The database now updates the album thumb to the most recent addition to the album, when the album thumb asset is being deleted. When there are no pictures left in the album 0 will be set.
36 lines
892 B
PHP
36 lines
892 B
PHP
<?php
|
|
/*****************************************************************************
|
|
* ConfirmDeletePage.php
|
|
* Contains the confirm delete page template.
|
|
*
|
|
* Kabuki CMS (C) 2013-2016, Aaron van Geffen
|
|
*****************************************************************************/
|
|
|
|
class ConfirmDeletePage extends PhotoPage
|
|
{
|
|
public function __construct(Image $photo)
|
|
{
|
|
parent::__construct($photo);
|
|
}
|
|
|
|
protected function html_content()
|
|
{
|
|
$this->confirm();
|
|
$this->photo();
|
|
}
|
|
|
|
private function confirm()
|
|
{
|
|
$buttons = [];
|
|
$buttons[] = new Button("Delete", BASEURL . '/' . $this->photo->getSlug() . '?delete_confirmed', "btn btn-red");
|
|
$buttons[] = new Button("Cancel", $this->photo->getPageUrl(), "btn");
|
|
|
|
$alert = new WarningDialog(
|
|
"Confirm deletion.",
|
|
"You are about to permanently delete the following photo.",
|
|
$buttons
|
|
);
|
|
$alert->html_content();
|
|
}
|
|
}
|