PhotosIndex: allow setting image as the album cover as well

This commit is contained in:
2024-01-17 18:28:24 +01:00
parent 81acd5c3e8
commit 7370737e7f
2 changed files with 26 additions and 6 deletions

View File

@@ -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 = [];