foreach ($tree as $row) { for ($i = 1; $i < $row->ns_level; $i++) { echo '-'; } echo $row->id . "\n"; } break; case 'siblings': if (!$collection) { echo "Error: no collection in use.\n"; break; } elseif (!$input[1]) { echo "Error: no node ID specified.\n"; break; } $tree = $ns->siblings($input[1]); if (!$tree) { echo 'Error: ' . $ns->error . "\n"; break; } foreach ($tree as $row) { echo $row->id . "\n"; } break; case 'roots': if (!$collection) { echo "Error: no collection in use.\n"; break; } $tree = $ns->getRoots(); if (!$tree) {