summaryrefslogtreecommitdiff
path: root/modules/slideshow/helpers
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-08-27 15:04:14 -0700
committerBharat Mediratta <bharat@menalto.com>2009-08-27 16:28:17 -0700
commit93138f6ae78fd5ef11ea5095156827592f61bc56 (patch)
tree61bc27831a362994fc96ea90172d50e25d5c76cb /modules/slideshow/helpers
parent4828db003f3ee505eb9e6d056cdb142da34b78ff (diff)
Don't display the slideshow icon if there are no descendants. ticket #660
Diffstat (limited to 'modules/slideshow/helpers')
-rw-r--r--modules/slideshow/helpers/slideshow_event.php18
1 files changed, 11 insertions, 7 deletions
diff --git a/modules/slideshow/helpers/slideshow_event.php b/modules/slideshow/helpers/slideshow_event.php
index cf79f71a..1b881de4 100644
--- a/modules/slideshow/helpers/slideshow_event.php
+++ b/modules/slideshow/helpers/slideshow_event.php
@@ -31,13 +31,17 @@ class slideshow_event_Core {
}
static function album_menu($menu, $theme) {
- $menu
- ->append(Menu::factory("link")
- ->id("slideshow")
- ->label(t("View slideshow"))
- ->url("javascript:PicLensLite.start(" .
- "{maxScale:0,feedUrl:PicLensLite.indexFeeds()[0].url})")
- ->css_id("gSlideshowLink"));
+ $descendants_count = ORM::factory("item", $theme->item->id)
+ ->descendants_count(array("type" => "photo"));
+ if ($descendants_count > 1) {
+ $menu
+ ->append(Menu::factory("link")
+ ->id("slideshow")
+ ->label(t("View slideshow"))
+ ->url("javascript:PicLensLite.start(" .
+ "{maxScale:0,feedUrl:PicLensLite.indexFeeds()[0].url})")
+ ->css_id("gSlideshowLink"));
+ }
}
static function photo_menu($menu, $theme) {