diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-04-29 15:57:29 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-04-29 15:57:29 +0000 |
commit | 820cbdf1c3a4810a1f00c16beee729e28a0d3056 (patch) | |
tree | e06191232a3b42fcf83abe089cf15905ee5109d7 /core/controllers/quick.php | |
parent | 33122e8968e2d7890f7fabe45ce168aa0d217bbb (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 'core/controllers/quick.php')
-rw-r--r-- | core/controllers/quick.php | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/core/controllers/quick.php b/core/controllers/quick.php index cb43a50f..48245144 100644 --- a/core/controllers/quick.php +++ b/core/controllers/quick.php @@ -83,20 +83,7 @@ class Quick_Controller extends Controller { public function make_album_cover($id) { access::verify_csrf(); $item = ORM::factory("item", $id); - access::required("edit", $item); - - $parent = $item->parent(); - access::required("edit", $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(); print json_encode(array("result" => "success")); } |