mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-07-11 09:43:51 -04:00
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
This commit is contained in:
committed by
Bharat Mediratta
parent
89d18c0714
commit
91a2c04a24
@@ -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()));
|
||||
json::reply(array("form" => (string) 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", "form" => (string) $form));
|
||||
}
|
||||
}
|
||||
|
||||
public function form_delete() {
|
||||
print json_encode(array("form" => (string) watermark::get_delete_form()));
|
||||
json::reply(array("form" => (string) 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", "form" => (string) $form));
|
||||
}
|
||||
}
|
||||
|
||||
public function form_add() {
|
||||
print json_encode(array("form" => (string) watermark::get_add_form()));
|
||||
json::reply(array("form" => (string) watermark::get_add_form()));
|
||||
}
|
||||
|
||||
public function add() {
|
||||
@@ -120,11 +118,9 @@ 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)));
|
||||
json::reply(array("result" => "error", "form" => rawurlencode((string) $form)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user