From 6263b1d67488acd66f457aee0ec8a70e418ea5dc Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 3 Oct 2009 17:16:08 +0000 Subject: first version of an album slideshow - initial integration by Torsten --- start.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'start.php') diff --git a/start.php b/start.php index 82c83227e..24189d44d 100644 --- a/start.php +++ b/start.php @@ -70,6 +70,9 @@ register_plugin_hook('notify:entity:message', 'object', 'tidypics_notify_message'); } + + // slideshow plugin hook + register_plugin_hook('tidypics:slideshow', 'album', 'tidypics_slideshow'); } /** @@ -387,6 +390,33 @@ $title = friendly_title($title); return $CONFIG->url . "pg/photos/album/" . $entity->getGUID() . "/" . $title; } + + + /** + * Catch the plugin hook and add the default album slideshow + * + * @param $hook - 'tidypics:slideshow' + * @param $entity_type - 'album' + * @param $returnvalue - if set, return because another plugin has used the hook + * @param $params - album entity + * @return unknown_type + */ + function tidypics_slideshow($hook, $entity_type, $returnvalue, $params) { + + if ($returnvalue) { + // someone has already added a slideshow + return $returnvalue; + } + + $slideshow_link = 'javascript:PicLensLite.start({maxScale:0,feedUrl:PicLensLite.indexFeeds()[0].url})'; + + // add the slideshow javascript to the header + extend_view('metatags', 'js/slideshow'); + + return $slideshow_link; + } + + // Make sure tidypics_init is called on initialisation register_elgg_event_handler('init','system','tidypics_init'); -- cgit v1.2.3