/[cvs]/nfo/php/libs/org.netfrag.patches/phphtmllib/widgets/SelectNav.inc
ViewVC logotype

Annotation of /nfo/php/libs/org.netfrag.patches/phphtmllib/widgets/SelectNav.inc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations)
Fri Apr 18 13:53:05 2003 UTC (21 years, 5 months ago) by joko
Branch: MAIN
from com.newsblob.phphtmllib/widgets

1 joko 1.1 <?php
2     /*
3     ## -------------------------------------------------------------------------
4     ## $Id: SelectNav.inc,v 1.3 2003/03/01 04:54:14 joko Exp $
5     ## -------------------------------------------------------------------------
6     ## $Log: SelectNav.inc,v $
7     ## Revision 1.3 2003/03/01 04:54:14 joko
8     ## - purged old code
9     ##
10     ## Revision 1.2 2003/02/28 04:24:17 joko
11     ## disabled benchmarking
12     ## - purged old code
13     ##
14     ## Revision 1.1 2003/02/27 16:57:36 joko
15     ## + initial commit, inherits from BaseWidget, uses pear-bridge
16     ##
17     ## -------------------------------------------------------------------------
18     */
19    
20    
21    
22     // This is a phpHtmlLib extension class implementing nested trees.
23    
24     // It inherits from phpHtmlLib's BaseWidget to be transparently spooled
25     // down when rendering (->render!).
26    
27     // It uses phpHtmlLib::TreeNav::PearHtmlTreeMenuBridge to access
28     // some fine component libraries from PEAR to get things done.
29    
30     // Please also visit its sister class phpHtmlLib::TreeNav::DHTMLTreeNav,
31     // which displays a navigatable tree (expand, collapse) using JavaScript.
32    
33    
34     class SelectNav extends BaseWidget {
35    
36     var $pearbridge;
37     var $menuobject;
38    
39     function SelectNav(&$payload) {
40    
41     $args[payload] = &$payload;
42     $args[type] = 'Listbox';
43     $this->pearbridge = new TreeNav_PearHtmlTreeMenuBridge(&$args);
44     $this->menuobject = $this->pearbridge->getMenuObject();
45    
46     // initialize output the phpHtmlLib way
47     $this->_init_output();
48    
49     }
50    
51    
52     function _init_output() {
53    
54     // pre-flight check
55     if (!$this->menuobject) {
56     return;
57     }
58    
59     $this->add('<script src="inc/js/TreeMenu.js" language="JavaScript" type="text/javascript"></script>');
60    
61     /*
62     // benchmarking - before
63     $this->add('
64     <script language="JavaScript" type="text/javascript">
65     <!--
66     a = new Date();
67     a = a.getTime();
68     //-->
69     </script>
70     ');
71     */
72    
73     $this->add($this->menuobject->toHTML());
74    
75     /*
76     // benchmarking - afterwards
77     $this->add('
78     <script language="JavaScript" type="text/javascript">
79     <!--
80     b = new Date();
81     b = b.getTime();
82    
83     document.write("Time to render tree: " + ((b - a) / 1000) + "s");
84     //-->
85     </script>
86     ');
87     */
88    
89     }
90    
91     }
92    
93     ?>

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