/[cvs]/nfo/php/libs/org.netfrag.app/WebExplorer/Module/AbstractGUIModule.php
ViewVC logotype

Contents of /nfo/php/libs/org.netfrag.app/WebExplorer/Module/AbstractGUIModule.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations)
Mon Apr 7 22:29:27 2003 UTC (21 years, 5 months ago) by jonen
Branch: MAIN
Changes since 1.4: +13 -5 lines
+ minor changes

1 <?
2 /*
3 ## -----------------------------------------------------------------------------
4 ## $Id: AbstractGUIModule.php,v 1.4 2003/04/05 21:17:51 joko Exp $
5 ## -----------------------------------------------------------------------------
6 ## $Log: AbstractGUIModule.php,v $
7 ## Revision 1.4 2003/04/05 21:17:51 joko
8 ## extends Class::Abstract (for being able to call '_abstract_method' on it)
9 ##
10 ## Revision 1.3 2003/04/04 00:56:08 jonen
11 ## + add 'mungle_adapter' function
12 ##
13 ## Revision 1.2 2003/03/20 07:56:18 jonen
14 ## + added docu
15 ##
16 ## Revision 1.1 2003/03/20 03:49:22 jonen
17 ## + initial commit
18 ##
19 ## Revision 1.1 2003/03/01 22:57:23 cvsmax
20 ## + inital commit
21 ##
22 ##
23 ## -----------------------------------------------------------------------------
24 */
25
26
27 /**
28 * required only for $this->_abstract_method({methodname})
29 * can later be used or not without any problems or further
30 * dependencies since this is an abstract base class at the
31 * very top of the inheritance hierarchy.
32 *
33 */
34 loadModule('Class::Abstract');
35
36 /**
37 * AbstractGUIModule class provides an simple way to create new modules
38 * for the Explorer, eg navigation or data browsing elements.
39 *
40 * @author Sebastian Utz <seut@tunemedia.de>
41 * @package org.netfrag.app
42 * @name WebExplorer::Module::AbstractModule
43 */
44 class WebExplorer_Module_AbstractGUIModule extends Class_Abstract {
45
46
47 /**
48 * most modules needs arguments e.g. data_locator_key, caption etc.
49 */
50 var $_args = array();
51
52 /**
53 * variable thats holds the reference to phphtmllib GUI object
54 */
55 var $_gui_object;
56
57 /**
58 * the contructor
59 *
60 * @params struct - the arguments
61 */
62 function WebExplorer_Module_AbstractGUIModule($args = array()) {
63 $this->_args = $args;
64
65 //print Dumper($this->_gui_object);
66 $this->set_gui_object();
67 }
68
69
70 function set_gui_object() {
71 $msg = "AbstractGUIModule::get_gui_object() - Child must override";
72 user_error($msg);
73 return $msg;
74 }
75
76
77 function add_hidden_items($items) {
78 foreach($items as $label => $value) {
79 $this->add_hidden_element($label, $value);
80 }
81 }
82
83
84 function add_hidden_element($label, $value) {
85 //print "Label: $label => $value<br>";
86 $this->_gui_object->add_hidden_element($label, $value);
87 }
88
89
90 function &get() {
91 if($this->_args['adapter']) {
92 return $this->mungle_adapter($this->_args['adapter']);
93 } else {
94 return $this->_gui_object;
95 }
96 }
97
98 function mungle_adapter($label) {
99 return php::mkInstance($label, array(&$this->_gui_object));
100 }
101
102
103 }
104
105 ?>

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