From c91e90406bbc81f8311a1d2707dd141d150f99a4 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 17 Nov 2008 00:30:18 +0000 Subject: Add output formats to our REST controllers. Add support for JSON and XML to the comment controllers as a proof of concept. It's not fully baked; we should examine ways to create helpers to make this process easier. --- modules/comment/helpers/comment.php | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) (limited to 'modules/comment/helpers/comment.php') diff --git a/modules/comment/helpers/comment.php b/modules/comment/helpers/comment.php index b5d57829..0bfd08d0 100644 --- a/modules/comment/helpers/comment.php +++ b/modules/comment/helpers/comment.php @@ -96,7 +96,7 @@ class Comment_Core { $block = new Block; $block->id = "gComment"; $block->title = _("Comments"); - $block->content = comment::get_comments($theme->item()); + $block->content = comment::get_comments($theme->item(), "html"); if ($show_add_form) { $block->content .= comment::get_add_form($theme->item())->render("form.html"); @@ -104,17 +104,31 @@ class Comment_Core { return $block; } - static function get_comments($item) { - $comments = array("