4 |
## $Id$ |
## $Id$ |
5 |
## ----------------------------------------------------------------------------- |
## ----------------------------------------------------------------------------- |
6 |
## $Log$ |
## $Log$ |
7 |
|
## Revision 1.8 2003/04/18 13:31:48 jonen |
8 |
|
## + Now hidden elements could be given to the constructor as $args['hidden_elements'], |
9 |
|
## which is needed special for not-real object instancation in inhiterated child objects |
10 |
|
## (e.g. AbstractNavigationList, etc.) |
11 |
|
## + For real object instances at inhiterated objects |
12 |
|
## an api function 'add_hidden_element' could be used after this object is instanced |
13 |
|
## (e.g DataList, DataItem, etc.). |
14 |
|
## |
15 |
|
## Revision 1.7 2003/04/16 16:15:27 joko |
16 |
|
## behavior fix to 'function add_hidden_element': just calling 'add_hidden_element' on core instance of it provides this method |
17 |
|
## |
18 |
## Revision 1.6 2003/04/10 06:19:33 joko |
## Revision 1.6 2003/04/10 06:19:33 joko |
19 |
## minor fix: prevent use of undefined instance |
## minor fix: prevent use of undefined instance |
20 |
## |
## |
70 |
* variable thats holds the reference to phphtmllib GUI object |
* variable thats holds the reference to phphtmllib GUI object |
71 |
*/ |
*/ |
72 |
var $_gui_object; |
var $_gui_object; |
73 |
|
|
74 |
/** |
/** |
75 |
* the contructor |
* the contructor |
76 |
|
* hidden elements could be given to the constructor as $args['hidden_elements'], |
77 |
|
* which is needed special for not-real object instancation in inhiterated child objects |
78 |
|
* (e.g. AbstractNavigationList, etc.) |
79 |
* |
* |
80 |
* @params struct - the arguments |
* @params struct - the arguments |
81 |
*/ |
*/ |
82 |
function WebExplorer_Module_AbstractGUIModule($args = array()) { |
function WebExplorer_Module_AbstractGUIModule($args = array()) { |
83 |
$this->_args = $args; |
$this->_args = $args; |
84 |
|
|
85 |
//print Dumper($this->_gui_object); |
//print Dumper($this->_gui_object); |
86 |
$this->set_gui_object(); |
$this->set_gui_object(); |
87 |
} |
} |
93 |
return $msg; |
return $msg; |
94 |
} |
} |
95 |
|
|
96 |
|
/** |
97 |
function add_hidden_items($items) { |
* Api function to add hidden elements instead or in addtion to |
98 |
foreach($items as $label => $value) { |
* at constructor given hidden elements. |
99 |
$this->add_hidden_element($label, $value); |
* Note: All hidden elements *must* be loaded *before* $this->get() |
100 |
} |
* is initiated! |
101 |
|
* |
102 |
|
*/ |
103 |
|
function add_hidden_element($label, $value) { |
104 |
|
$this->_args['hidden_elements'][$label] = $value; |
105 |
} |
} |
106 |
|
|
107 |
|
|
108 |
function add_hidden_element($label, $value) { |
function _add_hidden_element($label, $value) { |
109 |
// TODO: review this! |
// TODO: review this! |
110 |
if (!$this->_gui_object) { return; } |
if (!$this->_gui_object) { return; } |
111 |
//print "Label: $label => $value<br>"; |
//print "Label: $label => $value<br>"; |
112 |
$this->_gui_object->add_hidden_element($label, $value); |
|
113 |
|
// fixed: (alpha, maybe this doesn't work out well...) |
114 |
|
if (method_exists($this->_gui_object, 'add_hidden_element')) { |
115 |
|
$this->_gui_object->add_hidden_element($label, $value); |
116 |
|
} |
117 |
} |
} |
118 |
|
|
119 |
|
|
120 |
function &get() { |
function &get() { |
121 |
|
if(is_array($this->_args['hidden_elements'])) { |
122 |
|
foreach($this->_args['hidden_elements'] as $label => $value) { |
123 |
|
$this->_add_hidden_element($label, $value); |
124 |
|
} |
125 |
|
} |
126 |
|
|
127 |
if($this->_args['adapter']) { |
if($this->_args['adapter']) { |
128 |
return $this->mungle_adapter($this->_args['adapter']); |
return $this->mungle_adapter($this->_args['adapter']); |
129 |
} else { |
} else { |