aboutsummaryrefslogtreecommitdiff
path: root/start.php
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2009-10-03 17:16:08 +0000
committerCash Costello <cash.costello@gmail.com>2009-10-03 17:16:08 +0000
commit6263b1d67488acd66f457aee0ec8a70e418ea5dc (patch)
tree17fc837c3b5ed559efbf0cf78fa25e2ee581c7a8 /start.php
parent3979ea2bbe19b5f4666736901dcc918b259c33d3 (diff)
downloadelgg-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.php30
1 files changed, 30 insertions, 0 deletions
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');