Commit 40822929 authored by Bob Lyon's avatar Bob Lyon Committed by Robert Lyon
Browse files

Allowing for correctly saving the gallery width setting (Bug #1366622)



Currently it checks what width it should be on rendering but it
should also do this on saving to make sure a width of 0 is not set.

Change-Id: I7837c3120fa29e2a2dc5c9c63301dfa4543428a4
Signed-off-by: default avatarBob Lyon <bob@katipo.co.nz>
parent ae622d8d
......@@ -51,19 +51,17 @@ class PluginBlocktypeGallery extends PluginBlocktype {
$configdata['viewid'] = $instance->get('view');
$style = isset($configdata['style']) ? intval($configdata['style']) : 2;
$copyright = null; // Needed to set Panoramio copyright later...
$width = !empty($configdata['width']) ? $configdata['width'] : 75;
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;
$width = !empty($configdata['width']) ? $configdata['width'] : 400;
break;
case 2: // square thumbnails
$template = 'squarethumbs';
$width = isset($configdata['width']) ? $configdata['width'] : 75;
break;
}
......@@ -620,6 +618,15 @@ class PluginBlocktypeGallery extends PluginBlocktype {
}
unset($values['folder']);
unset($values['images']);
switch ($values['style']) {
case 0: // thumbnails
case 2: // square thumbnails
$values['width'] = !empty($values['width']) ? $values['width'] : 75;
break;
case 1: // slideshow
$values['width'] = !empty($values['width']) ? $values['width'] : 400;
break;
}
return $values;
}
......
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