summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-08-27 16:10:38 -0700
committerBharat Mediratta <bharat@menalto.com>2009-08-27 16:10:38 -0700
commit98e9a96ba4d2419e02717369be8c0d886bc35ef7 (patch)
treee2a0e55bde5c12656cfe7dac4a39239a016f6703
parent5d9e334fe6d7c7c1cf6d39a12684e215e797b4b3 (diff)
Don't display the slideshow icon if there are no descendants. ticket #660
Conflicts: modules/slideshow/helpers/slideshow_event.php
-rw-r--r--modules/slideshow/helpers/slideshow_event.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/modules/slideshow/helpers/slideshow_event.php b/modules/slideshow/helpers/slideshow_event.php
index c6cd7dc7..1b881de4 100644
--- a/modules/slideshow/helpers/slideshow_event.php
+++ b/modules/slideshow/helpers/slideshow_event.php
@@ -29,4 +29,38 @@ class slideshow_event_Core {
site_status::clear("slideshow_needs_rss");
}
}
+
+ static function album_menu($menu, $theme) {
+ $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) {
+ $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 tag_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"));
+ }
}