| 4 |
* $Id$ |
* $Id$ |
| 5 |
* |
* |
| 6 |
* $Log$ |
* $Log$ |
| 7 |
|
* Revision 1.20 2003/11/22 18:46:33 udo |
| 8 |
|
* update for expand data item |
| 9 |
|
* |
| 10 |
|
* Revision 1.19 2003/07/14 09:54:58 jonen |
| 11 |
|
* fixed bug related to 'item delete' |
| 12 |
|
* |
| 13 |
|
* Revision 1.18 2003/07/02 12:18:00 jonen |
| 14 |
|
* fixed bugs |
| 15 |
|
* |
| 16 |
|
* Revision 1.17 2003/06/25 23:45:05 joko |
| 17 |
|
* trying to switch from "ap" completely to "t" |
| 18 |
|
* |
| 19 |
|
* Revision 1.16 2003/05/13 14:53:56 joko |
| 20 |
|
* reset mvc-params "filter" and "meta" in tree mode!? |
| 21 |
|
* |
| 22 |
* Revision 1.15 2003/05/10 18:19:55 jonen |
* Revision 1.15 2003/05/10 18:19:55 jonen |
| 23 |
* + added stuff relating to 'create/add new' links/buttons |
* + added stuff relating to 'create/add new' links/buttons |
| 24 |
* |
* |
| 137 |
'ecom_data_ident', |
'ecom_data_ident', |
| 138 |
'ecom_data_meta', 'ecom_data_meta_x', |
'ecom_data_meta', 'ecom_data_meta_x', |
| 139 |
'ecom_data_action_edit', 'ecom_data_action_cancel', 'ecom_data_action_delete', 'ecom_data_action_create', |
'ecom_data_action_edit', 'ecom_data_action_cancel', 'ecom_data_action_delete', 'ecom_data_action_create', |
| 140 |
|
'ecom_data_action_expand_edit', |
| 141 |
'ecom_data_form_checkbox', 'ecom_data_form_action', |
'ecom_data_form_checkbox', 'ecom_data_form_action', |
| 142 |
'ecom_data_source_key', |
'ecom_data_source_key', |
| 143 |
'ecom_data_filter', |
'ecom_data_filter', |
| 190 |
// ... required for data lists. |
// ... required for data lists. |
| 191 |
'ecom_data_form_action' => array( query_arg => 'ecdfa' ), |
'ecom_data_form_action' => array( query_arg => 'ecdfa' ), |
| 192 |
'ecom_data_form_checkbox' => array( query_arg => 'checkbox' ), |
'ecom_data_form_checkbox' => array( query_arg => 'checkbox' ), |
| 193 |
|
// ... required for expanded data items. |
| 194 |
|
'ecom_data_action_expand_edit' => array( query_arg => 'ecdfee' ), |
| 195 |
|
|
| 196 |
// Special argument (should become a non-data-action). |
// Special argument (should become a non-data-action). |
| 197 |
// Triggers 'selectSource' at backend api (remote api) which causes a database handle switch. |
// Triggers 'selectSource' at backend api (remote api) which causes a database handle switch. |
| 283 |
case "item": |
case "item": |
| 284 |
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]); } |
| 285 |
break; |
break; |
| 286 |
|
case "tree": |
| 287 |
|
if ($pre_out[options][ecoms][$label][ecom_data_filter]) { unset($pre_out[options][ecoms][$label][ecom_data_filter]); } |
| 288 |
|
if ($pre_out[options][ecoms][$label][ecom_data_meta]) { unset($pre_out[options][ecoms][$label][ecom_data_meta]); } |
| 289 |
|
break; |
| 290 |
} |
} |
| 291 |
$_out = $pre_out; |
$_out = $pre_out; |
| 292 |
'), |
'), |
| 301 |
|
|
| 302 |
// rewrite idents |
// rewrite idents |
| 303 |
create_function('&$_in, &$_out', ' |
create_function('&$_in, &$_out', ' |
| 304 |
|
|
| 305 |
|
// old version: ap == explorer |
| 306 |
// map Topic to Page if exists |
// map Topic to Page if exists |
| 307 |
if($_in[topic]) { |
//if ($_in[topic]) { |
| 308 |
$_in[ap] = $_in[topic]; |
// $_in[ap] = $_in[topic]; |
| 309 |
} |
//} |
| 310 |
$idents = array ( ap, ); |
//$idents = array ( ap ); |
| 311 |
foreach($idents as $key) { |
//foreach($idents as $key) { |
| 312 |
$_out[options][idents][$key] = $_in[$key]; |
// $_out[options][idents][$key] = $_in[$key]; |
| 313 |
} |
//} |
| 314 |
|
|
| 315 |
|
// 2003-06-26: switched from ap=explorer to t=DataBrowser |
| 316 |
|
$_out[options][idents][t] = $_in[topic]; |
| 317 |
|
|
| 318 |
'), |
'), |
| 319 |
|
|
| 320 |
// check right $_GET[ap] |
// check right $_GET[ap] - depreciated |
| 321 |
create_function('&$_in, &$_out', 'return ($_in[ap] != "explorer") ? print "Wrong application value [ap]: $_in[ap], sure this is right here?<br>" : null;'), |
//create_function('&$_in, &$_out', 'return ($_in[ap] != "explorer") ? print "Wrong application value [ap]: $_in[ap], sure this is right here?<br>" : null;'), |
| 322 |
|
|
| 323 |
// write components variables to out |
// write components variables to out |
| 324 |
create_function('&$_in, &$_out', ' |
create_function('&$_in, &$_out', ' |
| 330 |
if($_in[ecom_label]) { |
if($_in[ecom_label]) { |
| 331 |
foreach($vars as $key) { |
foreach($vars as $key) { |
| 332 |
if($_in[$key]) { |
if($_in[$key]) { |
| 333 |
|
//print "var: " . $key . " value: " . $_in[$key] . "<br>"; |
| 334 |
$label = $_in[ecom_label]; |
$label = $_in[ecom_label]; |
| 335 |
$_out[options][ecoms][$label][$key] = $_in[$key]; |
$_out[options][ecoms][$label][$key] = $_in[$key]; |
| 336 |
} |
} |
| 388 |
if($ident) { array_push($tmp, $ident); } |
if($ident) { array_push($tmp, $ident); } |
| 389 |
} |
} |
| 390 |
if($cnt == 1) { |
if($cnt == 1) { |
| 391 |
//print "Single selection, ident : " . $tmp[0] . "<br>"; |
print "Single selection, ident : " . $tmp[0] . "<br>"; |
| 392 |
$_out[options][ecoms][$label][ecom_data_ident] = $tmp[0]; |
$_out[options][ecoms][$label][ecom_data_ident] = $tmp[0]; |
| 393 |
|
$_out[options][ecoms][$label][ecom_abstract_type] = "item"; |
| 394 |
} elseif($cnt > 1) { |
} elseif($cnt > 1) { |
| 395 |
// TODO: implement multi-selection actions on rows(items) here!! |
// TODO: implement multi-selection actions on rows(items) here!! |
| 396 |
print "Multi-Selection!! Current Ident(s) $tmp" . "<br>"; |
print "Multi-Selection!! Current Ident(s) $tmp" . "<br>"; |
| 397 |
$_out[options][ecoms][$label][ecom_data_ident] = $tmp; |
$_out[options][ecoms][$label][ecom_data_ident] = $tmp; |
| 398 |
|
$_out[options][ecoms][$label][ecom_abstract_type] = "item"; |
| 399 |
} |
} |
| 400 |
} else { |
} else { |
| 401 |
print "ident: " . Dumper($_out[options][ecoms][$label][ecom_data_ident]) . "<br>"; |
print "ident: " . Dumper($_out[options][ecoms][$label][ecom_data_ident]) . "<br>"; |
| 402 |
} |
} |
| 403 |
//$_out[options][ecoms][$label][ecom_data_meta] = $_in[ecom_data_ident]; |
$_out[options][ecoms][$label][ecom_data_meta] = $_in[ecom_data_ident]; |
| 404 |
$_out[options][ecoms][$label][ecom_mode] = $_in[ecom_data_form_action]; |
$_out[options][ecoms][$label][ecom_mode] = $_in[ecom_data_form_action]; |
| 405 |
$_out[options][ecoms][$label][ecom_abstract_type] = "item"; |
//print "in: " . Dumper($_in) . "<br>"; |
| 406 |
|
//print "out: " . Dumper($_out) . "<br>"; |
| 407 |
} |
} |
| 408 |
'), |
'), |
| 409 |
|
|
| 411 |
// handle data form buttons |
// handle data form buttons |
| 412 |
create_function('&$_in, &$_out', ' |
create_function('&$_in, &$_out', ' |
| 413 |
$label = $_in[ecom_label]; |
$label = $_in[ecom_label]; |
| 414 |
if($_in[ecom_data_action_edit]) { $_out[options][ecoms][$label][ecom_mode] = "edit"; } |
if($_in[ecom_data_action_edit]) { |
| 415 |
if($_in[ecom_data_action_cancel]) { $_out[options][ecoms][$label][ecom_mode] = "view"; } |
$_out[options][ecoms][$label][ecom_mode] = "edit"; |
| 416 |
|
$_out[options][ecoms][$label][ecom_abstract_type] = "item"; |
| 417 |
|
} |
| 418 |
|
if($_in[ecom_data_action_cancel]) { |
| 419 |
|
$_out[options][ecoms][$label][ecom_mode] = "view"; |
| 420 |
|
$_out[options][ecoms][$label][ecom_abstract_type] = "item"; |
| 421 |
|
} |
| 422 |
|
|
| 423 |
// Action.Create |
// Action.Create |
| 424 |
if($_in[ecom_data_action_create]) { |
if($_in[ecom_data_action_create]) { |
| 425 |
print Dumper($_out[options][ecoms][$label]); |
//print Dumper($_out[options][ecoms][$label]); |
| 426 |
$_out[options][ecoms][$label][ecom_mode] = "create"; |
$_out[options][ecoms][$label][ecom_mode] = "create"; |
| 427 |
|
$_out[options][ecoms][$label][ecom_abstract_type] = "item"; |
| 428 |
|
} |
| 429 |
|
if($_in[ecom_data_action_expand_edit]) { |
| 430 |
|
//print Dumper($_out[options][ecoms][$label]); |
| 431 |
|
$_out[options][ecoms][$label][ecom_mode] = "expandedit"; |
| 432 |
|
$_out[options][ecoms][$label][ecom_abstract_type] = "item"; |
| 433 |
} |
} |
| 434 |
|
|
| 435 |
// Action.Delete [new of 2003-04-09] |
// Action.Delete [new of 2003-04-09] |
| 441 |
// could/should we do this for "edit" and/or "view" actions as well? |
// could/should we do this for "edit" and/or "view" actions as well? |
| 442 |
// look at ecom/FlexibleDataItem! |
// look at ecom/FlexibleDataItem! |
| 443 |
|
|
| 444 |
|
$_out[options][ecoms][$label][ecom_abstract_type] = "item"; |
| 445 |
} |
} |
|
|
|
| 446 |
'), |
'), |
| 447 |
|
|
| 448 |
// propagate datasources to ecoms |
// propagate datasources to ecoms |