mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-07-29 19:20:52 -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
@@ -34,10 +34,10 @@ class Admin_Manage_Comments_Controller extends Admin_Controller {
|
||||
|
||||
public function menu_labels() {
|
||||
$menu = $this->_menu($this->_counts());
|
||||
print json_encode(array((string) $menu->get("unpublished")->label,
|
||||
(string) $menu->get("published")->label,
|
||||
(string) $menu->get("spam")->label,
|
||||
(string) $menu->get("deleted")->label));
|
||||
json::reply(array((string) $menu->get("unpublished")->label,
|
||||
(string) $menu->get("published")->label,
|
||||
(string) $menu->get("spam")->label,
|
||||
(string) $menu->get("deleted")->label));
|
||||
}
|
||||
|
||||
public function queue($state) {
|
||||
|
||||
@@ -56,13 +56,12 @@ class Comments_Controller extends Controller {
|
||||
$view = new Theme_View("comment.html", "other", "comment-fragment");
|
||||
$view->comment = $comment;
|
||||
|
||||
print json_encode(
|
||||
array("result" => "success",
|
||||
"view" => (string) $view,
|
||||
"form" => (string) comment::get_add_form($item)));
|
||||
json::reply(array("result" => "success",
|
||||
"view" => (string) $view,
|
||||
"form" => (string) comment::get_add_form($item)));
|
||||
} else {
|
||||
$form = comment::prefill_add_form($form);
|
||||
print json_encode(array("result" => "error", "form" => (string) $form));
|
||||
json::reply(array("result" => "error", "form" => (string) $form));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user