Support making an album the album cover for its parent

This commit is contained in:
Bharat Mediratta
2009-01-29 03:14:43 +00:00
parent 01d81ec6b4
commit 8d4b0afa4f
2 changed files with 7 additions and 2 deletions
+6 -1
View File
@@ -80,7 +80,12 @@ class Quick_Controller extends Controller {
$parent = $item->parent();
access::required("edit", $parent);
$parent->album_cover_item_id = $item->id;
if ($item->type == "photo") {
$parent->album_cover_item_id = $item->id;
} else if ($item->type == "album") {
$parent->album_cover_item_id = $item->album_cover_item_id;
}
$parent->thumb_dirty = 1;
$parent->save();
graphics::generate($parent);
+1 -1
View File
@@ -28,7 +28,7 @@
</span>
</a>
<? if ($item->type == "photo" && access::can("edit", $item->parent())): ?>
<? if (access::can("edit", $item->parent())): ?>
<a class="cover" href="<?= url::site("quick/make_album_cover/$item->id?csrf=" . access::csrf_token()) ?>"
title="<?= t("Select as album cover") ?>">
<span>