diff options
author | Cash Costello <cash.costello@gmail.com> | 2009-10-03 17:16:08 +0000 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2009-10-03 17:16:08 +0000 |
commit | 6263b1d67488acd66f457aee0ec8a70e418ea5dc (patch) | |
tree | 17fc837c3b5ed559efbf0cf78fa25e2ee581c7a8 /start.php | |
parent | 3979ea2bbe19b5f4666736901dcc918b259c33d3 (diff) | |
download | elgg-6263b1d67488acd66f457aee0ec8a70e418ea5dc.tar.gz elgg-6263b1d67488acd66f457aee0ec8a70e418ea5dc.tar.bz2 |
first version of an album slideshow - initial integration by Torsten
Diffstat (limited to 'start.php')
-rw-r--r-- | start.php | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -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');
|