Commit 9eef4acf authored by profix898's avatar profix898

- bugfix: empty 'Image data' displays all data (#226960)

- bugfix: block cache per user for navigation (#227888)
- task: make imageblock settings reusable
parent 23684410
......@@ -662,7 +662,7 @@ function gallery_get_blocks($plugin_names = NULL) {
* @param $extra
* $extra['class']:
* Optional class to apply to the block (if customized css styles are required).
* $extra['num_colums']:
* $extra['num_cols']:
* If given for a 'ImageBlock' a grid block with 'num_cols' columns is generated.
* Otherwise (default) a 'normal' image block is returned.
*/
......
......@@ -21,7 +21,7 @@ function _gallery_block($op = 'list', $delta = 0, $edit = array()) {
$id = variable_get('gallery_block_'. $i .'_blockid', '');
$blocks['block-'. $i]['info'] = $i ? t('Gallery Block @id', array('@id' => '['. (empty($id) ? $i : $id) .']'))
: t('Gallery Navigation');
$blocks['block-'. $i]['cache'] = variable_get('gallery_block_'. $i .'_cache', BLOCK_CACHE_PER_USER);
$blocks['block-'. $i]['cache'] = variable_get('gallery_block_'. $i .'_cache', BLOCK_NO_CACHE);
}
return $blocks;
case 'view':
......@@ -42,7 +42,7 @@ function _gallery_block($op = 'list', $delta = 0, $edit = array()) {
return $delta ? _gallery_block_admin_block($delta) : _gallery_block_admin_navigation();
case 'save':
require_once(drupal_get_path('module', 'gallery') .'/gallery_block_admin.inc');
_gallery_block_admin_save($delta, $edit);
_gallery_block_admin_save($edit);
break;
}
}
......@@ -155,10 +155,10 @@ function _gallery_block_image_block($delta, $plugin, $plugin_block) {
if (($num = $num_images - $count) > 0) {
$param_blocks_array += array_fill($count, $num, end($param_blocks_array));
}
$params['blocks'] = is_array($param_blocks_array) ? implode('|', $param_blocks_array) : '';
$params['blocks'] = implode('|', $param_blocks_array);
$params['itemId'] = variable_get($element .'_item_id', '');
$param_show_array = variable_get($element .'_block_show', array());
$params['show'] = is_array($param_show_array) ? implode('|', $param_show_array) : '';
$params['show'] = empty($param_show_array) ? 'none' : implode('|', $param_show_array);
if (variable_get($element .'_size_method', GALLERY_IMAGEBLOCK_SIZE_METHOD_DEFAULT) == 'maxsize') {
$params['maxSize'] = variable_get($element .'_size', GALLERY_IMAGEBLOCK_SIZE_DEFAULT);
}
......
This diff is collapsed.
This diff is collapsed.
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