summaryrefslogtreecommitdiff
path: root/modules/slideshow/helpers/slideshow_event.php
diff options
context:
space:
mode:
authorroot <root@sleepydogs.net>2009-09-13 09:01:55 -0700
committerroot <root@sleepydogs.net>2009-09-13 09:01:55 -0700
commitc62d1f440f077ba806b7ff0c6b90ef89c79b2fd3 (patch)
treeb64f05e2a7bd8db7200e3c407904e255826b4cf2 /modules/slideshow/helpers/slideshow_event.php
parentb96ac1eb81b7ccd5bd050ffab0ca9ce1feec8f4f (diff)
parentcaa2002d7777e0ceb884d4c628650804620ca2b6 (diff)
Merge branch 'master' of git://github.com/gallery/gallery3
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");
+ }
+ }
}