diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-08-27 15:04:14 -0700 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-08-27 15:04:14 -0700 |
commit | 56937cac5b00f1840e4d73dc840d015b80d75e41 (patch) | |
tree | a21a601f04d266526f8a4d861e0c9d7215ee5ca8 /modules | |
parent | 77ac00c3b8ca498e3a7eeb51185139a2b2335c50 (diff) |
Don't display the slideshow icon if there are no descendants. ticket #660
Diffstat (limited to 'modules')
-rw-r--r-- | modules/slideshow/helpers/slideshow_event.php | 18 |
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) { |