Adds a Delete button to the ViewPhotoPage.
The Delete button is non functional yet and is only available for admins and the photo owner.
This commit is contained in:
@@ -12,6 +12,7 @@ class PhotoPage extends SubTemplate
|
||||
private $exif;
|
||||
private $previous_photo_url = '';
|
||||
private $next_photo_url = '';
|
||||
private $is_asset_owner = false;
|
||||
|
||||
public function __construct(Image $photo)
|
||||
{
|
||||
@@ -28,6 +29,10 @@ class PhotoPage extends SubTemplate
|
||||
$this->next_photo_url = $url;
|
||||
}
|
||||
|
||||
public function setIsAssetOwner($flag) {
|
||||
$this->is_asset_owner = $flag;
|
||||
}
|
||||
|
||||
protected function html_content()
|
||||
{
|
||||
$this->photoNav();
|
||||
@@ -45,6 +50,10 @@ class PhotoPage extends SubTemplate
|
||||
|
||||
$this->photoMeta();
|
||||
|
||||
if($this->is_asset_owner) {
|
||||
$this->addUserActions();
|
||||
}
|
||||
|
||||
echo '
|
||||
<script type="text/javascript" src="', BASEURL, '/js/photonav.js"></script>';
|
||||
}
|
||||
@@ -183,4 +192,13 @@ class PhotoPage extends SubTemplate
|
||||
{
|
||||
$this->exif = $exif;
|
||||
}
|
||||
|
||||
public function addUserActions()
|
||||
{
|
||||
echo '
|
||||
<div id=user_actions_box>
|
||||
<h3>Actions</h3>
|
||||
<a class="btn btn-red" href="', BASEURL, '/editasset/?id=', $this->photo->getId(), '&delete">Delete asset</a>
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user