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:
Roflin committed 2018-07-07 12:19:31 +00:00
1 parent fcbbc7106d
commit 344db6e4c5
3 files changed
+33

No files matched your search

+5
View File
@@ -43,6 +43,11 @@ class ViewPhoto extends HTMLController
if ($next_url)
$page->setNextPhotoUrl($next_url);
$user = Registry::get('user');
$author = $photo->getAuthor();
if ($user->isAdmin() || $user->getUserId() === $author->getUserId())
$page->setIsAssetOwner(true);
$this->page->adopt($page);
$this->page->setCanonicalUrl($photo->getPageUrl());