summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-01-29 03:14:43 +0000
committerBharat Mediratta <bharat@menalto.com>2009-01-29 03:14:43 +0000
commit8d4b0afa4f42f6c00482bf72a2ce4c8b3a40028b (patch)
tree7347f20e2ebb4bfa2aa56e8c96db2ed15a8b4b2d /core
parent01d81ec6b42d30db83a1a12bbd2e5bc08944b0e2 (diff)
Support making an album the album cover for its parent
Diffstat (limited to 'core')
-rw-r--r--core/controllers/quick.php7
-rw-r--r--core/views/quick_pane.html.php2
2 files changed, 7 insertions, 2 deletions
diff --git a/core/controllers/quick.php b/core/controllers/quick.php
index 44ca32b4..b9a8fb82 100644
--- a/core/controllers/quick.php
+++ b/core/controllers/quick.php
@@ -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);
diff --git a/core/views/quick_pane.html.php b/core/views/quick_pane.html.php
index 8d39d214..35c9dcf1 100644
--- a/core/views/quick_pane.html.php
+++ b/core/views/quick_pane.html.php
@@ -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>