| 4 |
* $Id$ |
* $Id$ |
| 5 |
* |
* |
| 6 |
* $Log$ |
* $Log$ |
| 7 |
|
* Revision 1.4 2003/04/04 23:59:19 jonen |
| 8 |
|
* + minor changes according to data form submits |
| 9 |
|
* |
| 10 |
|
* Revision 1.3 2003/04/04 01:28:13 jonen |
| 11 |
|
* + added function to purge unwanted merged vars |
| 12 |
|
* + handle form submit's now |
| 13 |
|
* |
| 14 |
* Revision 1.2 2003/03/20 07:54:52 jonen |
* Revision 1.2 2003/03/20 07:54:52 jonen |
| 15 |
* + added docu |
* + added docu |
| 16 |
* |
* |
| 71 |
|
|
| 72 |
$this->add_model( array( |
$this->add_model( array( |
| 73 |
//args => array( 'classname', 'guid', 'action', 'data_locator_key', 'block' ), |
//args => array( 'classname', 'guid', 'action', 'data_locator_key', 'block' ), |
| 74 |
request_args => array( 'ap', 'ecom_label', 'ecom_type', 'ecom_abstract_type', 'ecom_action', 'ecom_data_locator_key', |
request_args => array( 'ap', 'ecom_label', 'ecom_type', 'ecom_abstract_type', 'ecom_mode', 'ecom_data_locator_key', |
| 75 |
'ecom_data_ident', 'ecom_data_meta' ), |
'ecom_data_ident', 'ecom_data_meta', 'ecom_data_form_edit', 'ecom_data_form_cancel' ), |
| 76 |
request_arg => array( |
request_arg => array( |
| 77 |
'ap' => array( query_arg => 'ap' ), |
'ap' => array( query_arg => 'ap' ), |
| 78 |
'ecom_label' => array( query_arg => 'ecl' ), |
'ecom_label' => array( query_arg => 'ecl' ), |
| 79 |
'ecom_type' => array( query_arg => 'ect' ), |
'ecom_type' => array( query_arg => 'ect' ), |
| 80 |
'ecom_abstract_type' => array( query_arg => 'ecat' ), |
'ecom_abstract_type' => array( query_arg => 'ecat' ), |
| 81 |
'ecom_action' => array( query_arg => 'ecac' ), |
'ecom_mode' => array( query_arg => 'ecmod' ), |
| 82 |
'ecom_data_locator_key' => array( query_arg => 'ecdlk' ), |
'ecom_data_locator_key' => array( query_arg => 'ecdlk' ), |
| 83 |
'ecom_data_ident' => array( query_arg => 'ecdid' ), |
'ecom_data_ident' => array( query_arg => 'ecdid' ), |
| 84 |
'ecom_data_meta' => array( query_arg => 'ecdm' ), |
'ecom_data_meta' => array( query_arg => 'ecdm' ), |
| 85 |
|
'ecom_data_form_edit' => array( query_arg => 'ecdfe' ), |
| 86 |
|
'ecom_data_form_cancel' => array( query_arg => 'ecdfc' ), |
| 87 |
), |
), |
| 88 |
|
|
| 89 |
/* |
/* |
| 144 |
create_function('&$_in, &$_out', ' |
create_function('&$_in, &$_out', ' |
| 145 |
$requestTracker = mkObject("Application::Request::Tracker"); |
$requestTracker = mkObject("Application::Request::Tracker"); |
| 146 |
$page_state = $requestTracker->getPointer(); |
$page_state = $requestTracker->getPointer(); |
| 147 |
$_out = $page_state[options]; |
$pre_out = $page_state[options]; |
| 148 |
|
//print Dumper($pre_out); |
| 149 |
|
// clean-up unwanted variables |
| 150 |
|
$label = $_in[ecom_label]; |
| 151 |
|
switch ($_in[ecom_abstract_type]) { |
| 152 |
|
case "list": |
| 153 |
|
if($pre_out[options][ecoms][$label][ecom_data_meta]) { unset($pre_out[options][ecoms][$label][ecom_data_meta]); } |
| 154 |
|
break; |
| 155 |
|
} |
| 156 |
|
$_out = $pre_out; |
| 157 |
'), |
'), |
| 158 |
|
|
| 159 |
|
|
| 160 |
// rewrite idents |
// rewrite idents |
| 161 |
create_function('&$_in, &$_out', ' |
create_function('&$_in, &$_out', ' |
| 162 |
$idents = array ( ap, ); |
$idents = array ( ap, ); |
| 170 |
|
|
| 171 |
// write components variables to out |
// write components variables to out |
| 172 |
create_function('&$_in, &$_out', ' |
create_function('&$_in, &$_out', ' |
| 173 |
$vars = array( ecom_type, ecom_abstract_type, ecom_action, ecom_data_locator_key, ecom_data_ident, ecom_data_meta ); |
$vars = array( ecom_type, ecom_abstract_type, ecom_mode, ecom_data_locator_key, ecom_data_ident, ecom_data_meta ); |
| 174 |
if($_in[ecom_label]) { |
if($_in[ecom_label]) { |
| 175 |
foreach($vars as $key) { |
foreach($vars as $key) { |
| 176 |
if($_in[$key]) { |
if($_in[$key]) { |
| 190 |
nav => array( |
nav => array( |
| 191 |
ecom_type => "nav", |
ecom_type => "nav", |
| 192 |
ecom_abstract_type => "list", |
ecom_abstract_type => "list", |
| 193 |
ecom_action => "nav", |
ecom_mode => "nav", |
| 194 |
ecom_data_locator_key => "rpc", |
ecom_data_locator_key => "rpc", |
| 195 |
), |
), |
| 196 |
); |
); |
| 199 |
return; |
return; |
| 200 |
'), |
'), |
| 201 |
|
|
| 202 |
|
// handle data form buttons |
| 203 |
|
create_function('&$_in, &$_out', ' |
| 204 |
|
$label = $_in[ecom_label]; |
| 205 |
|
if($_in[ecom_data_form_edit]) { $_out[options][ecoms][$label][ecom_mode] = "edit"; } |
| 206 |
|
if($_in[ecom_data_form_cancel]) { $_out[options][ecoms][$label][ecom_mode] = "view"; } |
| 207 |
|
'), |
| 208 |
|
|
| 209 |
/* |
/* |
| 210 |
// translate value of argument "action" (olist => list.view, oedit => item.edit) |
// translate value of argument "action" (olist => list.view, oedit => item.edit) |
| 211 |
// action dispatcher |
// action dispatcher |