From 925a6a2220760cb7daacee1ab80a07b61b3a30a1 Mon Sep 17 00:00:00 2001 From: Nathan Kinkade Date: Thu, 24 Dec 2009 03:32:31 +0000 Subject: Added a 3rd party module that displays all the latest photos, paginated. --- .../latestupdates/helpers/latestupdates_block.php | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 modules/latestupdates/helpers/latestupdates_block.php (limited to 'modules/latestupdates/helpers') diff --git a/modules/latestupdates/helpers/latestupdates_block.php b/modules/latestupdates/helpers/latestupdates_block.php new file mode 100644 index 00000000..f1472d3a --- /dev/null +++ b/modules/latestupdates/helpers/latestupdates_block.php @@ -0,0 +1,50 @@ + t("Latest Updates")); + } + + static function get($block_id, $theme) { + $block = ""; + + if (!$theme->item()) { + return; + } + + switch ($block_id) { + case "latestupdates": + // Determine the ID# of the current album. + $albumID = $theme->item->is_album() ? $theme->item->id : $theme->item->parent_id; + + // Make a new sidebar block. + $block = new Block(); + $block->css_id = "g-latest-updates"; + $block->title = t("Latest Updates"); + $block->content = new View("latestupdates_block.html"); + $block->content->update_links = array( + "Entire Gallery" => url::site("latestupdates/updates"), + "This Album" => url::site("latestupdates/albums/$albumID") + ); + break; + } + return $block; + } +} -- cgit v1.2.3