Commit 402e9466 authored by Son Nguyen's avatar Son Nguyen Committed by Gerrit Code Review
Browse files

Merge "Allowing for correctly saving the gallery width setting (Bug #1366622)" into 1.9_STABLE

parents c2e24f39 6011b537
...@@ -51,19 +51,17 @@ class PluginBlocktypeGallery extends PluginBlocktype { ...@@ -51,19 +51,17 @@ class PluginBlocktypeGallery extends PluginBlocktype {
$configdata['viewid'] = $instance->get('view'); $configdata['viewid'] = $instance->get('view');
$style = isset($configdata['style']) ? intval($configdata['style']) : 2; $style = isset($configdata['style']) ? intval($configdata['style']) : 2;
$copyright = null; // Needed to set Panoramio copyright later... $copyright = null; // Needed to set Panoramio copyright later...
$width = !empty($configdata['width']) ? $configdata['width'] : 75;
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; $width = !empty($configdata['width']) ? $configdata['width'] : 400;
break; break;
case 2: // square thumbnails case 2: // square thumbnails
$template = 'squarethumbs'; $template = 'squarethumbs';
$width = isset($configdata['width']) ? $configdata['width'] : 75;
break; break;
} }
...@@ -615,6 +613,15 @@ class PluginBlocktypeGallery extends PluginBlocktype { ...@@ -615,6 +613,15 @@ class PluginBlocktypeGallery extends PluginBlocktype {
} }
unset($values['folder']); unset($values['folder']);
unset($values['images']); 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; 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