diff --git a/controllers/EditAsset.php b/controllers/EditAsset.php index b6b999ac..19cf70b8 100644 --- a/controllers/EditAsset.php +++ b/controllers/EditAsset.php @@ -46,6 +46,18 @@ class EditAsset extends HTMLController header('Location: ' . BASEURL . '/' . $asset->getSubdir()); exit; } + else if (isset($_REQUEST['album_cover'], $_REQUEST['in']) && Session::validateSession('get')) + { + $tag = Tag::fromId($_REQUEST['in']); + $tag->id_asset_thumb = $asset->getId(); + $tag->save(); + + if (isset($_SERVER['HTTP_REFERER'])) + header('Location: ' . $_SERVER['HTTP_REFERER']); + else + header('Location: ' . BASEURL . '/' . $asset->getSubdir()); + exit; + } // Get a list of available photo albums $allAlbums = []; diff --git a/templates/PhotosIndex.php b/templates/PhotosIndex.php index 8a9328be..a104bca2 100644 --- a/templates/PhotosIndex.php +++ b/templates/PhotosIndex.php @@ -13,7 +13,9 @@ class PhotosIndex extends Template protected $show_headers; protected $show_labels; protected $previous_header = ''; - protected $url_suffix; + + protected $edit_url_suffix; + protected $photo_url_suffix; const PANORAMA_WIDTH = 1256; const PANORAMA_HEIGHT = null; @@ -83,20 +85,25 @@ class PhotosIndex extends Template protected function editMenu(Image $image) { + $edit_url = $image->getEditUrl() . $this->edit_url_suffix; + echo '
@@ -115,7 +122,7 @@ class PhotosIndex extends Template $this->editMenu($image); echo ' -