diff options
author | mistic100 <mistic@piwigo.org> | 2014-01-18 15:12:44 +0000 |
---|---|---|
committer | mistic100 <mistic@piwigo.org> | 2014-01-18 15:12:44 +0000 |
commit | 9cff7f1781c2c8a606e8e8d58c540f1bebd3a2c6 (patch) | |
tree | efeb6977eadd1977c4c56fef4e73c4216ba6e598 | |
parent | df155ae9720ba2aa810a3e48af968b284072be2b (diff) |
Merged revision(s) r26863 from trunk:
bug 3024: Warning: array_merge(): Argument 1 is not an array on template.class.php
git-svn-id: http://piwigo.org/svn/branches/2.6@26864 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r-- | include/template.class.php | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/include/template.class.php b/include/template.class.php index 74a1eb36d..82aa21685 100644 --- a/include/template.class.php +++ b/include/template.class.php @@ -1159,12 +1159,20 @@ var s,after = document.getElementsByTagName(\'script\')[document.getElementsByTa 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() + // )); } } @@ -1176,12 +1184,20 @@ var s,after = document.getElementsByTagName(\'script\')[document.getElementsByTa 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() + // )); } } } |