From d62acf041f9a880f1762c5a29e8b11133b651ff5 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 25 Dec 2008 00:53:45 +0000 Subject: Be consistent: resource is a url, data is the actual JSON encoded result. --- modules/comment/controllers/comments.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'modules/comment/controllers/comments.php') diff --git a/modules/comment/controllers/comments.php b/modules/comment/controllers/comments.php index 8c3f8428..2f5c902f 100644 --- a/modules/comment/controllers/comments.php +++ b/modules/comment/controllers/comments.php @@ -86,7 +86,7 @@ class Comments_Controller extends REST_Controller { */ public function _show($comment) { if (rest::output_format() == "json") { - print json_encode(array("result" => "success", "resource" => $comment)); + print json_encode(array("result" => "success", "data" => $comment)); } else { $view = new View("comment.html"); $view->comment = $comment; @@ -116,7 +116,7 @@ class Comments_Controller extends REST_Controller { } else { print json_encode( array("result" => "error", - "html" => $form)); + "html" => $form->__toString())); } } @@ -128,8 +128,7 @@ class Comments_Controller extends REST_Controller { rest::http_content_type(rest::JSON); $comment->delete(); - print json_encode( - array("result" => "success")); + print json_encode(array("result" => "success")); } /** -- cgit v1.2.3