Changeset 26864


Ignore:
Timestamp:
Jan 18, 2014, 4:12:44 PM (10 years ago)
Author:
mistic100
Message:

Merged revision(s) r26863 from trunk:
bug 3024: Warning: array_merge(): Argument 1 is not an array on template.class.php

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.6/include/template.class.php

    r26718 r26864  
    11601160    {
    11611161      ksort($this->picture_buttons);
    1162       $this->assign('PLUGIN_PICTURE_BUTTONS',
    1163           array_reduce(
    1164             $this->picture_buttons,
    1165             create_function('$v,$w', 'return array_merge($v, $w);'),
    1166             array()
    1167           ));
     1162      $buttons = array();
     1163      foreach ($this->picture_buttons as $k => $row)
     1164      {
     1165        $buttons = array_merge($buttons, $row);
     1166      }
     1167      $this->assign('PLUGIN_PICTURE_BUTTONS', $buttons);
     1168     
     1169      // only for PHP 5.3
     1170      // $this->assign('PLUGIN_PICTURE_BUTTONS',
     1171          // array_reduce(
     1172            // $this->picture_buttons,
     1173            // create_function('$v,$w', 'return array_merge($v, $w);'),
     1174            // array()
     1175          // ));
    11681176    }
    11691177  }
     
    11771185    {
    11781186      ksort($this->index_buttons);
    1179       $this->assign('PLUGIN_INDEX_BUTTONS',
    1180           array_reduce(
    1181             $this->index_buttons,
    1182             create_function('$v,$w', 'return array_merge($v, $w);'),
    1183             array()
    1184           ));
     1187      $buttons = array();
     1188      foreach ($this->index_buttons as $k => $row)
     1189      {
     1190        $buttons = array_merge($buttons, $row);
     1191      }
     1192      $this->assign('PLUGIN_INDEX_BUTTONS', $buttons);
     1193     
     1194      // only for PHP 5.3
     1195      // $this->assign('PLUGIN_INDEX_BUTTONS',
     1196          // array_reduce(
     1197            // $this->index_buttons,
     1198            // create_function('$v,$w', 'return array_merge($v, $w);'),
     1199            // array()
     1200          // ));
    11851201    }
    11861202  }
Note: See TracChangeset for help on using the changeset viewer.