From 19cb27c9a4489c357c0e516c69ebcb218f8832c1 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Tue, 29 Sep 2009 15:07:53 -0700 Subject: change the block_manager api so that the theme is passed into the get method. convert info to the new sidebar block approach --- modules/info/helpers/info_block.php | 39 +++++++++++++++++++++++++++++++++ modules/info/helpers/info_installer.php | 32 +++++++++++++++++++++++++++ modules/info/helpers/info_theme.php | 10 --------- modules/info/module.info | 2 +- 4 files changed, 72 insertions(+), 11 deletions(-) create mode 100644 modules/info/helpers/info_block.php create mode 100644 modules/info/helpers/info_installer.php (limited to 'modules/info') diff --git a/modules/info/helpers/info_block.php b/modules/info/helpers/info_block.php new file mode 100644 index 00000000..558c32f1 --- /dev/null +++ b/modules/info/helpers/info_block.php @@ -0,0 +1,39 @@ + t("Metadata")); + } + + static function get($block_id, $theme) { + $block = new Block(); + switch ($block_id) { + case "metadata": + if ($theme->item()) { + $block = new Block(); + $block->css_id = "gMetadata"; + $block->title = $theme->item()->is_album() ? t("Album Info") : t("Photo Info"); + $block->content = new View("info_block.html"); + } + break; + } + return $block; + } +} \ No newline at end of file diff --git a/modules/info/helpers/info_installer.php b/modules/info/helpers/info_installer.php new file mode 100644 index 00000000..d77908d0 --- /dev/null +++ b/modules/info/helpers/info_installer.php @@ -0,0 +1,32 @@ +item()) { - $block = new Block(); - $block->css_id = "gMetadata"; - $block->title = $theme->item()->is_album() ? t("Album Info") : t("Photo Info"); - $block->content = new View("info_block.html"); - return $block; - } - } - static function thumb_info($theme, $item) { $results = ""; if ($item->view_count) { diff --git a/modules/info/module.info b/modules/info/module.info index e352213c..5f84cbb9 100644 --- a/modules/info/module.info +++ b/modules/info/module.info @@ -1,3 +1,3 @@ name = "Info" description = "Display extra information about photos and albums" -version = 1 +version = 2 -- cgit v1.2.3