| 4 |
* $Id$ |
* $Id$ |
| 5 |
* |
* |
| 6 |
* $Log$ |
* $Log$ |
| 7 |
|
* Revision 1.5 2003/04/05 21:18:29 joko |
| 8 |
|
* added Chooser and associated 'ecds'-parameter |
| 9 |
|
* new rule (at bottom) to dispatch datasource-keys to each ecom-component |
| 10 |
|
* |
| 11 |
* Revision 1.4 2003/04/04 23:59:19 jonen |
* Revision 1.4 2003/04/04 23:59:19 jonen |
| 12 |
* + minor changes according to data form submits |
* + minor changes according to data form submits |
| 13 |
* |
* |
| 75 |
|
|
| 76 |
$this->add_model( array( |
$this->add_model( array( |
| 77 |
//args => array( 'classname', 'guid', 'action', 'data_locator_key', 'block' ), |
//args => array( 'classname', 'guid', 'action', 'data_locator_key', 'block' ), |
| 78 |
request_args => array( 'ap', 'ecom_label', 'ecom_type', 'ecom_abstract_type', 'ecom_mode', 'ecom_data_locator_key', |
request_args => array( |
| 79 |
'ecom_data_ident', 'ecom_data_meta', 'ecom_data_form_edit', 'ecom_data_form_cancel' ), |
// ApplicationPage |
| 80 |
|
'ap', |
| 81 |
|
// important/required parameters for valid ecom-components |
| 82 |
|
'ecom_label', 'ecom_type', 'ecom_abstract_type', 'ecom_mode', |
| 83 |
|
// parameters about data identifiers, locations, sources and associated meta-information |
| 84 |
|
'ecom_data_locator_key', |
| 85 |
|
'ecom_data_ident', |
| 86 |
|
'ecom_data_meta', |
| 87 |
|
'ecom_data_form_edit', 'ecom_data_form_cancel', |
| 88 |
|
'ecom_data_source_key' |
| 89 |
|
), |
| 90 |
request_arg => array( |
request_arg => array( |
| 91 |
'ap' => array( query_arg => 'ap' ), |
'ap' => array( query_arg => 'ap' ), |
| 92 |
'ecom_label' => array( query_arg => 'ecl' ), |
'ecom_label' => array( query_arg => 'ecl' ), |
| 98 |
'ecom_data_meta' => array( query_arg => 'ecdm' ), |
'ecom_data_meta' => array( query_arg => 'ecdm' ), |
| 99 |
'ecom_data_form_edit' => array( query_arg => 'ecdfe' ), |
'ecom_data_form_edit' => array( query_arg => 'ecdfe' ), |
| 100 |
'ecom_data_form_cancel' => array( query_arg => 'ecdfc' ), |
'ecom_data_form_cancel' => array( query_arg => 'ecdfc' ), |
| 101 |
|
'ecom_data_source_key' => array( query_arg => 'ecds' ), |
| 102 |
), |
), |
| 103 |
|
|
| 104 |
/* |
/* |
| 151 |
// Enhance this backend and introduce a mechanism to trigger |
// Enhance this backend and introduce a mechanism to trigger |
| 152 |
// a true callback to process a rule (or: "as a rule") on top of that. |
// a true callback to process a rule (or: "as a rule") on top of that. |
| 153 |
$this->add_controller( array( |
$this->add_controller( array( |
| 154 |
|
|
| 155 |
// for "module", no component registry is required, just does 'mkObject' under the hood |
// for "module", no component registry is required, just does 'mkObject' under the hood |
| 156 |
module => 'Application::Request::HttpController', |
module => 'Application::Request::HttpController', |
| 157 |
rules => array( |
rules => array( |
| 172 |
$_out = $pre_out; |
$_out = $pre_out; |
| 173 |
'), |
'), |
| 174 |
|
|
|
|
|
| 175 |
// rewrite idents |
// rewrite idents |
| 176 |
create_function('&$_in, &$_out', ' |
create_function('&$_in, &$_out', ' |
| 177 |
$idents = array ( ap, ); |
$idents = array ( ap, ); |
| 198 |
return; |
return; |
| 199 |
'), |
'), |
| 200 |
|
|
| 201 |
// create default ecoms (navigation, etc.) |
// create default ecoms (navigation, chooser [as of 2003-04-05] etc.) |
| 202 |
create_function('&$_in, &$_out', ' |
create_function('&$_in, &$_out', ' |
| 203 |
if(!$_out[options][ecoms] || !is_array($_out[options][ecoms])) { |
if(!$_out[options][ecoms] || !is_array($_out[options][ecoms])) { |
| 204 |
$_out[options][ecoms] = array( |
$_out[options][ecoms] = array( |
| 208 |
ecom_mode => "nav", |
ecom_mode => "nav", |
| 209 |
ecom_data_locator_key => "rpc", |
ecom_data_locator_key => "rpc", |
| 210 |
), |
), |
| 211 |
|
chooser => array( |
| 212 |
|
ecom_type => "chooser", |
| 213 |
|
ecom_abstract_type => "list", |
| 214 |
|
ecom_mode => "nav", |
| 215 |
|
ecom_data_locator_key => "rpc", |
| 216 |
|
), |
| 217 |
); |
); |
| 218 |
} |
} |
| 219 |
//$_out[options][components] = $_in[components]; |
//$_out[options][components] = $_in[components]; |
| 227 |
if($_in[ecom_data_form_cancel]) { $_out[options][ecoms][$label][ecom_mode] = "view"; } |
if($_in[ecom_data_form_cancel]) { $_out[options][ecoms][$label][ecom_mode] = "view"; } |
| 228 |
'), |
'), |
| 229 |
|
|
| 230 |
|
// propagate datasources to ecoms |
| 231 |
|
// datasource-change requested? enhance logic here! |
| 232 |
|
// by now each ecom-component gets injected the very same |
| 233 |
|
// datasource if requested - otherwise everything will fall back to defaults |
| 234 |
|
create_function('&$_in, &$_out', ' |
| 235 |
|
if ($_in[ecom_data_source_key]) { |
| 236 |
|
//print Dumper($_out[options][ecoms]); |
| 237 |
|
//print "ds: " . $_in[ecom_data_source_key] . "<br/>"; |
| 238 |
|
/* |
| 239 |
|
foreach ($_out[options][ecoms] as $name => $ecom) { |
| 240 |
|
print "name: $name<br/>"; |
| 241 |
|
//$_out[options][sources][selected] = $_in[ecom_data_source]; |
| 242 |
|
$_out[options][ecoms][$name][ecom_data_source_key] = $_in[ecom_data_source_key]; |
| 243 |
|
} |
| 244 |
|
*/ |
| 245 |
|
$_out[options][main][ecom_data_source_key] = $_in[ecom_data_source_key]; |
| 246 |
|
} |
| 247 |
|
'), |
| 248 |
|
|
| 249 |
|
|
| 250 |
/* |
/* |
| 251 |
// translate value of argument "action" (olist => list.view, oedit => item.edit) |
// translate value of argument "action" (olist => list.view, oedit => item.edit) |
| 252 |
// action dispatcher |
// action dispatcher |