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 { ...@@ -62,9 +62,11 @@ class PluginBlocktypeGallery extends PluginBlocktype {
switch ($style) { switch ($style) {
case 0: // thumbnails case 0: // thumbnails
$template = 'thumbnails'; $template = 'thumbnails';
$width = isset($configdata['width']) ? $configdata['width'] : 75;
break; break;
case 1: // slideshow case 1: // slideshow
$template = 'slideshow'; $template = 'slideshow';
$width = isset($configdata['width']) ? $configdata['width'] : 400;
break; break;
} }
...@@ -96,9 +98,7 @@ class PluginBlocktypeGallery extends PluginBlocktype { ...@@ -96,9 +98,7 @@ class PluginBlocktypeGallery extends PluginBlocktype {
continue; continue;
} }
if (!empty($configdata['width'])) { $src .= '&maxwidth=' . $width;
$src .= '&maxwidth=' . $configdata['width'];
}
$images[] = array( $images[] = array(
'link' => get_config('wwwroot') . 'view/artefact.php?artefact=' . 'link' => get_config('wwwroot') . 'view/artefact.php?artefact=' .
...@@ -112,6 +112,7 @@ class PluginBlocktypeGallery extends PluginBlocktype { ...@@ -112,6 +112,7 @@ class PluginBlocktypeGallery extends PluginBlocktype {
$smarty->assign('instanceid', $instance->get('id')); $smarty->assign('instanceid', $instance->get('id'));
$smarty->assign('count', count($images)); $smarty->assign('count', count($images));
$smarty->assign('images', $images); $smarty->assign('images', $images);
$smarty->assign('width', $width);
return $smarty->fetch('blocktype:gallery:' . $template . '.tpl'); return $smarty->fetch('blocktype:gallery:' . $template . '.tpl');
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</td> </td>
<td> <td>
{foreach from=$images item=image name=images} {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} {/foreach}
</td> </td>
<td class="control"> <td class="control">
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
</script> </script>
<div id="{{$name}}_list"> <div id="{{$name}}_list">
{{if $maxfilesize}} {{if $maxfilesize}}
<input type="hidden" name="MAX_FILE_SIZE" value="{{$maxfilesize}}"/> <input type="hidden" name="MAX_FILE_SIZE" value="{{$maxfilesize}}">
{{/if}} {{/if}}
<input type="file" name="{{$name}}_files_0"/> <input type="file" name="{{$name}}_files_0">
</div> </div>
<a href="" onclick="{{$name}}_new(); return false;">[+]</a> <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