From 01dcbbcda5a4630cec6a1bbee052ef108e291a5d Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 7 Jan 2009 09:08:53 +0000 Subject: Add very basic comment listing which shows the different queues (approved, unapproved, spam). --- modules/comment/controllers/admin_comments.php | 62 ++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 modules/comment/controllers/admin_comments.php (limited to 'modules/comment/controllers') diff --git a/modules/comment/controllers/admin_comments.php b/modules/comment/controllers/admin_comments.php new file mode 100644 index 00000000..f518238f --- /dev/null +++ b/modules/comment/controllers/admin_comments.php @@ -0,0 +1,62 @@ +content = new View("admin_comments.html"); + $view->content->menu = Menu::factory("root") + ->append(Menu::factory("link") + ->id("published") + ->label(_("Published")) + ->url(url::site("admin/comments/published"))) + ->append(Menu::factory("link") + ->id("unpublished") + ->label(_("Unpublished")) + ->url(url::site("admin/comments/unpublished"))) + ->append(Menu::factory("link") + ->id("spam") + ->label(_("Spam")) + ->url(url::site("admin/comments/spam"))); + $view->content->comments = ORM::factory("comment") + ->where("state", $state) + ->orderby("created", "DESC") + ->find_all(); + + return $view; + } + + public function index() { + return $this->published(); + } + + public function published() { + print $this->_get_base_view("published"); + } + + public function unpublished() { + print $this->_get_base_view("unpublished"); + } + + public function spam() { + print $this->_get_base_view("spam"); + } +} + -- cgit v1.2.3