'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",
$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');
case "album": // view an album individually
set_input('guid', $page[1]);
+ elgg_load_js('tidypics:slideshow');
require "$base/album/view.php";
break;
}
}
+ 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;
}
elgg.tidypics.init = function() {
- $(".tidypics-lightbox").fancybox({'type': 'image'});
+ if ($(".tidypics-lightbox").length) {
+ $(".tidypics-lightbox").fancybox({'type': 'image'});
+ }
$("#tidypics-sort").sortable({
opacity: 0.7,