4 |
## $Id$ |
## $Id$ |
5 |
## ----------------------------------------------------------------------------- |
## ----------------------------------------------------------------------------- |
6 |
## $Log$ |
## $Log$ |
7 |
|
## Revision 1.29 2005/08/11 14:11:28 jonen |
8 |
|
## + changes relating to new web-interface for TerminalOwner |
9 |
|
## |
10 |
|
## Revision 1.28 2004/08/31 14:15:49 jonen |
11 |
|
## + added function to clear 'ecom' state |
12 |
|
## (specially needed to refresh the 'content' block) |
13 |
|
## |
14 |
|
## Revision 1.27 2004/03/11 21:01:35 jonen |
15 |
|
## minor change |
16 |
|
## |
17 |
|
## Revision 1.26 2003/12/14 01:50:30 jonen |
18 |
|
## implemented 'SELECT' mode for selecting existing object-refereneces as child-nodes |
19 |
|
## |
20 |
## Revision 1.25 2003/11/22 18:47:49 udo |
## Revision 1.25 2003/11/22 18:47:49 udo |
21 |
## update for expand data item |
## update for expand data item |
22 |
## |
## |
222 |
function get_page_state() { |
function get_page_state() { |
223 |
$requestTracker = mkObject("Application::Request::Tracker"); |
$requestTracker = mkObject("Application::Request::Tracker"); |
224 |
$this->_state = $requestTracker->getPointer(); |
$this->_state = $requestTracker->getPointer(); |
225 |
|
//print "state: " . Dumper($this->_state) . "<br>"; |
226 |
|
} |
227 |
|
|
228 |
|
function clear_comp_state($comp = NULL) { |
229 |
|
if($comp) { |
230 |
|
$this->_e_state[ecoms][$comp] = array(); |
231 |
|
} |
232 |
} |
} |
233 |
|
|
234 |
function set_e_state($state = null) { |
function set_e_state($state = null) { |
492 |
} else { |
} else { |
493 |
user_error("AbstractExplorer::_prepare_component_args - Cannot build query for data_locator_key $val[ecom_data_locator_key] !"); |
user_error("AbstractExplorer::_prepare_component_args - Cannot build query for data_locator_key $val[ecom_data_locator_key] !"); |
494 |
} |
} |
495 |
|
|
496 |
|
if($val['ecom_mode'] == 'select') { |
497 |
|
$actionbar = array( |
498 |
|
'buttons' => array( |
499 |
|
array( |
500 |
|
'name' => "ecdfsel", |
501 |
|
'value' => "Select" |
502 |
|
), |
503 |
|
), |
504 |
|
); |
505 |
|
} else { |
506 |
|
if(is_array($_SESSION[user]) && $_SESSION[user][loggedIn]) { |
507 |
|
$actionbar = array( |
508 |
|
'name' => "ecdfa", |
509 |
|
'list' => array( |
510 |
|
"View" => 'view', |
511 |
|
"Edit" => 'edit', |
512 |
|
), |
513 |
|
'selected' => 'view', |
514 |
|
'buttons' => array( |
515 |
|
), |
516 |
|
); |
517 |
|
} else { |
518 |
|
$actionbar = array( |
519 |
|
'name' => "ecdfa", |
520 |
|
'list' => array( |
521 |
|
"View" => 'view', |
522 |
|
"Edit" => 'edit', |
523 |
|
"Delete" => 'delete', |
524 |
|
"Expand" => 'expand', |
525 |
|
"Expandedit" => 'expandedit', |
526 |
|
), |
527 |
|
'selected' => 'view', |
528 |
|
'buttons' => array( |
529 |
|
array( |
530 |
|
'name' => "ecdfcr", |
531 |
|
'value' => "Add new" |
532 |
|
), |
533 |
|
), |
534 |
|
); |
535 |
|
} |
536 |
|
} |
537 |
|
|
538 |
$args = array( |
$args = array( |
539 |
'caption' => $val['ecom_data_ident'], |
'caption' => $val['ecom_data_ident'], |
540 |
'orderby' => "Guid", |
'orderby' => "Guid", |
545 |
'seperator' => "_", |
'seperator' => "_", |
546 |
//'form' => 1, |
//'form' => 1, |
547 |
), |
), |
548 |
'actionbar' => array( |
'actionbar' => $actionbar, |
|
'name' => "ecdfa", |
|
|
'list' => array( |
|
|
"View" => 'view', |
|
|
"Edit" => 'edit', |
|
|
|
|
|
"Delete" => 'delete', |
|
|
"Expand" => 'expand', |
|
|
"Expandedit" => 'expandedit', |
|
|
|
|
|
), |
|
|
'selected' => 'view', |
|
|
'create' => array( |
|
|
'name' => "ecdfcr", |
|
|
'value' => "Add new" |
|
|
), |
|
|
), |
|
549 |
'parent' => array( |
'parent' => array( |
550 |
'class' => $val['ecom_data_ident'], |
'class' => $val['ecom_data_ident'], |
551 |
), |
), |
552 |
), |
), |
553 |
); |
); |
554 |
|
if($val['ecom_data_meta_x']) { |
555 |
|
//unset($args['options']['data_locator_meta']['nodename']); |
556 |
|
$args['options']['data_locator_meta']['parent'][guid] = $val['ecom_data_meta']; |
557 |
|
$args['options']['data_locator_meta']['parent'][nodename] = $val['ecom_data_meta_x']; |
558 |
|
} |
559 |
|
if(is_array($_SESSION[user]) && $_SESSION[user][loggedIn]) { |
560 |
|
$args['options']['data_locator_meta']['owner'][guid] = $_SESSION[user][guid]; |
561 |
|
$args['options']['data_locator_meta']['owner']['class'] = $_SESSION[user]['class']; |
562 |
|
} |
563 |
|
|
564 |
// switch abstract type |
// switch abstract type |
565 |
} elseif ($val['ecom_abstract_type'] == "item") { |
} elseif ($val['ecom_abstract_type'] == "item") { |
611 |
//if ($val['ecom_mode'] == "delete") { $args['adapter'] = 'GenericNegotiation'; } |
//if ($val['ecom_mode'] == "delete") { $args['adapter'] = 'GenericNegotiation'; } |
612 |
if ($val['ecom_mode'] == "delete") { |
if ($val['ecom_mode'] == "delete") { |
613 |
$args['adapter'] = 'NonValidatingFormProcessor'; |
$args['adapter'] = 'NonValidatingFormProcessor'; |
614 |
|
$args['options']['data_locator_meta']['action'] = 'delete'; |
615 |
} |
} |
616 |
|
|
617 |
if ($val['ecom_mode'] == "create") { |
if ($val['ecom_mode'] == "create") { |
618 |
$args['adapter'] = 'FormProcessor'; |
$args['adapter'] = 'FormProcessor'; |
619 |
$args['options']['caption'] = $val['ecom_data_ident']; |
$args['options']['caption'] = $val['ecom_data_ident']; |
620 |
$args['options']['data_locator_meta']['action'] = 'create'; |
$args['options']['data_locator_meta']['action'] = 'create'; |
621 |
print "debug 'create': " . Dumper($val); |
//print "debug 'create': " . Dumper($val); |
|
} |
|
|
|
|
622 |
if($val['ecom_data_meta_x']) { |
if($val['ecom_data_meta_x']) { |
623 |
unset($args['options']['data_locator_meta']['nodename']); |
unset($args['options']['data_locator_meta']['nodename']); |
624 |
$args['options']['data_locator_meta']['parent'][guid] = $val['ecom_data_meta']; |
$args['options']['data_locator_meta']['parent'][guid] = $val['ecom_data_meta']; |
625 |
$args['options']['data_locator_meta']['parent'][nodename] = $val['ecom_data_meta_x']; |
$args['options']['data_locator_meta']['parent'][nodename] = $val['ecom_data_meta_x']; |
626 |
} |
} |
627 |
|
} |
628 |
|
if ($val['ecom_mode'] == "select") { |
629 |
|
$args['adapter'] = 'FormProcessor'; |
630 |
|
$args['caption'] = $val['ecom_data_meta_xe'] . " {". $val['ecom_data_meta_x'] . ":}"; |
631 |
|
$args['options']['data_locator_meta']['action'] = 'select'; |
632 |
|
//print "debug 'select': " . Dumper($val); |
633 |
|
if($val['ecom_data_meta_x']) { |
634 |
|
$args['options']['data_locator_meta']['parent'][guid] = $val['ecom_data_meta_xe']; |
635 |
|
$args['options']['data_locator_meta']['parent'][nodename] = $val['ecom_data_meta_x']; |
636 |
|
} |
637 |
|
} |
638 |
|
|
639 |
|
//print "debug 'args' : " . Dumper($args); |
640 |
|
|
641 |
// switch abstract type |
// switch abstract type |
642 |
} elseif ($val['ecom_abstract_type'] == "tree") { |
} elseif ($val['ecom_abstract_type'] == "tree") { |
761 |
|
|
762 |
} |
} |
763 |
|
|
764 |
|
if(is_array($_SESSION[user]) && $_SESSION[user][loggedIn]) { |
765 |
|
$args['options']['userclass'] = $_SESSION[user]['class']; |
766 |
|
} |
767 |
|
|
768 |
// NEW[2003-04-18]: add hidden items to args |
// NEW[2003-04-18]: add hidden items to args |
769 |
$args['hidden_elements'] = $this->_get_hidden_items($label); |
$args['hidden_elements'] = $this->_get_hidden_items($label); |
770 |
//print "args_hidden: " .Dumper($args['hidden_elements']). "<br>"; |
//print "args_hidden: " .Dumper($args['hidden_elements']). "<br>"; |