4 |
## $Id$ |
## $Id$ |
5 |
## ----------------------------------------------------------------------------- |
## ----------------------------------------------------------------------------- |
6 |
## $Log$ |
## $Log$ |
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 |
## Revision 1.3 2003/04/04 00:56:08 jonen |
14 |
## + add 'mungle_adapter' function |
## + add 'mungle_adapter' function |
15 |
## |
## |
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 |
* AbstractGUIModule class provides an simple way to create new modules |
41 |
* for the Explorer, eg navigation or data browsing elements. |
* for the Explorer, eg navigation or data browsing elements. |
44 |
* @package org.netfrag.app |
* @package org.netfrag.app |
45 |
* @name WebExplorer::Module::AbstractModule |
* @name WebExplorer::Module::AbstractModule |
46 |
*/ |
*/ |
47 |
|
class WebExplorer_Module_AbstractGUIModule extends Class_Abstract { |
|
|
|
|
class WebExplorer_Module_AbstractGUIModule { |
|
48 |
|
|
49 |
|
|
50 |
/** |
/** |
65 |
function WebExplorer_Module_AbstractGUIModule($args = array()) { |
function WebExplorer_Module_AbstractGUIModule($args = array()) { |
66 |
$this->_args = $args; |
$this->_args = $args; |
67 |
|
|
|
$this->set_gui_object(); |
|
68 |
//print Dumper($this->_gui_object); |
//print Dumper($this->_gui_object); |
69 |
|
$this->set_gui_object(); |
70 |
} |
} |
71 |
|
|
72 |
|
|
73 |
function set_gui_object() { |
function set_gui_object() { |
74 |
user_error("AbstractGUIModule::set_gui_object() - Child must override"); |
$msg = "AbstractGUIModule::get_gui_object() - Child must override"; |
75 |
|
user_error($msg); |
76 |
|
return $msg; |
77 |
} |
} |
78 |
|
|
79 |
|
|
80 |
function add_hidden_items($items) { |
function add_hidden_items($items) { |
81 |
foreach($items as $label => $value) { |
foreach($items as $label => $value) { |
82 |
$this->add_hidden_item($label, $value); |
$this->add_hidden_element($label, $value); |
83 |
} |
} |
84 |
} |
} |
85 |
|
|
86 |
|
|
87 |
function add_hidden_item($label, $value) { |
function add_hidden_element($label, $value) { |
88 |
//print "Label: $label => $value<br>"; |
//print "Label: $label => $value<br>"; |
89 |
$this->_gui_object->add_hidden_element($label, $value); |
$this->_gui_object->add_hidden_element($label, $value); |
90 |
} |
} |
91 |
|
|
92 |
|
|
93 |
function &get() { |
function &get() { |
94 |
if($this->_args['adapter']) { |
if($this->_args['adapter']) { |
95 |
return $this->mungle_adapter($this->_args['adapter']); |
return $this->mungle_adapter($this->_args['adapter']); |
102 |
return php::mkInstance($label, array(&$this->_gui_object)); |
return php::mkInstance($label, array(&$this->_gui_object)); |
103 |
} |
} |
104 |
|
|
105 |
|
|
106 |
} |
} |
107 |
|
|
108 |
?> |
?> |