| 4 |
* $Id$ |
* $Id$ |
| 5 |
* |
* |
| 6 |
* $Log$ |
* $Log$ |
| 7 |
|
* Revision 1.17 2003/06/25 23:45:05 joko |
| 8 |
|
* trying to switch from "ap" completely to "t" |
| 9 |
|
* |
| 10 |
|
* Revision 1.16 2003/05/13 14:53:56 joko |
| 11 |
|
* reset mvc-params "filter" and "meta" in tree mode!? |
| 12 |
|
* |
| 13 |
|
* Revision 1.15 2003/05/10 18:19:55 jonen |
| 14 |
|
* + added stuff relating to 'create/add new' links/buttons |
| 15 |
|
* |
| 16 |
|
* Revision 1.14 2003/04/19 16:20:47 jonen |
| 17 |
|
* + added handle of ecom 'UMnav' according to page 'Benutzverwaltung' |
| 18 |
|
* |
| 19 |
* Revision 1.13 2003/04/18 15:30:24 joko |
* Revision 1.13 2003/04/18 15:30:24 joko |
| 20 |
* NEW: parameter 'ecom_data_filter' - used for 'items' |
* NEW: parameter 'ecom_data_filter' - used for 'items' |
| 21 |
* (introduced to filter xml-payload at backend side via xpath queries) |
* (introduced to filter xml-payload at backend side via xpath queries) |
| 126 |
// parameters about data identifiers, locations, sources and associated meta-information |
// parameters about data identifiers, locations, sources and associated meta-information |
| 127 |
'ecom_data_locator_key', |
'ecom_data_locator_key', |
| 128 |
'ecom_data_ident', |
'ecom_data_ident', |
| 129 |
'ecom_data_meta', |
'ecom_data_meta', 'ecom_data_meta_x', |
| 130 |
'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', |
| 131 |
'ecom_data_form_checkbox', 'ecom_data_form_action', |
'ecom_data_form_checkbox', 'ecom_data_form_action', |
| 132 |
'ecom_data_source_key', |
'ecom_data_source_key', |
| 133 |
'ecom_data_filter', |
'ecom_data_filter', |
| 163 |
'ecom_data_ident' => array( query_arg => 'ecdid' ), |
'ecom_data_ident' => array( query_arg => 'ecdid' ), |
| 164 |
// e.g. a classname or a filename |
// e.g. a classname or a filename |
| 165 |
'ecom_data_meta' => array( query_arg => 'ecdm' ), |
'ecom_data_meta' => array( query_arg => 'ecdm' ), |
| 166 |
|
// extended meta, e.g. 2nd parent identifier |
| 167 |
|
'ecom_data_meta_x' => array( query_arg => 'ecdmx' ), |
| 168 |
// filter the data: e.g. |
// filter the data: e.g. |
| 169 |
// - an xpath-query (xpq), |
// - an xpath-query (xpq), |
| 170 |
// - an abstract/custom filter string or |
// - an abstract/custom filter string or |
| 176 |
'ecom_data_action_edit' => array( query_arg => 'ecdfe' ), |
'ecom_data_action_edit' => array( query_arg => 'ecdfe' ), |
| 177 |
'ecom_data_action_cancel' => array( query_arg => 'ecdfc' ), |
'ecom_data_action_cancel' => array( query_arg => 'ecdfc' ), |
| 178 |
'ecom_data_action_delete' => array( query_arg => 'ecdfd' ), |
'ecom_data_action_delete' => array( query_arg => 'ecdfd' ), |
| 179 |
|
'ecom_data_action_create' => array( query_arg => 'ecdfcr' ), |
| 180 |
// ... required for data lists. |
// ... required for data lists. |
| 181 |
'ecom_data_form_action' => array( query_arg => 'ecdfa' ), |
'ecom_data_form_action' => array( query_arg => 'ecdfa' ), |
| 182 |
'ecom_data_form_checkbox' => array( query_arg => 'checkbox' ), |
'ecom_data_form_checkbox' => array( query_arg => 'checkbox' ), |
| 257 |
$requestTracker = mkObject("Application::Request::Tracker"); |
$requestTracker = mkObject("Application::Request::Tracker"); |
| 258 |
$page_state = $requestTracker->getPointer(); |
$page_state = $requestTracker->getPointer(); |
| 259 |
$pre_out = $page_state[options]; |
$pre_out = $page_state[options]; |
| 260 |
//print Dumper($pre_out); |
//print "pre_out: " . Dumper($pre_out); |
| 261 |
|
|
| 262 |
// clean-up unwanted variables |
// clean-up unwanted variables |
| 263 |
$label = $_in[ecom_label]; |
$label = $_in[ecom_label]; |
| 264 |
switch ($_in[ecom_abstract_type]) { |
switch ($_in[ecom_abstract_type]) { |
| 265 |
case "list": |
case "list": |
| 266 |
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]); } |
| 267 |
|
if ($pre_out[options][ecoms][$label][ecom_data_meta_x]) { unset($pre_out[options][ecoms][$label][ecom_data_meta_x]); } |
| 268 |
break; |
break; |
| 269 |
// 2003-04-16: required for xmltree-to-item transition |
// 2003-04-16: required for xmltree-to-item transition |
| 270 |
// 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 |
| 271 |
case "item": |
case "item": |
| 272 |
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]); } |
| 273 |
break; |
break; |
| 274 |
|
case "tree": |
| 275 |
|
if ($pre_out[options][ecoms][$label][ecom_data_filter]) { unset($pre_out[options][ecoms][$label][ecom_data_filter]); } |
| 276 |
|
if ($pre_out[options][ecoms][$label][ecom_data_meta]) { unset($pre_out[options][ecoms][$label][ecom_data_meta]); } |
| 277 |
|
break; |
| 278 |
} |
} |
| 279 |
$_out = $pre_out; |
$_out = $pre_out; |
| 280 |
'), |
'), |
| 289 |
|
|
| 290 |
// rewrite idents |
// rewrite idents |
| 291 |
create_function('&$_in, &$_out', ' |
create_function('&$_in, &$_out', ' |
| 292 |
|
|
| 293 |
|
// old version: ap == explorer |
| 294 |
// map Topic to Page if exists |
// map Topic to Page if exists |
| 295 |
if($_in[topic]) { |
//if ($_in[topic]) { |
| 296 |
$_in[ap] = $_in[topic]; |
// $_in[ap] = $_in[topic]; |
| 297 |
} |
//} |
| 298 |
$idents = array ( ap, ); |
//$idents = array ( ap ); |
| 299 |
foreach($idents as $key) { |
//foreach($idents as $key) { |
| 300 |
$_out[options][idents][$key] = $_in[$key]; |
// $_out[options][idents][$key] = $_in[$key]; |
| 301 |
} |
//} |
| 302 |
|
|
| 303 |
|
// 2003-06-26: switched from ap=explorer to t=DataBrowser |
| 304 |
|
$_out[options][idents][t] = $_in[topic]; |
| 305 |
|
|
| 306 |
'), |
'), |
| 307 |
|
|
| 308 |
// check right $_GET[ap] |
// check right $_GET[ap] |
| 312 |
create_function('&$_in, &$_out', ' |
create_function('&$_in, &$_out', ' |
| 313 |
$vars = array( |
$vars = array( |
| 314 |
ecom_type, ecom_abstract_type, ecom_mode, ecom_data_locator_key, |
ecom_type, ecom_abstract_type, ecom_mode, ecom_data_locator_key, |
| 315 |
ecom_data_ident, ecom_data_meta, ecom_data_filter |
ecom_data_ident, ecom_data_meta, ecom_data_filter, ecom_data_meta_x |
| 316 |
); |
); |
| 317 |
// ecom_call_method, ecom_call_args |
// ecom_call_method, ecom_call_args |
| 318 |
if($_in[ecom_label]) { |
if($_in[ecom_label]) { |
| 349 |
return; |
return; |
| 350 |
'), |
'), |
| 351 |
|
|
| 352 |
|
// handle data form action(button) |
| 353 |
|
create_function('&$_in, &$_out', ' |
| 354 |
|
if($_in[ap] == "Benutzerverwaltung" || $_in[topic] == "Benutzerverwaltung") { |
| 355 |
|
if(!$_out[options][ecoms][UMnav]) { |
| 356 |
|
$_out[options][ecoms][UMnav] = array( |
| 357 |
|
ecom_type => "nav", |
| 358 |
|
ecom_abstract_type => "tree", |
| 359 |
|
ecom_mode => "link", |
| 360 |
|
ecom_data_locator_key => "rpc", |
| 361 |
|
); |
| 362 |
|
} |
| 363 |
|
} |
| 364 |
|
'), |
| 365 |
|
|
| 366 |
// handle data form action(button) |
// handle data form action(button) |
| 367 |
create_function('&$_in, &$_out', ' |
create_function('&$_in, &$_out', ' |
| 368 |
$label = $_in[ecom_label]; |
$label = $_in[ecom_label]; |
| 369 |
if($_in[ecom_data_form_action] && is_array($_in[ecom_data_form_checkbox])) { |
if($_in[ecom_data_form_action]) { |
| 370 |
|
//print "from action button pressed!<br>"; |
| 371 |
|
if(is_array($_in[ecom_data_form_checkbox])) { |
| 372 |
$cnt = sizeof($_in[ecom_data_form_checkbox]); |
$cnt = sizeof($_in[ecom_data_form_checkbox]); |
| 373 |
|
$tmp = array(); |
| 374 |
|
foreach($_in[ecom_data_form_checkbox] as $ident) { |
| 375 |
|
if($ident) { array_push($tmp, $ident); } |
| 376 |
|
} |
| 377 |
if($cnt == 1) { |
if($cnt == 1) { |
| 378 |
foreach($_in[ecom_data_form_checkbox] as $ident) { |
//print "Single selection, ident : " . $tmp[0] . "<br>"; |
| 379 |
$_out[options][ecoms][$label][ecom_data_ident] = $ident; |
$_out[options][ecoms][$label][ecom_data_ident] = $tmp[0]; |
| 380 |
} |
} 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 { |
|
| 381 |
// TODO: implement multi-selection actions on rows(items) here!! |
// TODO: implement multi-selection actions on rows(items) here!! |
| 382 |
|
print "Multi-Selection!! Current Ident(s) $tmp" . "<br>"; |
| 383 |
|
$_out[options][ecoms][$label][ecom_data_ident] = $tmp; |
| 384 |
} |
} |
| 385 |
|
} else { |
| 386 |
|
print "ident: " . Dumper($_out[options][ecoms][$label][ecom_data_ident]) . "<br>"; |
| 387 |
|
} |
| 388 |
|
//$_out[options][ecoms][$label][ecom_data_meta] = $_in[ecom_data_ident]; |
| 389 |
|
$_out[options][ecoms][$label][ecom_mode] = $_in[ecom_data_form_action]; |
| 390 |
|
$_out[options][ecoms][$label][ecom_abstract_type] = "item"; |
| 391 |
} |
} |
| 392 |
'), |
'), |
| 393 |
|
|
| 397 |
$label = $_in[ecom_label]; |
$label = $_in[ecom_label]; |
| 398 |
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"; } |
| 399 |
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"; } |
| 400 |
|
|
| 401 |
|
// Action.Create |
| 402 |
|
if($_in[ecom_data_action_create]) { |
| 403 |
|
print Dumper($_out[options][ecoms][$label]); |
| 404 |
|
$_out[options][ecoms][$label][ecom_mode] = "create"; |
| 405 |
|
} |
| 406 |
|
|
| 407 |
// Action.Delete [new of 2003-04-09] |
// Action.Delete [new of 2003-04-09] |
| 408 |
if ($_in[ecom_data_action_delete]) { |
if ($_in[ecom_data_action_delete]) { |