/[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.6 - (show annotations)
Thu Apr 10 06:19:33 2003 UTC (21 years, 5 months ago) by joko
Branch: MAIN
Changes since 1.5: +6 -1 lines
minor fix: prevent use of undefined instance

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

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