diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-08-27 15:04:14 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-08-27 16:28:17 -0700 |
commit | 93138f6ae78fd5ef11ea5095156827592f61bc56 (patch) | |
tree | 61bc27831a362994fc96ea90172d50e25d5c76cb /modules/slideshow | |
parent | 4828db003f3ee505eb9e6d056cdb142da34b78ff (diff) |
Don't display the slideshow icon if there are no descendants. ticket #660
Diffstat (limited to 'modules/slideshow')
-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) { |