Skip to content

Commit

Permalink
bug 3024: Warning: array_merge(): Argument 1 is not an array on templ…
Browse files Browse the repository at this point in the history
…ate.class.php

git-svn-id: http://piwigo.org/svn/trunk@26863 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
mistic100 committed Jan 18, 2014
1 parent c1b07f9 commit 4a2ee2d
Showing 1 changed file with 28 additions and 12 deletions.
40 changes: 28 additions & 12 deletions include/template.class.php
Expand Up @@ -1159,12 +1159,20 @@ function parse_picture_buttons()
if (!empty($this->picture_buttons))
{
ksort($this->picture_buttons);
$this->assign('PLUGIN_PICTURE_BUTTONS',
array_reduce(
$this->picture_buttons,
create_function('$v,$w', 'return array_merge($v, $w);'),
array()
));
$buttons = array();
foreach ($this->picture_buttons as $k => $row)
{
$buttons = array_merge($buttons, $row);
}
$this->assign('PLUGIN_PICTURE_BUTTONS', $buttons);

// only for PHP 5.3
// $this->assign('PLUGIN_PICTURE_BUTTONS',
// array_reduce(
// $this->picture_buttons,
// create_function('$v,$w', 'return array_merge($v, $w);'),
// array()
// ));
}
}

Expand All @@ -1176,12 +1184,20 @@ function parse_index_buttons()
if (!empty($this->index_buttons))
{
ksort($this->index_buttons);
$this->assign('PLUGIN_INDEX_BUTTONS',
array_reduce(
$this->index_buttons,
create_function('$v,$w', 'return array_merge($v, $w);'),
array()
));
$buttons = array();
foreach ($this->index_buttons as $k => $row)
{
$buttons = array_merge($buttons, $row);
}
$this->assign('PLUGIN_INDEX_BUTTONS', $buttons);

// only for PHP 5.3
// $this->assign('PLUGIN_INDEX_BUTTONS',
// array_reduce(
// $this->index_buttons,
// create_function('$v,$w', 'return array_merge($v, $w);'),
// array()
// ));
}
}
}
Expand Down

0 comments on commit 4a2ee2d

Please sign in to comment.