summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/block_manager.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/helpers/block_manager.php')
-rw-r--r--modules/gallery/helpers/block_manager.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/modules/gallery/helpers/block_manager.php b/modules/gallery/helpers/block_manager.php
index 233e4f2e..906a251d 100644
--- a/modules/gallery/helpers/block_manager.php
+++ b/modules/gallery/helpers/block_manager.php
@@ -32,12 +32,35 @@ class block_manager_Core {
self::set_active($location, $blocks);
}
+ static function activate_sidebar_blocks($module_name) {
+ $block_class = "{$module_name}_block";
+ if (method_exists($block_class, "get_site_list")) {
+ $blocks = call_user_func(array($block_class, "get_site_list"));
+ Kohana::log("error", Kohana::debug($blocks));
+ foreach (array_keys($blocks) as $id) {
+ list ($unused, $block_id) = explode(":", $id);
+ self::add("site.sidebar", $module_name, $block_id);
+ }
+ }
+ }
+
static function remove($location, $block_id) {
$blocks = self::get_active($location);
unset($blocks[$block_id]);
self::set_active($location, $blocks);
}
+ static function deactivate_sidebar_blocks($module_name) {
+ $block_class = "{$module_name}_block";
+ if (method_exists($block_class, "get_site_list")) {
+ $blocks = call_user_func(array($block_class, "get_site_list"));
+ foreach (array_keys($blocks) as $id) {
+ list ($unused, $block_id) = explode(":", $id);
+ self::remove("site.sidebar", $module_name, $block_id);
+ }
+ }
+ }
+
static function get_available_admin_blocks() {
return self::_get_blocks("get_admin_list");
}