summaryrefslogtreecommitdiff
path: root/modules/watermark
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-08-01 10:35:15 -0700
committerBharat Mediratta <bharat@menalto.com>2010-08-01 10:35:15 -0700
commit3b187d7fe9acbe46e38ae824b6374dd3bfd0cfb0 (patch)
tree81af4ec2993f740fb632c9f5ea4572bb2d1efa23 /modules/watermark
parent563afbe6ddf4b4debea87a0cb0b8758c8826f80c (diff)
parentbf7115cf5a732cea2d498971ec94d2ade3b2fcdd (diff)
Merge branch 'dialog'
Diffstat (limited to 'modules/watermark')
-rw-r--r--modules/watermark/controllers/admin_watermarks.php25
1 files changed, 12 insertions, 13 deletions
diff --git a/modules/watermark/controllers/admin_watermarks.php b/modules/watermark/controllers/admin_watermarks.php
index 8b217b4a..0652b13c 100644
--- a/modules/watermark/controllers/admin_watermarks.php
+++ b/modules/watermark/controllers/admin_watermarks.php
@@ -35,7 +35,7 @@ class Admin_Watermarks_Controller extends Admin_Controller {
}
public function form_edit() {
- print json_encode(array("form" => (string) watermark::get_edit_form()));
+ print watermark::get_edit_form();
}
public function edit() {
@@ -49,16 +49,16 @@ class Admin_Watermarks_Controller extends Admin_Controller {
log::success("watermark", t("Watermark changed"));
message::success(t("Watermark changed"));
- print json_encode(
+ json::reply(
array("result" => "success",
"location" => url::site("admin/watermarks")));
} else {
- print json_encode(array("result" => "error", "form" => (string) $form));
+ json::reply(array("result" => "error", "html" => (string)$form));
}
}
public function form_delete() {
- print json_encode(array("form" => (string) watermark::get_delete_form()));
+ print watermark::get_delete_form();
}
public function delete() {
@@ -79,16 +79,14 @@ class Admin_Watermarks_Controller extends Admin_Controller {
log::success("watermark", t("Watermark deleted"));
message::success(t("Watermark deleted"));
}
- print json_encode(
- array("result" => "success",
- "location" => url::site("admin/watermarks")));
+ json::reply(array("result" => "success", "location" => url::site("admin/watermarks")));
} else {
- print json_encode(array("result" => "error", "form" => (string) $form));
+ json::reply(array("result" => "error", "html" => (string)$form));
}
}
public function form_add() {
- print json_encode(array("form" => (string) watermark::get_add_form()));
+ print watermark::get_add_form();
}
public function add() {
@@ -120,11 +118,12 @@ class Admin_Watermarks_Controller extends Admin_Controller {
message::success(t("Watermark saved"));
log::success("watermark", t("Watermark saved"));
- print json_encode(
- array("result" => "success",
- "location" => url::site("admin/watermarks")));
+ json::reply(array("result" => "success", "location" => url::site("admin/watermarks")));
} else {
- print json_encode(array("result" => "error", "form" => rawurlencode((string) $form)));
+ // rawurlencode the results because the JS code that uploads the file buffers it in an
+ // iframe which entitizes the HTML and makes it difficult for the JS to process. If we url
+ // encode it now, it passes through cleanly. See ticket #797.
+ json::reply(array("result" => "error", "html" => rawurlencode((string)$form)));
}
}