Commit 4d86a0bf authored by Hugh Davenport's avatar Hugh Davenport
Browse files

Extended image gallery blocktype

Adds support for the following external gallery hosters
- flickr
- panoramio
- photobucket
- picasa
- windows live

This patch does not do the following
- Support non-public albums on flickr or windows live
- Support guest-link albums on flikr
- Support albums with access keys on photobucket or picasa
- Support albums with custom URL's in photobucket

This patch also doesn't have very good error
handling for the above cases

Based on Gregor Anzelj's branch at
 https://gitorious.org/~anzeljg/mahara/anzeljg-mahara/commits/new_slideshow



Bug #794369

Change-Id: I3a961cd97d21d0a8d5ce2f1a32ef81d7c761facb
Author: Gregor Anzelj <gregor.anzelj@gmail.com>
[hugh@catalyst.net.nz prepared for review, expanded commit msg]
Signed-off-by: default avatarHugh Davenport <hugh@catalyst.net.nz>
parent a9207cff
$j('#instconf_select_container input[type="radio"][value="0"]').click(function() {
$j('#instconf_images_header').addClass('hidden');
$j('#instconf_images_container').addClass('hidden');
$j('#instconf_external_header').addClass('hidden');
$j('#instconf_external_container').addClass('hidden');
$j('#instconf_external').addClass('hidden');
$j('#externalgalleryhelp').addClass('hidden');
$j('#instconf_folder_header').removeClass('hidden');
$j('#instconf_folder_container').removeClass('hidden');
});
$j('#instconf_select_container input[type="radio"][value="1"]').click(function() {
$j('#instconf_folder_header').addClass('hidden');
$j('#instconf_folder_container').addClass('hidden');
$j('#instconf_external_header').addClass('hidden');
$j('#instconf_external_container').addClass('hidden');
$j('#instconf_external').addClass('hidden');
$j('#externalgalleryhelp').addClass('hidden');
$j('#instconf_images_header').removeClass('hidden');
$j('#instconf_images_container').removeClass('hidden');
});
$j('#instconf_select_container input[type="radio"][value="2"]').click(function() {
$j('#instconf_images_header').addClass('hidden');
$j('#instconf_images_container').addClass('hidden');
$j('#instconf_folder_header').addClass('hidden');
$j('#instconf_folder_container').addClass('hidden');
$j('#instconf_external_header').removeClass('hidden');
$j('#instconf_external_container').removeClass('hidden');
$j('#instconf_external').removeClass('hidden');
$j('#externalgalleryhelp').removeClass('hidden');
});
$j('#instconf_style_container input[type="radio"][value="0"]').click(function () {
$j('#instconf_width').val('75');
});
$j('#instconf_style_container input[type="radio"][value="1"]').click(function () {
$j('#instconf_width').val('400');
});
$j('#instconf_style_container input[type="radio"][value="2"]').click(function () {
$j('#instconf_width').val('75');
});
......@@ -22,6 +22,7 @@
* @author Catalyst IT Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
* @copyright (C) 2011 Gregor Anzelj <gregor.anzelj@gmail.com>
*
*/
......@@ -33,8 +34,47 @@ $string['description'] = 'A collection of images from your Files area';
$string['select'] = 'Image Selection';
$string['selectfolder'] = 'Display all images from one of my folders (will include images uploaded later)';
$string['selectimages'] = 'I will choose individual images to display';
$string['selectexternal'] = 'Display images from external gallery';
$string['externalgalleryurl'] = 'Gallery URL or RSS';
$string['externalgalleryurldesc'] = 'You can embed the following external galleries:';
$string['width'] = 'Width';
$string['widthdescription'] = 'Specify the width for your images (in pixels). The images will be scaled to this width.';
$string['style'] = 'Style';
$string['stylethumbs'] = 'Thumbnails';
$string['stylesquares'] = 'Thumbnails (Square)';
$string['styleslideshow'] = 'Slideshow';
$string['cannotdisplayslideshow'] = 'Cannot display slideshow.';
$string['gallerysettings'] = 'Gallery Settings';
$string['useslimbox2'] = 'Use Slimbox 2?';
$string['useslimbox2desc'] = 'Slimbox 2 (visual clone of Lightbox 2) is a simple, unobtrusive script used to overlay images on the current page.';
$string['photoframe'] = 'Use photo frame?';
$string['photoframedesc'] = 'If enabled, than the frame will be rendered around the thumbnail of each photo in the gallery.';
$string['previewwidth'] = 'Maximum photo width';
$string['previewwidthdesc'] = 'Set the maximum width to which the photos will be resized, when viewed with Slimbox2.';
// Flickr
$string['flickrsettings'] = 'Flickr Settings';
$string['flickrapikey'] = 'Flickr API key';
$string['flickrapikeydesc'] = 'To show photo sets from Flickr, you\'ll need a valid Flickr API key. <a href="http://www.flickr.com/services/api/keys/apply/" target="_blank">Apply for your key online</a>.';
$string['flickrsets'] = 'Flickr Sets';
// Photobucket
$string['pbsettings'] = 'Photobucket Settings';
$string['pbapikey'] = 'Photobucket API key';
$string['pbapikeydesc'] = 'To show photo albums from Photobucket, you\'ll need a valid API key and API private key.<br>Go to the <a href="http://developer.photobucket.com/" target="_blank">Photobucket developer web site</a>, agree to the terms of service, sign up, and get the API keys.';
$string['pbapiprivatekey'] = 'Photobucket API private key';
$string['photobucketphotosandalbums'] = 'Photobucket user photos and albums';
// Panoramio
$string['Photo'] = 'Photo';
$string['by'] = 'by';
$string['panoramiocopyright'] = 'Photos provided by Panoramio are under the copyright of their owners.';
$string['panoramiouserphotos'] = 'Panoramio user photos';
$string['picasaalbums'] = 'Picasa Albums';
$string['windowslivephotoalbums'] = 'Windows Live Photo Gallery albums';
$string['externalnotsupported'] = 'The external URL you provided is not supported';
<h3>External Gallery URL</h3>
<p>To embed an external gallery, you have to copy the link to the external gallery and paste it into the textarea.</p>
<p>It is possible to embed the following external galleries:
<ul>
<li>Flickr, e.g. http://www.flickr.com/photos/12345678@N01/sets/98765432123456789/</li>
<li>Picasa, e.g. http://picasaweb.google.com/user.name/AlbumName#</li>
<li>Panoramio, e.g. http://www.panoramio.com/user/123456</li>
<li>Photobucket, e.g. http://s1234.photobucket.com/albums/ee123/username/ or http://s1234.photobucket.com/albums/ee123/username/AlbumName/</li>
<li>Windows Live Photo Gallery, e.g. http://cid-123456ab7890cd12.photos.live.com/self.aspx/AlbumName/photo.jpg</li>
</ul>
</p>
<p><b>Note:</b>
<ul>
<li>To use Flickr, the site admin has to provide a valid API key.</li>
<li>To use Photobucket, the site admin has to provide a valid API key and a secret API key.</li>
<li>For Windows Live Photo Gallery to work properly, the link to one of the photos inside the album must be copied and pasted into the textarea in order to show the entire album.</li>
</ul>
</p>
{if $images}
<object width="{$width}" height="{$height}">
<param name="flashvars" value="offsite=true&page_show_url=%2Fphotos%2F{$images.user}%2Fsets%2F{$images.gallery}%2Fshow%2F&set_id={$images.gallery}"></param>
<param name="movie" value="http://www.flickr.com/apps/slideshow/show.swf?v=71649"></param>
<param name="allowFullScreen" value="true"></param>
<embed type="application/x-shockwave-flash" src="http://www.flickr.com/apps/slideshow/show.swf?v=71649" allowFullScreen="true" flashvars="offsite=true&page_show_url=%2Fphotos%2F{$images.user}%2Fsets%2F{$images.gallery}%2Fshow%2F&set_id={$images.gallery}" width="{$width}" height="{$height}"></embed>
</object>
{else}
{str tag=cannotdisplayslideshow section=blocktype.file/gallery}
{/if}
{if $images}
<div style="width:{$width}px; text-align:center;">
<object type="application/x-shockwave-flash" data="http://media.roytanck.com/flickrwidget.swf" width="{$width}" height="{$width}">
<param name="movie" value="http://media.roytanck.com/flickrwidget.swf" />
<param name="bgcolor" value="#ffffff" />
<param name="flashvars" value="feed={$images}" />
<param name="AllowScriptAccess" value="always"/>
<p>
<a href="http://www.roytanck.com">Roy Tanck</a>'s Flickr Widget requires Flash Player 9 or better.</p>
</object>
<span style="font-size:9px;"><a href="http://www.roytanck.com">roytanck.com</a></span>
</div>
{else}
{str tag=noimagesfound section=artefact.file}
{/if}
{if $images}
<iframe marginheight="0" marginwidth="0" width="{$width}" height="{$height}" scrolling="no" frameborder="0" src="http://www.panoramio.com/user/{$images.user}/slideshow"></iframe>
{else}
{str tag=cannotdisplayslideshow section=blocktype.file/gallery}
{/if}
{if $images}
<iframe marginheight="0" marginwidth="0" width="{$width}" height="{$height}" scrolling="no" frameborder="0" src="{$images.url}/{$images.user}/{$images.album}?albumview=slideshow"></iframe>
{else}
{str tag=cannotdisplayslideshow section=blocktype.file/gallery}
{/if}
{if $images}
<object width="{$width}" height="{$height}">
<param name="flashvars" value="host=picasaweb.google.com&feat=flashalbum&RGB=0x000000&feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2F{$images.user}%2Falbum%2F{$images.gallery}%3Falt%3Drss%26kind%3Dphoto"></param>
<param name="movie" value="https://picasaweb.google.com/s/c/bin/slideshow.swf"></param>
<param name="allowFullScreen" value="true"></param>
<embed type="application/x-shockwave-flash" src="https://picasaweb.google.com/s/c/bin/slideshow.swf" width="{$width}" height="{$height}" allowFullScreen="true" flashvars="host=picasaweb.google.com&feat=flashalbum&RGB=0x000000&feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2F{$images.user}%2Falbum%2F{$images.gallery}%3Falt%3Drss%26kind%3Dphoto"></embed>
</object>
{else}
{str tag=cannotdisplayslideshow section=blocktype.file/gallery}
{/if}
<div class="thumbnails">
{foreach from=$images item=image}
<span style="float:left;{if $frame} padding:0.3em;{/if}">
<a rel="{$image.slimbox2}" href="{$image.link}" title="{$image.title}" target="_blank">
<img src="{$image.source}" alt="{$image.title}" title="{$image.title}" width="{$width}" height="{$width}" {if $frame}class="frame"{/if}/>
</a>
</span>
{/foreach}
</div>
{if isset($copyright)}<div class="cb" id="lbBottom">{$copyright|safe}</div>{/if}
<a href="http://www.flickr.com/" target="_blank">
<img src="{$wwwroot}artefact/file/blocktype/gallery/logos/flickr.png" border="0" width="16" height="16" title="{str tag=flickrsets section=blocktype.file/gallery}">
</a>
<a href="http://picasaweb.google.com/" target="_blank">
<img src="{$wwwroot}artefact/file/blocktype/gallery/logos/picasa.png" border="0" width="16" height="16" title="{str tag=picasaalbums section=blocktype.file/gallery}">
</a>
<a href="http://www.panoramio.com/" target="_blank">
<img src="{$wwwroot}artefact/file/blocktype/gallery/logos/panoramio.png" border="0" width="16" height="16" title="{str tag=panoramiouserphotos section=blocktype.file/gallery}">
</a>
<a href="http://www.photobucket.com/" target="_blank">
<img src="{$wwwroot}artefact/file/blocktype/gallery/logos/photobucket.png" border="0" width="16" height="16" title="{str tag=photobucketphotosandalbums section=blocktype.file/gallery}">
</a>
<a href="http://www.live.com/" target="_blank">
<img src="{$wwwroot}artefact/file/blocktype/gallery/logos/windowslive.png" border="0" width="16" height="16" title="{str tag=windowslivephotoalbums section=blocktype.file/gallery}">
</a>
<div class="thumbnails">
{foreach from=$images item=image}
<a href="{$image.link}" target="_blank">
<img src="{$image.source}" alt="{$image.title}" title="{$image.title}" />
<span style="float:left;{if $frame} padding:0.3em;{/if}">
<a rel="{$image.slimbox2}" href="{$image.link}" title="{$image.title}" target="_blank">
<img src="{$image.source}" alt="{$image.title}" title="{$image.title}" {if $frame}class="frame"{/if} />
</a>
</span>
{/foreach}
</div>
{if isset($copyright)}<div class="cb" id="lbBottom">{$copyright|safe}</div>{/if}
{if $images}
<center><div width="100" height="115" style="width:100px;height:115px;padding:0;background-color:#fcfcfc;"><center><a href="http://{$images.user}.photos.live.com/play.aspx/{$images.album}?ref=1" target="_blank"><img src="{$WWWROOT}/artefact/file/blocktype/gallery/thumb.png" width="96" height="96" border="0"></a><br />{$images.album}</center></div></center>
{else}
{str tag=cannotdisplayslideshow section=blocktype.file/gallery}
{/if}
......@@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package mahara
* @subpackage artefact-file
* @subpackage artefact-gallery
* @author Catalyst IT Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
......@@ -28,5 +28,5 @@
defined('INTERNAL') || die();
$config = new StdClass;
$config->version = 2010102801;
$config->release = '1.0.0';
$config->version = 2011060800;
$config->release = '2.0';
Slimbox in Mahara
======================
Website: http://www.digitalia.be/software/slimbox2
Version: 2.0.4
This library is used to overlay images on the page.
It is a clone of Lightbox 2.
(available at http://www.huddletogether.com/projects/lightbox2/)
Changes:
* None
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment