Commit 1fb40367 authored by walkah's avatar walkah

* make $category param optional in gallery_user

* fix #16852 : implode errors when block configuration not set
parent 3c59f049
......@@ -53,7 +53,7 @@ function gallery_settings() {
/**
* Implementation of hook_user
*/
function gallery_user($op, &$edit, &$user, $category) {
function gallery_user($op, &$edit, &$user, $category = NULL) {
switch ($op) {
case 'insert':
_gallery_init();
......@@ -134,19 +134,22 @@ function gallery_block($op = 'list', $delta = 0) {
}
break;
case 1:
_gallery_init();
$params = array('blocks' => implode('|', variable_get('gallery_blocks', array())),
'show' => implode('|', variable_get('gallery_show', array())),
'header' => 1,
'maxsize' => 140);
list($ret, $content) = GalleryEmbed::getImageBlock($params);
if ($content) {
$block['subject'] = t('gallery');
$block['content'] = $content;
$blocks = variable_get('gallery_blocks', array());
$show = variable_get('gallery_show', array());
if (count($blocks) && count($show)) {
_gallery_init();
$params = array('blocks' => implode('|', $blocks),
'show' => implode('|', $show),
'header' => 1,
'maxsize' => 140);
list($ret, $content) = GalleryEmbed::getImageBlock($params);
if ($content) {
$block['subject'] = t('gallery');
$block['content'] = $content;
}
GalleryEmbed::done();
}
GalleryEmbed::done();
break;
}
}
......
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