diff options
| author | Tim Almdal <tnalmdal@shaw.ca> | 2009-09-29 12:04:47 -0700 |
|---|---|---|
| committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-09-29 12:04:47 -0700 |
| commit | d77045f60de98eaa6400deddd11690a1401044ea (patch) | |
| tree | c1e2a106c321bf9431e1f65768e583410c6d1cbb /modules/gallery/helpers/block_manager.php | |
| parent | 39cd84d86c69090ccf861b9bd2b4758350a47de2 (diff) | |
Extend block_manager to handle sidebar blocks. get_available has become get_available_admin_blocks, get_list becomes get_admin_list. Create new functions get_available_site_blocks which will look for gallery_block get_available_site_blocks
Diffstat (limited to 'modules/gallery/helpers/block_manager.php')
| -rw-r--r-- | modules/gallery/helpers/block_manager.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/modules/gallery/helpers/block_manager.php b/modules/gallery/helpers/block_manager.php index 20b641d4..c5320922 100644 --- a/modules/gallery/helpers/block_manager.php +++ b/modules/gallery/helpers/block_manager.php @@ -38,13 +38,21 @@ class block_manager_Core { self::set_active($location, $blocks); } - static function get_available() { + static function get_available_admin_blocks() { + return self::_get_blocks("get_admin_list"); + } + + static function get_available_site_blocks() { + return self::_get_blocks("get_site_list"); + } + + private static function _get_blocks($function) { $blocks = array(); foreach (module::active() as $module) { $class_name = "{$module->name}_block"; - if (method_exists($class_name, "get_list")) { - foreach (call_user_func(array($class_name, "get_list")) as $id => $title) { + if (method_exists($class_name, $function)) { + foreach (call_user_func(array($class_name, $function)) as $id => $title) { $blocks["{$module->name}:$id"] = $title; } } |
