Commit c8c75960 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Gallery: set max-width on img element to fix display in IE


Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 9577a216
......@@ -62,9 +62,11 @@ class PluginBlocktypeGallery extends PluginBlocktype {
switch ($style) {
case 0: // thumbnails
$template = 'thumbnails';
$width = isset($configdata['width']) ? $configdata['width'] : 75;
break;
case 1: // slideshow
$template = 'slideshow';
$width = isset($configdata['width']) ? $configdata['width'] : 400;
break;
}
......@@ -96,9 +98,7 @@ class PluginBlocktypeGallery extends PluginBlocktype {
continue;
}
if (!empty($configdata['width'])) {
$src .= '&maxwidth=' . $configdata['width'];
}
$src .= '&maxwidth=' . $width;
$images[] = array(
'link' => get_config('wwwroot') . 'view/artefact.php?artefact=' .
......@@ -112,6 +112,7 @@ class PluginBlocktypeGallery extends PluginBlocktype {
$smarty->assign('instanceid', $instance->get('id'));
$smarty->assign('count', count($images));
$smarty->assign('images', $images);
$smarty->assign('width', $width);
return $smarty->fetch('blocktype:gallery:' . $template . '.tpl');
}
......
......@@ -8,7 +8,7 @@
</td>
<td>
{foreach from=$images item=image name=images}
<a href="{$image.link}" target="_blank"><img src="{$image.source}" alt="{$image.title}" title="{$image.title}" {if !$dwoo.foreach.images.first}style="display:none;"{/if}></a>
<a href="{$image.link}" target="_blank"><img src="{$image.source}" alt="{$image.title}" title="{$image.title}" style="max-width: {$width}px;{if !$dwoo.foreach.images.first} display:none;{/if}"></a>
{/foreach}
</td>
<td class="control">
......
......@@ -15,8 +15,8 @@
</script>
<div id="{{$name}}_list">
{{if $maxfilesize}}
<input type="hidden" name="MAX_FILE_SIZE" value="{{$maxfilesize}}"/>
<input type="hidden" name="MAX_FILE_SIZE" value="{{$maxfilesize}}">
{{/if}}
<input type="file" name="{{$name}}_files_0"/>
<input type="file" name="{{$name}}_files_0">
</div>
<a href="" onclick="{{$name}}_new(); return false;">[+]</a>
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