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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Wed Jul 7 02:38:45 2004 UTC (20 years, 2 months ago) by joko
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +14 -12 lines
now independent of Data::Lift

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

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