4 |
## $Id$ |
## $Id$ |
5 |
## ----------------------------------------------------------------------------- |
## ----------------------------------------------------------------------------- |
6 |
## $Log$ |
## $Log$ |
7 |
|
## Revision 1.6 2003/04/10 06:19:33 joko |
8 |
|
## minor fix: prevent use of undefined instance |
9 |
|
## |
10 |
|
## Revision 1.5 2003/04/07 22:29:27 jonen |
11 |
|
## + minor changes |
12 |
|
## |
13 |
|
## Revision 1.4 2003/04/05 21:17:51 joko |
14 |
|
## extends Class::Abstract (for being able to call '_abstract_method' on it) |
15 |
|
## |
16 |
## Revision 1.3 2003/04/04 00:56:08 jonen |
## Revision 1.3 2003/04/04 00:56:08 jonen |
17 |
## + add 'mungle_adapter' function |
## + add 'mungle_adapter' function |
18 |
## |
## |
29 |
## ----------------------------------------------------------------------------- |
## ----------------------------------------------------------------------------- |
30 |
*/ |
*/ |
31 |
|
|
32 |
|
|
33 |
|
/** |
34 |
|
* required only for $this->_abstract_method({methodname}) |
35 |
|
* can later be used or not without any problems or further |
36 |
|
* dependencies since this is an abstract base class at the |
37 |
|
* very top of the inheritance hierarchy. |
38 |
|
* |
39 |
|
*/ |
40 |
|
loadModule('Class::Abstract'); |
41 |
|
|
42 |
/** |
/** |
43 |
* AbstractGUIModule class provides an simple way to create new modules |
* AbstractGUIModule class provides an simple way to create new modules |
44 |
* for the Explorer, eg navigation or data browsing elements. |
* for the Explorer, eg navigation or data browsing elements. |
47 |
* @package org.netfrag.app |
* @package org.netfrag.app |
48 |
* @name WebExplorer::Module::AbstractModule |
* @name WebExplorer::Module::AbstractModule |
49 |
*/ |
*/ |
50 |
|
class WebExplorer_Module_AbstractGUIModule extends Class_Abstract { |
|
|
|
|
class WebExplorer_Module_AbstractGUIModule { |
|
51 |
|
|
52 |
|
|
53 |
/** |
/** |
68 |
function WebExplorer_Module_AbstractGUIModule($args = array()) { |
function WebExplorer_Module_AbstractGUIModule($args = array()) { |
69 |
$this->_args = $args; |
$this->_args = $args; |
70 |
|
|
|
$this->set_gui_object(); |
|
71 |
//print Dumper($this->_gui_object); |
//print Dumper($this->_gui_object); |
72 |
|
$this->set_gui_object(); |
73 |
} |
} |
74 |
|
|
75 |
|
|
76 |
function set_gui_object() { |
function set_gui_object() { |
77 |
user_error("AbstractGUIModule::set_gui_object() - Child must override"); |
$msg = "AbstractGUIModule::get_gui_object() - Child must override"; |
78 |
|
user_error($msg); |
79 |
|
return $msg; |
80 |
} |
} |
81 |
|
|
82 |
|
|
83 |
function add_hidden_items($items) { |
function add_hidden_items($items) { |
84 |
foreach($items as $label => $value) { |
foreach($items as $label => $value) { |
85 |
$this->add_hidden_item($label, $value); |
$this->add_hidden_element($label, $value); |
86 |
} |
} |
87 |
} |
} |
88 |
|
|
89 |
|
|
90 |
function add_hidden_item($label, $value) { |
function add_hidden_element($label, $value) { |
91 |
|
// TODO: review this! |
92 |
|
if (!$this->_gui_object) { return; } |
93 |
//print "Label: $label => $value<br>"; |
//print "Label: $label => $value<br>"; |
94 |
$this->_gui_object->add_hidden_element($label, $value); |
$this->_gui_object->add_hidden_element($label, $value); |
95 |
} |
} |
96 |
|
|
97 |
|
|
98 |
function &get() { |
function &get() { |
99 |
if($this->_args['adapter']) { |
if($this->_args['adapter']) { |
100 |
return $this->mungle_adapter($this->_args['adapter']); |
return $this->mungle_adapter($this->_args['adapter']); |
107 |
return php::mkInstance($label, array(&$this->_gui_object)); |
return php::mkInstance($label, array(&$this->_gui_object)); |
108 |
} |
} |
109 |
|
|
110 |
|
|
111 |
} |
} |
112 |
|
|
113 |
?> |
?> |