From 7b68ca9946772fdb8fa2db756e934cc7883ea52d Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 18 Jan 2009 06:55:04 +0000 Subject: Refactor dashboard -> block_manager since it'll manage blocks site wide, not just in the dashboard. --- modules/comment/helpers/comment_block.php | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 modules/comment/helpers/comment_block.php (limited to 'modules/comment/helpers/comment_block.php') diff --git a/modules/comment/helpers/comment_block.php b/modules/comment/helpers/comment_block.php new file mode 100644 index 00000000..9a8e83ec --- /dev/null +++ b/modules/comment/helpers/comment_block.php @@ -0,0 +1,39 @@ + t("Recent Comments")); + } + + static function get($block_id) { + $block = new Block(); + switch ($block_id) { + case "recent_comments": + $block->css_id = "gRecentComments"; + $block->title = t("Recent Comments"); + $block->content = new View("admin_block_recent_comments.html"); + $block->content->comments = + ORM::factory("comment")->orderby("created", "DESC")->limit(5)->find_all(); + break; + } + + return $block; + } +} \ No newline at end of file -- cgit v1.2.3