summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-04-29 15:57:29 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-04-29 15:57:29 +0000
commit820cbdf1c3a4810a1f00c16beee729e28a0d3056 (patch)
treee06191232a3b42fcf83abe089cf15905ee5109d7 /modules
parent33122e8968e2d7890f7fabe45ce168aa0d217bbb (diff)
Refactor the creation and removal of the album covers into
make_album_cover and remove_album_cover methods in Item_Model. Usage: $photo->make_album_cover() $album->remove_album_cover()
Diffstat (limited to 'modules')
-rw-r--r--modules/organize/helpers/organize_task.php12
1 files changed, 1 insertions, 11 deletions
diff --git a/modules/organize/helpers/organize_task.php b/modules/organize/helpers/organize_task.php
index c0315aba..e617a0a1 100644
--- a/modules/organize/helpers/organize_task.php
+++ b/modules/organize/helpers/organize_task.php
@@ -54,17 +54,7 @@ class organize_task_Core {
break;
case "albumCover":
$item = ORM::factory("item", $id);
- $parent = $item->parent();
-
- if ($item->is_photo()) {
- $parent->album_cover_item_id = $item->id;
- } else if ($item->is_album()) {
- $parent->album_cover_item_id = $item->album_cover_item_id;
- }
-
- $parent->thumb_dirty = 1;
- $parent->save();
- graphics::generate($parent);
+ $item->make_album_cover();
break;
case "delete":
$item = ORM::factory("item", $id);