/[cvs]/nfo/php/libs/com.newsblob.phphtmllib/widgets/TreeNav.inc
ViewVC logotype

Diff of /nfo/php/libs/com.newsblob.phphtmllib/widgets/TreeNav.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by jonen, Thu Jan 30 03:29:44 2003 UTC revision 1.2 by jonen, Fri Jan 31 08:48:45 2003 UTC
# Line 49  class TreeNav extends BaseWidget { Line 49  class TreeNav extends BaseWidget {
49    }    }
50    
51    function push_text( $text, $selected=FALSE ) {    function push_text( $text, $selected=FALSE ) {
52        if (is_array($text)) {
53          foreach($text as $value) {
54            $this->push_text($value);
55          }
56        }
57        else {
58        array_push($this->data, array( "type"=>"text", "text"=>$text,        array_push($this->data, array( "type"=>"text", "text"=>$text,
59                                       "selected" => $selected ));                                       "selected" => $selected ));
60        }
61    }    }
62    
63    /**    /**
# Line 71  class TreeNav extends BaseWidget { Line 78  class TreeNav extends BaseWidget {
78    
79        $td = new TDtag;        $td = new TDtag;
80        $td->newline_after_opentag = FALSE;        $td->newline_after_opentag = FALSE;
81        $img =  html_img("/phphtmllib/widgets/images/arrow.gif", 9, 9);        $img =  html_img("img/widgets/arrow.gif", 9, 9);
82        $img->set_tag_attributes( array("vspace"=>5, "hspace"=>3));        $img->set_tag_attributes( array("vspace"=>5, "hspace"=>3));
83        $img->indent_flag = FALSE;        $img->indent_flag = FALSE;
84        $img->newline_after_opentag = FALSE;        $img->newline_after_opentag = FALSE;
# Line 106  class TreeNav extends BaseWidget { Line 113  class TreeNav extends BaseWidget {
113                            "class" => "treenavspacer");                            "class" => "treenavspacer");
114        $td = new TDtag( $attributes );        $td = new TDtag( $attributes );
115        $td->newline_after_opentag = FALSE;        $td->newline_after_opentag = FALSE;
116        $img =  html_img("/phphtmllib/widgets/images/spacer.gif", 1, 1);        $img =  html_img("img/widgets/spacer.gif", 1, 1);
117        $img->indent_flag = FALSE;        $img->indent_flag = FALSE;
118        $img->newline_after_opentag = FALSE;        $img->newline_after_opentag = FALSE;
119        $td->push( $img );        $td->push( $img );
# Line 127  class TreeNav extends BaseWidget { Line 134  class TreeNav extends BaseWidget {
134                             "class" => "treenavinnertable");                             "class" => "treenavinnertable");
135        $table = new TABLEtag( $attributes );        $table = new TABLEtag( $attributes );
136    
137        foreach( $this->data as $nav) {        $this->build_entries($this->data, $table);
138    
139          return $table;
140      }
141    
142      function build_entries($entries = '', &$table) {
143          if(!is_array($entries)) { $entries = $this->data; }
144          foreach( $entries as $nav) {
145            if(is_array($nav)) {
146              $this->build_entries($nav, $table);
147            }
148            else {
149              print $nav;
150            $img_td = $this->build_img_td();            $img_td = $this->build_img_td();
151            $link_td = $this->build_link_td( $nav );            $link_td = $this->build_link_td( $nav );
152    
# Line 135  class TreeNav extends BaseWidget { Line 154  class TreeNav extends BaseWidget {
154    
155            $spacer_td = $this->build_spacer_td();            $spacer_td = $this->build_spacer_td();
156            $table->push_row( $spacer_td );            $table->push_row( $spacer_td );
157            }
158        }        }
   
       return $table;  
159    }    }
160    
161    
   
162    /**    /**
163     * function that will render the widget.     * function that will render the widget.
164     *     *

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed