Changes the ConfirmDelete page and updates database code.

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.
This commit is contained in:
2018-07-08 08:19:37 +00:00
parent e40c05c1f8
commit 16ec547064
12 changed files with 197 additions and 113 deletions

View File

@@ -8,7 +8,7 @@
class PhotoPage extends SubTemplate
{
private $photo;
protected $photo;
private $exif;
private $previous_photo_url = '';
private $next_photo_url = '';
@@ -29,7 +29,8 @@ class PhotoPage extends SubTemplate
$this->next_photo_url = $url;
}
public function setIsAssetOwner($flag) {
public function setIsAssetOwner($flag)
{
$this->is_asset_owner = $flag;
}
@@ -50,15 +51,14 @@ class PhotoPage extends SubTemplate
$this->photoMeta();
if($this->is_asset_owner) {
if($this->is_asset_owner)
$this->addUserActions();
}
echo '
<script type="text/javascript" src="', BASEURL, '/js/photonav.js"></script>';
}
private function photo()
protected function photo()
{
echo '
<div id="photo_frame">
@@ -198,7 +198,7 @@ class PhotoPage extends SubTemplate
echo '
<div id=user_actions_box>
<h3>Actions</h3>
<a class="btn btn-red" href="', BASEURL, '/confirmdelete?slug=', $this->photo->getSlug(), '">Delete</a>
<a class="btn btn-red" href="', BASEURL, '/', $this->photo->getSlug(), '?confirm_delete">Delete</a>
</div>';
}
}