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. --- core/helpers/block_manager.php | 67 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 core/helpers/block_manager.php (limited to 'core/helpers/block_manager.php') diff --git a/core/helpers/block_manager.php b/core/helpers/block_manager.php new file mode 100644 index 00000000..d7a2aca9 --- /dev/null +++ b/core/helpers/block_manager.php @@ -0,0 +1,67 @@ +name}_block"; + if (method_exists($class_name, "get_list")) { + foreach (call_user_func(array($class_name, "get_list")) as $id => $title) { + $blocks["{$module->name}:$id"] = $title; + } + } + } + return $blocks; + } + + static function get_html($location) { + $active = self::get_active(); + if (empty($active[$location])) { + return; + } + + foreach ($active[$location] as $id => $desc) { + if (method_exists("$desc[0]_block", "get")) { + $block = call_user_func(array("$desc[0]_block", "get"), $desc[1]); + $block->id = $id; + $result .= $block; + } + } + return $result; + } +} + -- cgit v1.2.3