aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--languages/en.php2
-rw-r--r--start.php15
-rw-r--r--views/default/js/photos/tidypics.php4
3 files changed, 19 insertions, 2 deletions
diff --git a/languages/en.php b/languages/en.php
index e7d7bb988..ec65d0622 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -16,7 +16,7 @@ $english = array(
'photos:add' => "Create album",
'images:upload' => "Upload photos",
- 'album:slideshow' => "View slideshow",
+ 'album:slideshow' => "Slideshow",
'album:yours' => "Your photo albums",
'album:yours:friends' => "Your friends' photo albums",
'album:user' => "%s's photo albums",
diff --git a/start.php b/start.php
index 4942f949a..948d42fb5 100644
--- a/start.php
+++ b/start.php
@@ -34,6 +34,7 @@ function tidypics_init() {
$js = elgg_get_simplecache_url('js', 'photos/tidypics');
elgg_register_simplecache_view('js/photos/tidypics');
elgg_register_js('tidypics', $js, 'footer');
+ elgg_register_js('tidypics:slideshow', 'mod/tidypics/vendors/PicLensLite/piclens_optimized.js', 'footer');
// Add photos link to owner block/hover menus
elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'tidypics_owner_block_menu');
@@ -139,6 +140,7 @@ function tidypics_page_handler($page) {
case "album": // view an album individually
set_input('guid', $page[1]);
+ elgg_load_js('tidypics:slideshow');
require "$base/album/view.php";
break;
@@ -297,6 +299,19 @@ function tidypics_entity_menu_setup($hook, $type, $return, $params) {
}
}
+ if (elgg_instanceof($entity, 'object', 'album')) {
+ $url = $entity->getURL() . '?limit=50&view=rss';
+ $url = elgg_format_url($url);
+ $slideshow_link = "javascript:PicLensLite.start({maxScale:0, feedUrl:'$url'})";
+ $options = array(
+ 'name' => 'slideshow',
+ 'text' => elgg_echo('album:slideshow'),
+ 'href' => $slideshow_link,
+ 'priority' => 90,
+ );
+ $return[] = ElggMenuItem::factory($options);
+ }
+
return $return;
}
diff --git a/views/default/js/photos/tidypics.php b/views/default/js/photos/tidypics.php
index 896192eea..c97a1eadb 100644
--- a/views/default/js/photos/tidypics.php
+++ b/views/default/js/photos/tidypics.php
@@ -9,7 +9,9 @@ elgg.provide('elgg.tidypics');
elgg.tidypics.init = function() {
- $(".tidypics-lightbox").fancybox({'type': 'image'});
+ if ($(".tidypics-lightbox").length) {
+ $(".tidypics-lightbox").fancybox({'type': 'image'});
+ }
$("#tidypics-sort").sortable({
opacity: 0.7,