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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations)
Tue May 13 16:30:37 2003 UTC (21 years, 4 months ago) by joko
Branch: MAIN
Changes since 1.1: +85 -41 lines
using built-in structure reader

1 joko 1.1 <?php
2 joko 1.2 /**
3     * This file contains the TreeNav_PearHtmlTreeMenuBridge class.
4     *
5     * @author Andreas Motl <andreas.motl@ilo.de>
6     * @package org.netfrag.patches
7     * @name TreeNav::PearHtmlTreeMenuBridge
8     *
9     */
10    
11     /**
12     * Cvs-Log:
13     *
14     * $Id: Generic.php,v 1.19 2003/04/18 15:40:51 joko Exp $
15     *
16     * $Log: Generic.php,v $
17     * Revision 1.1 2003/04/18 13:53:05 joko
18     * from com.newsblob.phphtmllib/widgets
19     *
20     * Revision 1.2 2003/02/27 16:55:51 joko
21     * + fixed comment ;-)
22     *
23     * Revision 1.1 2003/02/27 16:55:08 joko
24     * + initial commit, bridges phpHtmlLib and PEAR::HTML::TreeMenu
25     *
26     */
27    
28     /**
29     * TreeNav::PearHtmlTreeMenuBridge
30     *
31     * This is a phpHtmlLib extension class handling nested trees.
32     *
33     * It acts as an intermediate bridging layer between PEAR::Tree holding the
34     * tree data structure and PEAR's HTML_TreeMenu Class displaying it.
35     *
36     * PEAR::Tree has been written by Wolfram Kriesing <wolfram@kriesing.de>
37     * - http://opensource.visionp.de/modules/project/tree.php
38     * - http://pear.php.net/package-info.php?pacid=104
39     *
40     * The Authors of the HTML_TreeMenu Class are Richard Heyes <richard@phpguru.org>
41     * and Harald Radi <harald.radi@nme.at>, please visit:
42     * - http://phpguru.org/treemenu.php
43     * - http://pear.php.net/package-info.php?pacid=77
44     *
45     *
46     * PEAR::HTML::TreeMenu offers two rendering modes by now:
47     * - DHTML: show nested deep tree in explorer like style
48     * - Listbox: flatten tree into options of a html "select" form element
49     *
50     * All data conversion between these single stages is done using Data::Lift...
51     * e.g.:
52     * 1. php hash -> PEAR::Tree -> PEAR::HTML::TreeMenu ->
53     * PEAR::HTML::TreeMenu::DHTML -> phpHtmlLib::DHTMLTreeNav
54     * 2. php hash -> PEAR::Tree -> PEAR::HTML::TreeMenu ->
55     * PEAR::HTML::TreeMenu::Listbox -> phpHtmlLib::SelectNav
56     *
57     *
58     * @author Andreas Motl <andreas.motl@ilo.de>
59     * @copyright (c) 2003 - All Rights reserved.
60     * @license GNU LGPL (GNU Lesser General Public License)
61     *
62     * @link http://www.netfrag.org/~joko/
63     * @link http://www.gnu.org/licenses/lgpl.txt
64     *
65     * @package org.netfrag.patches
66     * @subpackage phphtmllib::widgets
67     * @name TreeNav::PearHtmlTreeMenuBridge
68     *
69     * @link http://cvs.netfrag.org/php/libs/org.netfrag.patches
70     *
71     */
72 joko 1.1 class TreeNav_PearHtmlTreeMenuBridge {
73    
74     var $payload;
75     var $lift;
76     var $menuobject;
77    
78     function TreeNav_PearHtmlTreeMenuBridge(&$args) {
79    
80     $this->payload = &$args[payload];
81     $this->type = $args[type];
82 joko 1.2 $this->converter = $args[converter];
83 joko 1.1
84     if (!$this->type) {
85     print get_class($this) . ": Please specify 'type'<br/>";
86     return;
87     }
88    
89     //$this->_init_tree_example();
90     //$this->_init_tree_live();
91     //$this->_init_tree_fromPayload();
92    
93 joko 1.2 $options = array( converter => $this->converter );
94    
95     // lift PEAR::Tree object to PEAR::HTML::TreeMenu::DHTML object ...
96     //$this->lift = mkObject('Data::Lift', $this->payload);
97     $this->lift = mkObject('Data::Lift', $this->payload, $options);
98    
99 joko 1.1 $handler_name = $this->type;
100 joko 1.2 $this->menuobject = $this->lift->to("PEAR::HTML::TreeMenu::$handler_name");
101    
102     // ... using HTML::TreeMenu::createFromStructure( ... )
103     if ($this->converter == 'builtin.kriesing') {
104    
105     // ... using own code
106     } else {
107     }
108 joko 1.1
109     }
110    
111     function getMenuObject() {
112     return $this->menuobject;
113     }
114    
115     }
116    
117     ?>

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