Commit 1db6ca01 authored by profix898's avatar profix898

- bugfix: fix for two E_ALL notices

parent aed72f7a
......@@ -34,7 +34,7 @@ function _gallery_block($op = 'list', $delta = 0, $edit = array()) {
$block['content'] = '<div id="gsSidebar" class="gcBorder1">'. implode('', $GLOBALS['gallery_sidebar']) .'</div>';
}
GalleryEmbed::done();
return $block;
return isset($block) ? $block : FALSE;
}
break;
case 'configure':
......
......@@ -331,14 +331,16 @@ function _gallery_block_admin_imageblock_submit($form, &$form_state) {
* Function _gallery_block_admin_imageblock_save().
*/
function _gallery_block_admin_imageblock_save(&$values) {
$element = $values['element'];
unset($values['element']);
// Validate _size variable
if (isset($values[$element .'_imageblock_size'])) {
if (!is_numeric($values[$element .'_imageblock_size']) || $values[$element .'_imageblock_size'] < 10) {
$values[$element .'_imageblock_size'] = 10;
drupal_set_message(t('Image size must be a number greater than ten pixels.
(The value has been updated to \'10\' for your convenience.)'), 'error');
$element = isset($values['element']) ? $values['element'] : FALSE;
if ($element) {
unset($values['element']);
// Validate _size variable
if (isset($values[$element .'_imageblock_size'])) {
if (!is_numeric($values[$element .'_imageblock_size']) || $values[$element .'_imageblock_size'] < 10) {
$values[$element .'_imageblock_size'] = 10;
drupal_set_message(t('Image size must be a number greater than ten pixels.
(The value has been updated to \'10\' for your convenience.)'), 'error');
}
}
}
// Save imageblock variables
......@@ -363,20 +365,22 @@ function _gallery_block_admin_update($form, &$form_state) {
* Function _gallery_block_admin_save().
*/
function _gallery_block_admin_save(&$values) {
$element = $values['element'];
$element = isset($values['element']) ? $values['element'] : FALSE;
// Save imageblock values (if present)
if (isset($values['imageblock'])) {
_gallery_block_admin_imageblock_save($values);
}
// Save variables
unset($values['element']);
foreach ($values as $key => $value) {
$pos = strpos($key, $element);
if ($pos !== FALSE && $pos == 0) {
if (is_array($value)) {
$value = array_values(array_filter($value));
if ($element) {
unset($values['element']);
foreach ($values as $key => $value) {
$pos = strpos($key, $element);
if ($pos !== FALSE && $pos == 0) {
if (is_array($value)) {
$value = array_values(array_filter($value));
}
variable_set($key, $value);
}
variable_set($key, $value);
}
}
}
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