Fix for bug #2002 - EDIT PLAYLIST only shows one item no matter how many items are in the playlist

This commit is contained in:
paul 2006-11-21 20:08:26 +00:00
parent 0821cf18a0
commit e3fbd34a58

View file

@ -333,6 +333,7 @@ class uiPlaylist
public function getFlat($id) public function getFlat($id)
{ {
$this->flat = array();
$this->_plwalk($this->getPLArray($id)); $this->_plwalk($this->getPLArray($id));
if (count($this->flat) > 0) { if (count($this->flat) > 0) {
@ -350,7 +351,8 @@ class uiPlaylist
private function _plwalk($arr, $parent=0, $attrs=0) private function _plwalk($arr, $parent=0, $attrs=0)
{ {
$this->flat = array(); // Note: the array $this->flat needs to be initialized before
// this function is called.
foreach ($arr['children'] as $node => $sub) { foreach ($arr['children'] as $node => $sub) {
if ($sub['elementname']===UI_PL_ELEM_PLAYLIST) { if ($sub['elementname']===UI_PL_ELEM_PLAYLIST) {
$this->_plwalk($sub, $node, $sub['attrs']); $this->_plwalk($sub, $node, $sub['attrs']);