]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
add the old slideshow back in
authorcash <cash.costello@gmail.com>
Mon, 12 Dec 2011 02:32:19 +0000 (21:32 -0500)
committercash <cash.costello@gmail.com>
Mon, 12 Dec 2011 02:32:19 +0000 (21:32 -0500)
languages/en.php
start.php
views/default/js/photos/tidypics.php

index e7d7bb988677722746c8b82b5f5d560c1e086ec9..ec65d0622360a0e66bcc0c1f0a8879e09d48e233 100644 (file)
@@ -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",
index 4942f949a19df5a7cfbeacb0061ea9ad032cea96..948d42fb5e8a4ddafce1496906e7b9c2734b6f10 100644 (file)
--- 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;
 }
 
index 896192eea42d63ddf8701f60c58c64a6b9b91789..c97a1eadb1c39ea06f3a7ecb5893becc398d6a59 100644 (file)
@@ -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,