summaryrefslogtreecommitdiff
path: root/core/controllers/quick.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-04-06 08:10:42 +0000
committerBharat Mediratta <bharat@menalto.com>2009-04-06 08:10:42 +0000
commit63edb37076b9c1248041368f0aa16013cb7edb15 (patch)
tree67424d0ebf7997484018afa63043deac41cb579f /core/controllers/quick.php
parent7e23ec89d93cd7874145c7132236a057c6513ca6 (diff)
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.
Diffstat (limited to 'core/controllers/quick.php')
-rw-r--r--core/controllers/quick.php23
1 files changed, 18 insertions, 5 deletions
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) {