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

Contents of /nfo/php/libs/com.newsblob.phphtmllib/widgets/DHTMLTreeNav.inc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Fri Feb 28 04:24:17 2003 UTC (21 years, 6 months ago) by joko
Branch: MAIN
Changes since 1.1: +17 -24 lines
disabled benchmarking
- purged old code

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

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