static function indentList($tree, &$list, $indent = 0) { $list[] = array($tree['id'], str_repeat(' ', $indent) . ($indent > 0 ? '-' : '') . $tree['name'] . ' (#' . $tree['id'] . ')'); if (isset($tree['children'])) { foreach ($tree['children'] as $id => $co) { ItemGroupHandler::indentList($co, $list, $indent + 1); } } return $list; }