4 |
## $Id$ |
## $Id$ |
5 |
## ----------------------------------------------------------------------------- |
## ----------------------------------------------------------------------------- |
6 |
## $Log$ |
## $Log$ |
7 |
|
## Revision 1.7 2003/04/16 16:15:27 joko |
8 |
|
## behavior fix to 'function add_hidden_element': just calling 'add_hidden_element' on core instance of it provides this method |
9 |
|
## |
10 |
|
## Revision 1.6 2003/04/10 06:19:33 joko |
11 |
|
## minor fix: prevent use of undefined instance |
12 |
|
## |
13 |
|
## Revision 1.5 2003/04/07 22:29:27 jonen |
14 |
|
## + minor changes |
15 |
|
## |
16 |
## Revision 1.4 2003/04/05 21:17:51 joko |
## Revision 1.4 2003/04/05 21:17:51 joko |
17 |
## extends Class::Abstract (for being able to call '_abstract_method' on it) |
## extends Class::Abstract (for being able to call '_abstract_method' on it) |
18 |
## |
## |
71 |
function WebExplorer_Module_AbstractGUIModule($args = array()) { |
function WebExplorer_Module_AbstractGUIModule($args = array()) { |
72 |
$this->_args = $args; |
$this->_args = $args; |
73 |
|
|
|
$this->set_gui_object(); |
|
74 |
//print Dumper($this->_gui_object); |
//print Dumper($this->_gui_object); |
75 |
|
$this->set_gui_object(); |
76 |
} |
} |
77 |
|
|
78 |
|
|
79 |
function set_gui_object() { |
function set_gui_object() { |
80 |
user_error("AbstractGUIModule::set_gui_object() - Child must override"); |
$msg = "AbstractGUIModule::get_gui_object() - Child must override"; |
81 |
|
user_error($msg); |
82 |
|
return $msg; |
83 |
} |
} |
84 |
|
|
85 |
|
|
86 |
function add_hidden_items($items) { |
function add_hidden_items($items) { |
87 |
foreach($items as $label => $value) { |
foreach($items as $label => $value) { |
88 |
$this->add_hidden_item($label, $value); |
$this->add_hidden_element($label, $value); |
89 |
} |
} |
90 |
} |
} |
91 |
|
|
92 |
|
|
93 |
function add_hidden_item($label, $value) { |
function add_hidden_element($label, $value) { |
94 |
|
// TODO: review this! |
95 |
|
if (!$this->_gui_object) { return; } |
96 |
//print "Label: $label => $value<br>"; |
//print "Label: $label => $value<br>"; |
97 |
$this->_gui_object->add_hidden_element($label, $value); |
|
98 |
|
// fixed: (alpha, maybe this doesn't work out well...) |
99 |
|
if (method_exists($this->_gui_object, 'add_hidden_element')) { |
100 |
|
$this->_gui_object->add_hidden_element($label, $value); |
101 |
|
} |
102 |
} |
} |
103 |
|
|
104 |
|
|
105 |
function &get() { |
function &get() { |
106 |
if($this->_args['adapter']) { |
if($this->_args['adapter']) { |
107 |
return $this->mungle_adapter($this->_args['adapter']); |
return $this->mungle_adapter($this->_args['adapter']); |
114 |
return php::mkInstance($label, array(&$this->_gui_object)); |
return php::mkInstance($label, array(&$this->_gui_object)); |
115 |
} |
} |
116 |
|
|
117 |
|
|
118 |
} |
} |
119 |
|
|
120 |
?> |
?> |