From 0bb82b76216d033742afab91ce9e9a20dd607ad8 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 25 Dec 2008 00:47:40 +0000 Subject: Gut the comment module and simplify it. Stop trying to support Atom and XML for now, we have no driver for those technologies so anything we implement is not going to be sufficiently tested and therefore it'll be broken. Change all comment functions to return JSON and update the JS to deal purely with JSON. This is our new protocol for talking to the browser and it should be flexible and portable. Create comments.html.php. This duplicates comment.html.php, but will be more efficient for rendering comments since we won't be creating a new View for every comment we render. --- modules/comment/helpers/comment_block.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'modules/comment/helpers/comment_block.php') diff --git a/modules/comment/helpers/comment_block.php b/modules/comment/helpers/comment_block.php index 47025a6c..7d132646 100644 --- a/modules/comment/helpers/comment_block.php +++ b/modules/comment/helpers/comment_block.php @@ -25,7 +25,19 @@ class comment_block_Core { } public static function photo_bottom($theme) { - return comment::block($theme, true); + $block = new Block; + $block->id = "gComments"; + $block->title = _("Comments"); + + $view = new View("comments.html"); + $view->comments = ORM::factory("comment") + ->where("item_id", $theme->item()->id) + ->orderby("created", "ASC") + ->find_all(); + + $block->content = $view; + $block->content .= comment::get_add_form($theme->item())->render("form.html"); + return $block; } public static function admin_dashboard_blocks($theme) { -- cgit v1.2.3