--- nfo/php/libs/com.newsblob.phphtmllib/widgets/TreeNav.inc 2003/01/31 08:48:45 1.2 +++ nfo/php/libs/com.newsblob.phphtmllib/widgets/TreeNav.inc 2003/02/03 15:58:25 1.3 @@ -2,7 +2,7 @@ /** * This contains the TreeNav widget * - * $Id: TreeNav.inc,v 1.2 2003/01/31 08:48:45 jonen Exp $ + * $Id: TreeNav.inc,v 1.3 2003/02/03 15:58:25 jonen Exp $ * * @author Walter A. Boring IV * @package phpHtmlLib @@ -48,16 +48,9 @@ array_push($this->data, array( "type"=>"blank" )); } - function push_text( $text, $selected=FALSE ) { - if (is_array($text)) { - foreach($text as $value) { - $this->push_text($value); - } - } - else { - array_push($this->data, array( "type"=>"text", "text"=>$text, + function push_text( $text, $selected=FALSE ) { + array_push($this->data, array( "type"=>"text", "text"=>$text, "selected" => $selected )); - } } /** @@ -134,28 +127,16 @@ "class" => "treenavinnertable"); $table = new TABLEtag( $attributes ); - $this->build_entries($this->data, $table); - - return $table; - } - - function build_entries($entries = '', &$table) { - if(!is_array($entries)) { $entries = $this->data; } - foreach( $entries as $nav) { - if(is_array($nav)) { - $this->build_entries($nav, $table); - } - else { - print $nav; + foreach( $this->data as $nav) { $img_td = $this->build_img_td(); - $link_td = $this->build_link_td( $nav ); + $link_td = $this->build_link_td( $nav); $table->push_row( $img_td, $link_td, " "); $spacer_td = $this->build_spacer_td(); $table->push_row( $spacer_td ); - } - } + } + return $table; }