summaryrefslogtreecommitdiff
path: root/modules/slideshow/helpers/slideshow_event.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/slideshow/helpers/slideshow_event.php')
-rw-r--r--modules/slideshow/helpers/slideshow_event.php44
1 files changed, 43 insertions, 1 deletions
diff --git a/modules/slideshow/helpers/slideshow_event.php b/modules/slideshow/helpers/slideshow_event.php
index c6cd7dc7..ce26b189 100644
--- a/modules/slideshow/helpers/slideshow_event.php
+++ b/modules/slideshow/helpers/slideshow_event.php
@@ -23,10 +23,52 @@ class slideshow_event_Core {
site_status::warning(
t("The Slideshow module requires the RSS module. " .
"<a href=\"%url\">Activate the RSS module now</a>",
- array("url" => url::site("admin/modules"))),
+ array("url" => html::mark_clean(url::site("admin/modules")))),
"slideshow_needs_rss");
} else {
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:'" . self::_feed_url($theme) . "'})")
+ ->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:'" . self::_feed_url($theme) . "'})")
+ ->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:'" . self::_feed_url($theme) . "'})")
+ ->css_id("gSlideshowLink"));
+ }
+
+ private static function _feed_url($theme) {
+ if ($item = $theme->item()) {
+ if (!$item->is_album()) {
+ $item = $item->parent();
+ }
+ return rss::url("gallery/album/{$item->id}?page_size=100");
+ } else {
+ return rss::url("tag/tag/{$theme->tag()->id}?page_size=100");
+ }
+ }
}