summaryrefslogtreecommitdiff
path: root/modules/comment/helpers/comment_block.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-12-25 00:47:40 +0000
committerBharat Mediratta <bharat@menalto.com>2008-12-25 00:47:40 +0000
commit0bb82b76216d033742afab91ce9e9a20dd607ad8 (patch)
tree7e662d7a71040d5fa770798449bf27fc93d0994c /modules/comment/helpers/comment_block.php
parent7a82beb752d51e2d0a1c16446a5e27738192aaf3 (diff)
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.
Diffstat (limited to 'modules/comment/helpers/comment_block.php')
-rw-r--r--modules/comment/helpers/comment_block.php14
1 files changed, 13 insertions, 1 deletions
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) {