foreach ( $children as $child )
{
$text .= str_repeat( ' ', $level + 2 );
$path = $this->formatPath( $child );
$data = $this->formatData( $child[1], in_array( $child[0], $this->options->highlightNodeIds ) );
protected function formatPath( $child )
{
$path = $child[2]->nodes;
if ( !$this->options->displayRootNode )
{
array_shift( $path );
}
if ( $this->options->selectedNodeLink )
{
$slice = array_slice( $path, -1 );
$path = htmlspecialchars( $this->options->basePath . '/' . array_pop( $slice ) );
}
else
{
$path = htmlspecialchars( $this->options->basePath . '/' . join( '/', $path ) );
}
return $path;
}