summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/quick.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2010-07-06 14:12:00 -0700
committerTim Almdal <tnalmdal@shaw.ca>2010-07-06 14:12:01 -0700
commitdbf3199e46d8a9c0ae37108f6afda35232ef4cdd (patch)
tree0dfda5cf87fdcd5ded534c9eb6f21bb44e4906f9 /modules/gallery/controllers/quick.php
parent9d66783f47636153bf3661d1d89e694dd5188c36 (diff)
Fix for ticket #1181. Use $.getJSON to retrieve the json contents of the dialog. Convert all the controllers
that create the data to go into a dialog to return the html as part of a json object.
Diffstat (limited to 'modules/gallery/controllers/quick.php')
-rw-r--r--modules/gallery/controllers/quick.php17
1 files changed, 5 insertions, 12 deletions
diff --git a/modules/gallery/controllers/quick.php b/modules/gallery/controllers/quick.php
index 6cfbbc62..7df5bf18 100644
--- a/modules/gallery/controllers/quick.php
+++ b/modules/gallery/controllers/quick.php
@@ -90,17 +90,10 @@ class Quick_Controller extends Controller {
access::required("view", $item);
access::required("edit", $item);
- if ($item->is_album()) {
- print t(
- "Delete the album <b>%title</b>? All photos and movies in the album will also be deleted.",
- array("title" => html::purify($item->title)));
- } else {
- print t("Are you sure you want to delete <b>%title</b>?",
- array("title" => html::purify($item->title)));
- }
-
- $form = item::get_delete_form($item);
- print $form;
+ $v = new View("quick_delete_confirm.html");
+ $v->item = $item;
+ $v->form = item::get_delete_form($item);
+ print json_encode(array("form" => (string) $v));
}
public function delete($id) {
@@ -149,6 +142,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 $form;
+ print json_encode(array("form" => (string) $form));
}
}