diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2010-07-21 21:30:13 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-07-31 15:44:55 -0700 |
commit | 91a2c04a24c320df37ea980f11245eb4e086879e (patch) | |
tree | 2eea3bb8c750307b346d8112cdbfb0f44da6887d /modules/gallery/controllers/quick.php | |
parent | 89d18c0714f5c982ef9e8711a04490bdac8cae2d (diff) |
More patches as part of #1225. Change the 'core' modules to use the json::reply
method to set the content type header and encode the response as a json object
Diffstat (limited to 'modules/gallery/controllers/quick.php')
-rw-r--r-- | modules/gallery/controllers/quick.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/gallery/controllers/quick.php b/modules/gallery/controllers/quick.php index 253a279b..1d9194c7 100644 --- a/modules/gallery/controllers/quick.php +++ b/modules/gallery/controllers/quick.php @@ -58,12 +58,12 @@ class Quick_Controller extends Controller { } if (Input::instance()->get("page_type") == "collection") { - print json_encode( + json::reply( array("src" => $item->thumb_url(), "width" => $item->thumb_width, "height" => $item->thumb_height)); } else { - print json_encode( + json::reply( array("src" => $item->resize_url(), "width" => $item->resize_width, "height" => $item->resize_height)); @@ -83,7 +83,7 @@ class Quick_Controller extends Controller { item::make_album_cover($item); message::success($msg); - print json_encode(array("result" => "success", "reload" => 1)); + json::reply(array("result" => "success", "reload" => 1)); } public function form_delete($id) { @@ -94,7 +94,7 @@ class Quick_Controller extends Controller { $v = new View("quick_delete_confirm.html"); $v->item = $item; $v->form = item::get_delete_form($item); - print json_encode(array("form" => (string) $v)); + json::reply(array("form" => (string) $v)); } public function delete($id) { @@ -125,9 +125,9 @@ class Quick_Controller extends Controller { $from_id = Input::instance()->get("from_id"); if (Input::instance()->get("page_type") == "collection" && $from_id != $id /* deleted the item we were viewing */) { - print json_encode(array("result" => "success", "reload" => 1)); + json::reply(array("result" => "success", "reload" => 1)); } else { - print json_encode(array("result" => "success", + json::reply(array("result" => "success", "location" => $parent->url())); } } @@ -154,6 +154,6 @@ class Quick_Controller extends Controller { // Pass on the source item where this form was generated, so we have an idea where to return to. $form->hidden("from_id")->value((int)Input::instance()->get("from_id", 0)); - print json_encode(array("form" => (string) $form)); + json::reply(array("form" => (string) $form)); } } |