Commit ed50ec8c authored by Lisa Seeto's avatar Lisa Seeto Committed by Robert Lyon
Browse files

Bug 1896347: Image Gallery Refactor



Change Image gallery block config modal:
 - remove photobucket, picasa, flicker, windowslive options
 - remove 'width' option
 - remove 'display from external gallery' option
 - remove 'thumbnails' option (only use slideshow or thumbnails (square))
 - remove 'use photo frame' option

Remove .tpl's for decommissioned external galleries
refactor code so gallery display defaults to thumbnails square if not slideshow
modify behat test

Change-Id: I3a044bb14713baa3f39732364ee4b46f97f5966b
Signed-off-by: default avatarLisa Seeto <lisaseeto@catalyst.net.nz>
parent 232c6905
......@@ -34,30 +34,9 @@ $string['cannotdisplayslideshow'] = 'Cannot display slideshow.';
$string['gallerysettings'] = 'Gallery settings';
$string['usefancybox'] = 'Use Fancybox 3';
$string['usefancyboxdesc'] = 'Use Fancybox 3 in your gallery. When you click on images in your gallery, they will open in an overlay on the current page.';
$string['photoframe'] = 'Use photo frame';
$string['photoframedesc2'] = 'Show a frame 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 Slimbox 2.';
// 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="https://www.flickr.com/services/api/keys/apply/">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/">Photobucket developer website</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';
$string['picasaalbums'] = 'Picasa albums';
$string['windowslivephotoalbums'] = 'Windows Live photo gallery albums';
$string['externalnotsupported'] = 'The external URL you provided is not supported';
// Fancybox 3
$string['CLOSE'] = "Close";
$string['NEXT'] = "Next";
......
......@@ -1226,7 +1226,7 @@ EOD;
$configdata['artefactids'][] = self::process_attachment($file, $ownertype, $ownerid);
}
}
if ($key == 'imagesel' || $key == 'width' || $key == 'showdesc' || $key == 'imagestyle' || $key == 'photoframe' ) {
if ($key == 'imagesel' || $key == 'width' || $key == 'showdesc' || $key == 'imagestyle') {
//imageselection options are 0,1,2 in the table
if ($key == 'imagesel') {
......
{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="https://www.flickr.com/apps/slideshow/show.swf?v=71649"></param>
<param name="allowFullScreen" value="true"></param>
<embed type="application/x-shockwave-flash" src="https://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 class="s"><a href="http://www.roytanck.com">roytanck.com</a></span>
</div>
{else}
{str tag=noimagesfound section=artefact.file}
{/if}
{if $images}
<iframe width="{$width}" height="{$height}" 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}
......@@ -2,7 +2,7 @@
{foreach from=$images item=image}
<div {if $image.squaredimensions}style="width:{$image.squaredimensions}px;height:{$image.squaredimensions}px;"{/if} class="thumb">
<a data-fancybox="{$image.fancybox}" href="{$image.link}" title="{$image.title}" data-caption="{$image.title}">
<img src="{$image.source}" alt="{$image.title}" title="{$image.title}" width="{if $image.width}{$image.width}{else}{$width}{/if}" height="{if $image.height}{$image.height}{else}{$width}{/if}" {if $frame}class="frame mx-auto d-block"{/if}/>
<img src="{$image.source}" alt="{$image.title}" title="{$image.title}" width="{$width}" height="{$width}"/>
</a>
{if $showdescription && $image.title}
<p class="text-small title">
......
<a href="https://www.flickr.com/">
<img src="{$THEME->get_image_url('gallery/flickr')}" alt="" width="16" height="16" title="{str tag=flickrsets section=blocktype.file/gallery}">
</a>
<a href="http://picasaweb.google.com/">
<img src="{$THEME->get_image_url('gallery/picasa')}" alt="" width="16" height="16" title="{str tag=picasaalbums section=blocktype.file/gallery}">
</a>
<a href="http://www.photobucket.com/">
<img src="{$THEME->get_image_url('gallery/photobucket')}" alt="" width="16" height="16" title="{str tag=photobucketphotosandalbums section=blocktype.file/gallery}">
</a>
<a href="http://www.live.com/">
<img src="{$THEME->get_image_url('gallery/windowslive')}" alt="" width="16" height="16" title="{str tag=windowslivephotoalbums section=blocktype.file/gallery}">
</a>
{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"><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}
......@@ -239,9 +239,9 @@ Background:
And the following "blocks" exist:
# Page One B
| title | type | page |retractable | data |
| Gallery - style 1 | gallery | Page One B | no | attachments=Image1.jpg,Image3.png,Image3.png,Image2.png,Image1.jpg;imagesel=2;showdesc=yes;width=75;imagestyle=1;photoframe=1 |
| Gallery - style 2 | gallery | Page One B | yes | attachments=Image3.png,Image2.png,Image1.jpg,Image1.jpg;imagesel=2;showdesc=yes;width=75;imagestyle=2 |
| Gallery - style 3 | gallery | Page One B | yes | attachments=Image3.png,Image2.png,Image3.png,Image1.jpg,Image1.jpg;imagesel=2;showdesc=no;imagestyle=3;photoframe=0|
| Gallery - style 1 | gallery | Page One B | no | attachments=Image1.jpg,Image3.png,Image3.png,Image2.png,Image1.jpg;imagesel=2;showdesc=yes |
| Gallery - style 2 | gallery | Page One B | yes | attachments=Image3.png,Image2.png,Image1.jpg,Image1.jpg;imagesel=2;showdesc=yes;imagestyle=2 |
| Gallery - style 3 | gallery | Page One B | yes | attachments=Image3.png,Image2.png,Image3.png,Image1.jpg,Image1.jpg;imagesel=2;showdesc=no;imagestyle=3 |
| Folder | folder | Page One B | no | dirname=myfolder;attachments=mahara_about.pdf,Image2.png,Image1.jpg,Image3.png,mahara.mp3 |
| Some HTML | html | Page One B | yes | attachment=test_html.html |
| Profile Information | profileinfo | Page One B | no | introtext =Mahara unicorn here! Nice to meet you :);profileicon=Image3.png |
......
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