From 63edb37076b9c1248041368f0aa16013cb7edb15 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 6 Apr 2009 08:10:42 +0000 Subject: Fix up the quick-edit code on the photos page. Everything but "move" is implemented. Can't do move easily because it's tricky to handle the post-move redirect. --- core/controllers/quick.php | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'core/controllers/quick.php') diff --git a/core/controllers/quick.php b/core/controllers/quick.php index 1b6e2bf8..d62f3af0 100644 --- a/core/controllers/quick.php +++ b/core/controllers/quick.php @@ -26,6 +26,7 @@ class Quick_Controller extends Controller { $view = new View("quick_pane.html"); $view->item = $item; + $view->page_type = Input::instance()->get("page_type"); print $view; } @@ -66,10 +67,17 @@ class Quick_Controller extends Controller { } } - print json_encode( - array("src" => $item->thumb_url() . "?rnd=" . rand(), - "width" => $item->thumb_width, - "height" => $item->thumb_height)); + if (Input::instance()->get("page_type") == "album") { + print json_encode( + array("src" => $item->thumb_url() . "?rnd=" . rand(), + "width" => $item->thumb_width, + "height" => $item->thumb_height)); + } else { + print json_encode( + array("src" => $item->resize_url() . "?rnd=" . rand(), + "width" => $item->resize_width, + "height" => $item->resize_height)); + } } public function make_album_cover($id) { @@ -116,7 +124,12 @@ class Quick_Controller extends Controller { $item->delete(); message::success($msg); - print json_encode(array("result" => "success", "reload" => 1)); + if (Input::instance()->get("page_type") == "album") { + print json_encode(array("result" => "success", "reload" => 1)); + } else { + print json_encode(array("result" => "success", + "location" => url::site("albums/$parent->id"))); + } } public function form_edit($id) { -- cgit v1.2.3