From 6a7defcdc922e9977920b3963cfaa2ae1af6f0f9 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Tue, 18 Feb 2020 12:47:19 +0100 Subject: [PATCH] Allow going back to photo directly from Edit Asset screen. --- controllers/EditAsset.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/controllers/EditAsset.php b/controllers/EditAsset.php index bf01e16a..f3ee61b6 100644 --- a/controllers/EditAsset.php +++ b/controllers/EditAsset.php @@ -94,6 +94,10 @@ class EditAsset extends HTMLController $page = new EditAssetForm($asset, $thumbs); parent::__construct('Edit asset \'' . $asset->getTitle() . '\' (' . $asset->getFilename() . ') - ' . SITE_TITLE); $this->page->adopt($page); + + // Add a view button to the admin bar for photos. + if ($asset->isImage()) + $this->admin_bar->appendItem($asset->getImage()->getPageUrl(), 'View this photo'); } private function getThumbs(Asset $asset)