| 4 |
* $Id$ |
* $Id$ |
| 5 |
* |
* |
| 6 |
* $Log$ |
* $Log$ |
| 7 |
|
* Revision 1.16 2003/05/13 14:53:56 joko |
| 8 |
|
* reset mvc-params "filter" and "meta" in tree mode!? |
| 9 |
|
* |
| 10 |
|
* Revision 1.15 2003/05/10 18:19:55 jonen |
| 11 |
|
* + added stuff relating to 'create/add new' links/buttons |
| 12 |
|
* |
| 13 |
* Revision 1.14 2003/04/19 16:20:47 jonen |
* Revision 1.14 2003/04/19 16:20:47 jonen |
| 14 |
* + added handle of ecom 'UMnav' according to page 'Benutzverwaltung' |
* + added handle of ecom 'UMnav' according to page 'Benutzverwaltung' |
| 15 |
* |
* |
| 123 |
// parameters about data identifiers, locations, sources and associated meta-information |
// parameters about data identifiers, locations, sources and associated meta-information |
| 124 |
'ecom_data_locator_key', |
'ecom_data_locator_key', |
| 125 |
'ecom_data_ident', |
'ecom_data_ident', |
| 126 |
'ecom_data_meta', |
'ecom_data_meta', 'ecom_data_meta_x', |
| 127 |
'ecom_data_action_edit', 'ecom_data_action_cancel', 'ecom_data_action_delete', |
'ecom_data_action_edit', 'ecom_data_action_cancel', 'ecom_data_action_delete', 'ecom_data_action_create', |
| 128 |
'ecom_data_form_checkbox', 'ecom_data_form_action', |
'ecom_data_form_checkbox', 'ecom_data_form_action', |
| 129 |
'ecom_data_source_key', |
'ecom_data_source_key', |
| 130 |
'ecom_data_filter', |
'ecom_data_filter', |
| 160 |
'ecom_data_ident' => array( query_arg => 'ecdid' ), |
'ecom_data_ident' => array( query_arg => 'ecdid' ), |
| 161 |
// e.g. a classname or a filename |
// e.g. a classname or a filename |
| 162 |
'ecom_data_meta' => array( query_arg => 'ecdm' ), |
'ecom_data_meta' => array( query_arg => 'ecdm' ), |
| 163 |
|
// extended meta, e.g. 2nd parent identifier |
| 164 |
|
'ecom_data_meta_x' => array( query_arg => 'ecdmx' ), |
| 165 |
// filter the data: e.g. |
// filter the data: e.g. |
| 166 |
// - an xpath-query (xpq), |
// - an xpath-query (xpq), |
| 167 |
// - an abstract/custom filter string or |
// - an abstract/custom filter string or |
| 173 |
'ecom_data_action_edit' => array( query_arg => 'ecdfe' ), |
'ecom_data_action_edit' => array( query_arg => 'ecdfe' ), |
| 174 |
'ecom_data_action_cancel' => array( query_arg => 'ecdfc' ), |
'ecom_data_action_cancel' => array( query_arg => 'ecdfc' ), |
| 175 |
'ecom_data_action_delete' => array( query_arg => 'ecdfd' ), |
'ecom_data_action_delete' => array( query_arg => 'ecdfd' ), |
| 176 |
|
'ecom_data_action_create' => array( query_arg => 'ecdfcr' ), |
| 177 |
// ... required for data lists. |
// ... required for data lists. |
| 178 |
'ecom_data_form_action' => array( query_arg => 'ecdfa' ), |
'ecom_data_form_action' => array( query_arg => 'ecdfa' ), |
| 179 |
'ecom_data_form_checkbox' => array( query_arg => 'checkbox' ), |
'ecom_data_form_checkbox' => array( query_arg => 'checkbox' ), |
| 254 |
$requestTracker = mkObject("Application::Request::Tracker"); |
$requestTracker = mkObject("Application::Request::Tracker"); |
| 255 |
$page_state = $requestTracker->getPointer(); |
$page_state = $requestTracker->getPointer(); |
| 256 |
$pre_out = $page_state[options]; |
$pre_out = $page_state[options]; |
| 257 |
//print Dumper($pre_out); |
//print "pre_out: " . Dumper($pre_out); |
| 258 |
|
|
| 259 |
// clean-up unwanted variables |
// clean-up unwanted variables |
| 260 |
$label = $_in[ecom_label]; |
$label = $_in[ecom_label]; |
| 261 |
switch ($_in[ecom_abstract_type]) { |
switch ($_in[ecom_abstract_type]) { |
| 262 |
case "list": |
case "list": |
| 263 |
if ($pre_out[options][ecoms][$label][ecom_data_meta]) { unset($pre_out[options][ecoms][$label][ecom_data_meta]); } |
if ($pre_out[options][ecoms][$label][ecom_data_meta]) { unset($pre_out[options][ecoms][$label][ecom_data_meta]); } |
| 264 |
|
if ($pre_out[options][ecoms][$label][ecom_data_meta_x]) { unset($pre_out[options][ecoms][$label][ecom_data_meta_x]); } |
| 265 |
break; |
break; |
| 266 |
// 2003-04-16: required for xmltree-to-item transition |
// 2003-04-16: required for xmltree-to-item transition |
| 267 |
// if we dont do this the "dotted" filter expression would persist across views |
// if we dont do this the "dotted" filter expression would persist across views |
| 268 |
case "item": |
case "item": |
| 269 |
if ($pre_out[options][ecoms][$label][ecom_data_filter]) { unset($pre_out[options][ecoms][$label][ecom_data_filter]); } |
if ($pre_out[options][ecoms][$label][ecom_data_filter]) { unset($pre_out[options][ecoms][$label][ecom_data_filter]); } |
| 270 |
break; |
break; |
| 271 |
|
case "tree": |
| 272 |
|
if ($pre_out[options][ecoms][$label][ecom_data_filter]) { unset($pre_out[options][ecoms][$label][ecom_data_filter]); } |
| 273 |
|
if ($pre_out[options][ecoms][$label][ecom_data_meta]) { unset($pre_out[options][ecoms][$label][ecom_data_meta]); } |
| 274 |
|
break; |
| 275 |
} |
} |
| 276 |
$_out = $pre_out; |
$_out = $pre_out; |
| 277 |
'), |
'), |
| 303 |
create_function('&$_in, &$_out', ' |
create_function('&$_in, &$_out', ' |
| 304 |
$vars = array( |
$vars = array( |
| 305 |
ecom_type, ecom_abstract_type, ecom_mode, ecom_data_locator_key, |
ecom_type, ecom_abstract_type, ecom_mode, ecom_data_locator_key, |
| 306 |
ecom_data_ident, ecom_data_meta, ecom_data_filter |
ecom_data_ident, ecom_data_meta, ecom_data_filter, ecom_data_meta_x |
| 307 |
); |
); |
| 308 |
// ecom_call_method, ecom_call_args |
// ecom_call_method, ecom_call_args |
| 309 |
if($_in[ecom_label]) { |
if($_in[ecom_label]) { |
| 357 |
// handle data form action(button) |
// handle data form action(button) |
| 358 |
create_function('&$_in, &$_out', ' |
create_function('&$_in, &$_out', ' |
| 359 |
$label = $_in[ecom_label]; |
$label = $_in[ecom_label]; |
| 360 |
if($_in[ecom_data_form_action] && is_array($_in[ecom_data_form_checkbox])) { |
if($_in[ecom_data_form_action]) { |
| 361 |
|
//print "from action button pressed!<br>"; |
| 362 |
|
if(is_array($_in[ecom_data_form_checkbox])) { |
| 363 |
$cnt = sizeof($_in[ecom_data_form_checkbox]); |
$cnt = sizeof($_in[ecom_data_form_checkbox]); |
| 364 |
|
$tmp = array(); |
| 365 |
|
foreach($_in[ecom_data_form_checkbox] as $ident) { |
| 366 |
|
if($ident) { array_push($tmp, $ident); } |
| 367 |
|
} |
| 368 |
if($cnt == 1) { |
if($cnt == 1) { |
| 369 |
foreach($_in[ecom_data_form_checkbox] as $ident) { |
//print "Single selection, ident : " . $tmp[0] . "<br>"; |
| 370 |
$_out[options][ecoms][$label][ecom_data_ident] = $ident; |
$_out[options][ecoms][$label][ecom_data_ident] = $tmp[0]; |
| 371 |
} |
} elseif($cnt > 1) { |
|
$_out[options][ecoms][$label][ecom_data_meta] = $_in[ecom_data_ident]; |
|
|
$_out[options][ecoms][$label][ecom_mode] = $_in[ecom_data_form_action]; |
|
|
$_out[options][ecoms][$label][ecom_abstract_type] = "item"; |
|
|
} else { |
|
| 372 |
// TODO: implement multi-selection actions on rows(items) here!! |
// TODO: implement multi-selection actions on rows(items) here!! |
| 373 |
|
print "Multi-Selection!! Current Ident(s) $tmp" . "<br>"; |
| 374 |
|
$_out[options][ecoms][$label][ecom_data_ident] = $tmp; |
| 375 |
} |
} |
| 376 |
|
} else { |
| 377 |
|
print "ident: " . Dumper($_out[options][ecoms][$label][ecom_data_ident]) . "<br>"; |
| 378 |
|
} |
| 379 |
|
//$_out[options][ecoms][$label][ecom_data_meta] = $_in[ecom_data_ident]; |
| 380 |
|
$_out[options][ecoms][$label][ecom_mode] = $_in[ecom_data_form_action]; |
| 381 |
|
$_out[options][ecoms][$label][ecom_abstract_type] = "item"; |
| 382 |
} |
} |
| 383 |
'), |
'), |
| 384 |
|
|
| 388 |
$label = $_in[ecom_label]; |
$label = $_in[ecom_label]; |
| 389 |
if($_in[ecom_data_action_edit]) { $_out[options][ecoms][$label][ecom_mode] = "edit"; } |
if($_in[ecom_data_action_edit]) { $_out[options][ecoms][$label][ecom_mode] = "edit"; } |
| 390 |
if($_in[ecom_data_action_cancel]) { $_out[options][ecoms][$label][ecom_mode] = "view"; } |
if($_in[ecom_data_action_cancel]) { $_out[options][ecoms][$label][ecom_mode] = "view"; } |
| 391 |
|
|
| 392 |
|
// Action.Create |
| 393 |
|
if($_in[ecom_data_action_create]) { |
| 394 |
|
print Dumper($_out[options][ecoms][$label]); |
| 395 |
|
$_out[options][ecoms][$label][ecom_mode] = "create"; |
| 396 |
|
} |
| 397 |
|
|
| 398 |
// Action.Delete [new of 2003-04-09] |
// Action.Delete [new of 2003-04-09] |
| 399 |
if ($_in[ecom_data_action_delete]) { |
if ($_in[ecom_data_action_delete]) { |