4 |
## $Id$ |
## $Id$ |
5 |
## ----------------------------------------------------------------------------- |
## ----------------------------------------------------------------------------- |
6 |
## $Log$ |
## $Log$ |
7 |
|
## Revision 1.5 2003/03/27 01:24:29 jonen |
8 |
|
## + enabled navigation ecom (only list yet) |
9 |
|
## |
10 |
|
## Revision 1.4 2003/03/20 08:02:11 jonen |
11 |
|
## + purged code |
12 |
|
## |
13 |
|
## Revision 1.3 2003/03/20 07:54:52 jonen |
14 |
|
## + added docu |
15 |
|
## |
16 |
|
## Revision 1.2 2003/03/20 07:44:31 jonen |
17 |
|
## + removed dumper |
18 |
|
## |
19 |
## Revision 1.1 2003/03/20 03:48:46 jonen |
## Revision 1.1 2003/03/20 03:48:46 jonen |
20 |
## + initial commit |
## + initial commit |
21 |
## |
## |
38 |
## ----------------------------------------------------------------------------- |
## ----------------------------------------------------------------------------- |
39 |
*/ |
*/ |
40 |
|
|
41 |
|
/** |
42 |
|
* WebExplorer::AbstractExplorer - this can be simple compared to a container, |
43 |
|
* which modular GUI classes can be register, manipulated and rendered... |
44 |
|
* |
45 |
|
* @author Sebastian Utz <seut@tunemedia.de> |
46 |
|
* @package org.netfrag.app |
47 |
|
* @name WebExplorer::AbstractExplorer |
48 |
|
*/ |
49 |
|
|
50 |
|
|
51 |
class WebExplorer_AbstractExplorer { |
class WebExplorer_AbstractExplorer { |
52 |
|
|
75 |
*/ |
*/ |
76 |
var $_e_state = array(); |
var $_e_state = array(); |
77 |
|
|
|
// needed (old)? |
|
|
var $_control = array(); |
|
|
var $_hidden_elements = array(); |
|
|
|
|
78 |
|
|
79 |
function WebExplorer_AbstractExplorer($data_locators=array()) { |
function WebExplorer_AbstractExplorer($data_locators=array()) { |
80 |
$this->_data_locators = $data_locators; |
$this->_data_locators = $data_locators; |
81 |
$this->init_default_gui_modules(); |
$this->init_default_gui_modules(); |
82 |
|
|
83 |
$this->set_e_state(); |
$this->set_e_state(); |
84 |
print "State: " . Dumper($this->_state) ."<br>"; |
//print "State: " . Dumper($this->_state) ."<br>"; |
85 |
print "E_State: " . Dumper($this->_e_state) ."<br>"; |
print "Explorer_State: " . Dumper($this->_e_state) ."<br>"; |
86 |
//$this->init_state(); |
//$this->init_state(); |
87 |
} |
} |
88 |
|
|
124 |
|
|
125 |
function init_default_gui_modules() { |
function init_default_gui_modules() { |
126 |
//$this->register_gui_module("n_tree", "nav", array( 'name' => "NavigationTree", 'type' => "tree") ); |
//$this->register_gui_module("n_tree", "nav", array( 'name' => "NavigationTree", 'type' => "tree") ); |
127 |
$this->register_gui_module("list", "nav", array( 'name' => "NavigationList", 'type' => "list") ); |
$this->register_gui_module("list", "nav", array( 'name' => "WebExplorer::Module::NavigationList", 'type' => "list") ); |
128 |
$this->register_gui_module("list", "data", array( 'name' => "WebExplorer::Module::DataList", 'type' => "list") ); |
$this->register_gui_module("list", "data", array( 'name' => "WebExplorer::Module::DataList", 'type' => "list") ); |
129 |
$this->register_gui_module("item", "data", array( 'name' => "WebExplorer::Module::DataItem", 'type' => "item") ); |
$this->register_gui_module("item", "data", array( 'name' => "WebExplorer::Module::DataItem", 'type' => "item") ); |
130 |
} |
} |
172 |
|
|
173 |
// add hidden vars, needed for explorer control |
// add hidden vars, needed for explorer control |
174 |
$hidden_items = $this->_get_hidden_items($label); |
$hidden_items = $this->_get_hidden_items($label); |
175 |
$ecom->add_hidden_items($hidden_items); |
if(is_array($hidden_items) ) { $ecom->add_hidden_items($hidden_items); } |
176 |
//print "Hidden: " . Dumper($gui_ecom->_hidden_items); |
//print "Hidden: " . Dumper($gui_ecom->_hidden_items); |
177 |
|
|
178 |
$this->_ecom[$label] = &$gui_ecom; |
$this->_ecom[$label] = &$gui_ecom; |
180 |
|
|
181 |
function _get_hidden_items($label) { |
function _get_hidden_items($label) { |
182 |
$ecom_state = $this->_e_state['ecoms'][$label]; |
$ecom_state = $this->_e_state['ecoms'][$label]; |
183 |
if($ecom_state['ecom_abstract_type'] == "list") { |
if($ecom_state['ecom_type'] == "data") { |
184 |
$hidden_items = array( |
if($ecom_state['ecom_abstract_type'] == "list") { |
185 |
|
$hidden_items = array( |
186 |
'ecl' => $label, |
'ecl' => $label, |
187 |
); |
); |
188 |
|
} |
189 |
|
// set default hidden item for whole explorer |
190 |
|
$hidden_items['ap'] = "explorer"; |
191 |
} |
} |
|
// set default hidden item for whole explorer |
|
|
$hidden_items['ap'] = "explorer"; |
|
192 |
return $hidden_items; |
return $hidden_items; |
193 |
} |
} |
194 |
|
|
195 |
function _prepare_component_args($label) { |
function _prepare_component_args($label) { |
196 |
$val = $this->_e_state['ecoms'][$label]; |
$val = $this->_e_state['ecoms'][$label]; |
197 |
$this->set_data_locator($val['ecom_data_locator_key']); |
$this->set_data_locator($val['ecom_data_locator_key']); |
198 |
if($val['ecom_abstract_type'] == "list") { |
// switch component type |
199 |
if($val['ecom_data_locator_key'] == "rpc") { |
if($val['ecom_type'] == "data") { |
200 |
$data_locator_meta = array( datasource => 'rpc', metatype => 'data', vartype => 'objects', classname => $val['ecom_data_ident']); |
// switch abstract type |
201 |
} else { |
if($val['ecom_abstract_type'] == "list") { |
202 |
user_error("AbstractExplorer::_prepare_component_args - Cannot build query for data_locator_key $val[ecom_data_locator_key] !"); |
if($val['ecom_data_locator_key'] == "rpc") { |
203 |
} |
//$data_locator_meta = array( datasource => 'rpc', metatype => 'data', vartype => 'objects', classname => $val['ecom_data_ident']); |
204 |
$args = array( |
$data_locator_meta = array( datasource => 'rpc', metatype => 'data', abstract_type => 'list', classname => $val['ecom_data_ident']); |
205 |
|
} else { |
206 |
|
user_error("AbstractExplorer::_prepare_component_args - Cannot build query for data_locator_key $val[ecom_data_locator_key] !"); |
207 |
|
} |
208 |
|
$args = array( |
209 |
'caption' => "Liste", |
'caption' => "Liste", |
210 |
'orderby' => "Guid", |
'orderby' => "Guid", |
211 |
'options' => array( |
'options' => array( |
217 |
), |
), |
218 |
), |
), |
219 |
); |
); |
220 |
} elseif ($ecom_type == "item") { |
// switch abstract type |
221 |
$args = array(); |
} elseif ($val['ecom_abstract_type'] == "item") { |
222 |
} elseif ($ecom_type == "nav") { |
$args = array(); |
223 |
$args = array(); |
} |
224 |
|
// switch component type |
225 |
|
} elseif ($val['ecom_type'] == "nav") { |
226 |
|
// switch abstract type |
227 |
|
if($val['ecom_abstract_type'] == "list") { |
228 |
|
if($val['ecom_data_locator_key'] == "rpc") { |
229 |
|
$data_locator_meta = array( datasource => 'rpc', metatype => 'schema' ); |
230 |
|
} else { |
231 |
|
user_error("AbstractExplorer::_prepare_component_args - Cannot build query for data_locator_key $val[ecom_data_locator_key] !"); |
232 |
|
} |
233 |
|
$args = array( |
234 |
|
'caption' => "Objekt Typen", |
235 |
|
'options' => array( |
236 |
|
'data_locator_meta' => $data_locator_meta, |
237 |
|
), |
238 |
|
); |
239 |
|
} elseif ($val['ecom_abstract_type'] == "tree") { |
240 |
|
$args = array(); |
241 |
|
} |
242 |
} |
} |
243 |
return $args; |
return $args; |
244 |
} |
} |