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 +++++++++++++++++++++++++++ modules/comment/helpers/comment_dashboard.php | 39 --------------------------- modules/comment/helpers/comment_installer.php | 2 +- 3 files changed, 40 insertions(+), 40 deletions(-) create mode 100644 modules/comment/helpers/comment_block.php delete mode 100644 modules/comment/helpers/comment_dashboard.php (limited to 'modules/comment/helpers') 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 diff --git a/modules/comment/helpers/comment_dashboard.php b/modules/comment/helpers/comment_dashboard.php deleted file mode 100644 index 984c4cea..00000000 --- a/modules/comment/helpers/comment_dashboard.php +++ /dev/null @@ -1,39 +0,0 @@ - t("Recent Comments")); - } - - static function get_block($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 diff --git a/modules/comment/helpers/comment_installer.php b/modules/comment/helpers/comment_installer.php index 651065f7..12caa547 100644 --- a/modules/comment/helpers/comment_installer.php +++ b/modules/comment/helpers/comment_installer.php @@ -50,7 +50,7 @@ class comment_installer { ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - dashboard::add_block("main", "comment", "recent_comments"); + block_manager::add("dashboard_center", "comment", "recent_comments"); module::set_var("comment", "spam_caught", 0); module::set_version("comment", 1); } -- cgit v1.2.3