src/UI/HTML/Tree/Menu.php
protected function buildMenuRecursive( ADT_Tree_Menu_List $tree, $level = 1 )
	{
		$list	= array();
		foreach( $tree->getChildren() as $child )
		{
			$class		= $child->getAttributes()->get( 'class' );
			$label		= $child->label;
			if( !empty( $child->url ) )
				$label	= UI_HTML_Elements::Link( $child->url, $child->label, $class, $this->target );
			else
				$label	= UI_HTML_Tag::create( 'span', $child->label );

			$sublist	= "";
			if( $child->hasChildren() )
				$sublist	= "\n".$this->buildMenuRecursive( $child, $level+1 );
			$classes	= array( 'level-'.$level );
			if( $child->hasChildren() )
				$classes[]	= "parent";
			$class		= implode( " ", $classes );
			$list[]		= UI_HTML_Elements::ListItem( $label.$sublist, $level, array( 'class' => $class ) );
		}
		$list	= UI_HTML_Elements::unorderedList( $list, $level );
		return $list;
	}
protected function buildMenuRecursive( ADT_Tree_Menu_List $tree, $level = 1 )
	{
		$list	= array();
		foreach( $tree->getChildren() as $child )
		{
			$class		= $child->getAttributes()->get( 'class' );
			$label		= $child->label;
			if( !empty( $child->url ) )
				$label	= UI_HTML_Elements::Link( $child->url, $child->label, $class, $this->target );
			else
				$label	= UI_HTML_Tag::create( 'span', $child->label );

			$sublist	= "";
			if( $child->hasChildren() )
				$sublist	= "\n".$this->buildMenuRecursive( $child, $level+1 );
			$classes	= array( 'level-'.$level );
			if( $child->hasChildren() )
				$classes[]	= "parent";
			$class		= implode( " ", $classes );
			$list[]		= UI_HTML_Elements::ListItem( $label.$sublist, $level, array( 'class' => $class ) );
		}
		$list	= UI_HTML_Elements::unorderedList( $list, $level );
		return $list;
	}
protected function buildMenuRecursive ( ADT_Tree_Menu_List $ tree , $ level = 1 ) { $ list = array ( ) ; foreach ( $ tree -> getChildren ( ) as $ child ) { $ class = $ child -> getAttributes ( ) -> get ( 'class' ) ; $ label = $ child -> label ; if ( ! empty ( $ child -> url ) ) $ label = UI_HTML_Elements :: Link ( $ child -> url , $ child -> label , $ class , $ this -> target ) ; else $ label = UI_HTML_Tag :: create ( 'span' , $ child -> label ) ; $ sublist = "" ; if ( $ child -> hasChildren ( ) ) $ sublist = "\n" . $ this -> buildMenuRecursive ( $ child , $ level + 1 ) ; $ classes = array ( 'level-' . $ level ) ; if ( $ child -> hasChildren ( ) ) $ classes [ ] = "parent" ; $ class = implode ( " " , $ classes ) ; $ list [ ] = UI_HTML_Elements :: ListItem ( $ label . $ sublist , $ level , array ( 'class' => $ class ) ) ; } $ list = UI_HTML_Elements :: unorderedList ( $ list , $ level ) ; return $ list ; }
Builds Tree Menu from Tree Menu Structure.
@access		protected
@static
@param		ADT_Tree_Menu_List	$list	Tree Menu Structure
@param		string				$parent	ID of parent Node
@param		array				$steps	List of Steps in Tree
@param		int					$level	Depth Level of Tree
@return		string
Builds Tree Menu from Tree Menu Structure .