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

Annotation of /nfo/php/libs/com.newsblob.phphtmllib/widgets/TreeNav_PearHtmlTreeMenuBridge.inc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations)
Thu Feb 27 16:55:08 2003 UTC (21 years, 6 months ago) by joko
Branch: MAIN
+ initial commit, bridges phpHtmlLib and PEAR::HTML::MenuTree

1 joko 1.1 <?php
2     /*
3     ## -------------------------------------------------------------------------
4     ## $Id: bstatus_left.php,v 1.1 2003/02/20 22:39:13 joko Exp $
5     ## -------------------------------------------------------------------------
6     ## $Log: bstatus_left.php,v $
7     ## -------------------------------------------------------------------------
8     */
9    
10    
11    
12     // This is a phpHtmlLib extension class implementing nested trees.
13     // It uses PEAR::Tree to hold tree data and PEAR::HTML::TreeMenu to display it.
14     // PEAR::Tree:
15     // - http://opensource.visionp.de/modules/project/tree.php
16     // - http://pear.php.net/package-info.php?pacid=104
17     // PEAR::HTML::TreeMenu:
18     // - http://phpguru.org/treemenu.php
19     // - http://pear.php.net/package-info.php?pacid=77
20    
21     // PEAR::HTML::TreeMenu offers two rendering modes by now:
22     // - DHTML: show nested deep tree in explorer like style
23     // - Listbox: flatten tree into options of a html "select" form element
24    
25     // All data conversion between these single stages is done using Data::Lift...
26     // e.g.:
27     // 1. php hash -> PEAR::Tree -> PEAR::HTML::TreeMenu ->
28     // PEAR::HTML::TreeMenu::DHTML -> phpHtmlLib::DHTMLTreeNav
29     // 2. php hash -> PEAR::Tree -> PEAR::HTML::TreeMenu ->
30     // PEAR::HTML::TreeMenu::Listbox -> phpHtmlLib::SelectNav
31    
32    
33     class TreeNav_PearHtmlTreeMenuBridge {
34    
35     var $payload;
36     var $lift;
37     var $menuobject;
38    
39     function TreeNav_PearHtmlTreeMenuBridge(&$args) {
40    
41     $this->payload = &$args[payload];
42     $this->type = $args[type];
43    
44     if (!$this->type) {
45     print get_class($this) . ": Please specify 'type'<br/>";
46     return;
47     }
48    
49     //$this->_init_tree_example();
50     //$this->_init_tree_live();
51     //$this->_init_tree_fromPayload();
52    
53     $handler_name = $this->type;
54    
55     // lift PEAR::Tree object to PEAR::HTML::TreeMenu::DHTML object
56     $this->lift = mkObject('Data::Lift', $this->payload);
57     $this->menuobject = $this->lift->to("PEAR::HTML::TreeMenu::$handler_name");
58    
59     }
60    
61     function getMenuObject() {
62     return $this->menuobject;
63     }
64    
65     }
66    
67     ?>

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