From 974f9f778891bbefeb083b2d97b3dae206c96452 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 26 Nov 2008 21:50:45 +0000 Subject: Add a new "tag" page type. Create the concept of "page types" which let us specify the kind of page that we're rendering in high level terms. Currently there are three page types: album, photo and tag. The tag page type uses slightly different variables. It has a $tag but no $item. Adjust all sidebar_block() functions to avoid printing stuff that's dependent on the item if there is no item. Simplify the tag code to stop trying to fake an item. Update the theme slightly to use $item and $tag where appropriate (notably, for making the element). --- modules/carousel/helpers/carousel_block.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'modules/carousel/helpers') diff --git a/modules/carousel/helpers/carousel_block.php b/modules/carousel/helpers/carousel_block.php index de131625..1732fa39 100644 --- a/modules/carousel/helpers/carousel_block.php +++ b/modules/carousel/helpers/carousel_block.php @@ -20,12 +20,14 @@ class carousel_block_Core { public static function sidebar_blocks($theme) { - $block = new Block(); - $block->id = "gCarousel"; - $block->title = "Album: <a href=\"#\">{$theme->item()->title_edit}</a>"; - $block->content = '<img src="' . - url::base() . "modules/carousel/images/carousel.png" . - '" width="214"/>'; - return $block->__toString(); + if ($theme->item()) { + $block = new Block(); + $block->id = "gCarousel"; + $block->title = "Album: <a href=\"#\">{$theme->item()->title_edit}</a>"; + $block->content = '<img src="' . + url::base() . "modules/carousel/images/carousel.png" . + '" width="214"/>'; + return $block; + } } } \ No newline at end of file -- cgit v1.2.3