| 4 | 
  * $Id$ | 
  * $Id$ | 
| 5 | 
  * | 
  * | 
| 6 | 
  * $Log$ | 
  * $Log$ | 
| 7 | 
  | 
  * Revision 1.21  2003/12/14 01:51:29  jonen | 
| 8 | 
  | 
  * implemented 'SELECT' mode for selecting existing object-refereneces as child-nodes | 
| 9 | 
  | 
  * | 
| 10 | 
  * Revision 1.20  2003/11/22 18:46:33  udo | 
  * Revision 1.20  2003/11/22 18:46:33  udo | 
| 11 | 
  * update for expand data item | 
  * update for expand data item | 
| 12 | 
  * | 
  * | 
| 138 | 
         // parameters about data identifiers, locations, sources and associated meta-information | 
         // parameters about data identifiers, locations, sources and associated meta-information | 
| 139 | 
         'ecom_data_locator_key', | 
         'ecom_data_locator_key', | 
| 140 | 
         'ecom_data_ident',  | 
         'ecom_data_ident',  | 
| 141 | 
         'ecom_data_meta', 'ecom_data_meta_x', | 
         'ecom_data_meta', 'ecom_data_meta_x', 'ecom_data_meta_xe', | 
| 142 | 
         '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', | 
| 143 | 
         'ecom_data_action_expand_edit', | 
         'ecom_data_action_expand_edit', 'ecom_data_action_select', | 
| 144 | 
         'ecom_data_form_checkbox', 'ecom_data_form_action', | 
         'ecom_data_form_checkbox', 'ecom_data_form_action', | 
| 145 | 
         'ecom_data_source_key', | 
         'ecom_data_source_key', | 
| 146 | 
         'ecom_data_filter', | 
         'ecom_data_filter', | 
| 178 | 
           'ecom_data_meta' => array( query_arg => 'ecdm' ), | 
           'ecom_data_meta' => array( query_arg => 'ecdm' ), | 
| 179 | 
           // extended meta, e.g. 2nd parent identifier | 
           // extended meta, e.g. 2nd parent identifier | 
| 180 | 
           'ecom_data_meta_x' => array( query_arg => 'ecdmx' ), | 
           'ecom_data_meta_x' => array( query_arg => 'ecdmx' ), | 
| 181 | 
  | 
           'ecom_data_meta_xe' => array( query_arg => 'ecdmxe' ), | 
| 182 | 
           // filter the data: e.g.  | 
           // filter the data: e.g.  | 
| 183 | 
           //    - an xpath-query (xpq),  | 
           //    - an xpath-query (xpq),  | 
| 184 | 
           //    - an abstract/custom filter string or | 
           //    - an abstract/custom filter string or | 
| 196 | 
           'ecom_data_form_checkbox' => array( query_arg => 'checkbox' ), | 
           'ecom_data_form_checkbox' => array( query_arg => 'checkbox' ), | 
| 197 | 
           // ... required for expanded data items. | 
           // ... required for expanded data items. | 
| 198 | 
           'ecom_data_action_expand_edit' => array( query_arg => 'ecdfee' ), | 
           'ecom_data_action_expand_edit' => array( query_arg => 'ecdfee' ), | 
| 199 | 
  | 
           // ... required for selecting existing objects as reference | 
| 200 | 
  | 
           'ecom_data_action_select' => array( query_arg => 'ecdfsel' ), | 
| 201 | 
            | 
            | 
| 202 | 
           // Special argument (should become a non-data-action). | 
           // Special argument (should become a non-data-action). | 
| 203 | 
           // 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. | 
| 281 | 
           $label = $_in[ecom_label]; | 
           $label = $_in[ecom_label]; | 
| 282 | 
           switch ($_in[ecom_abstract_type]) { | 
           switch ($_in[ecom_abstract_type]) { | 
| 283 | 
             case "list": | 
             case "list": | 
| 284 | 
               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_mode] != "select") { | 
| 285 | 
               if ($pre_out[options][ecoms][$label][ecom_data_meta_x]) { unset($pre_out[options][ecoms][$label][ecom_data_meta_x]); } | 
                 if ($pre_out[options][ecoms][$label][ecom_data_meta]) { unset($pre_out[options][ecoms][$label][ecom_data_meta]); } | 
| 286 | 
  | 
                 if ($pre_out[options][ecoms][$label][ecom_data_meta_x]) { unset($pre_out[options][ecoms][$label][ecom_data_meta_x]); } | 
| 287 | 
  | 
               } | 
| 288 | 
               break; | 
               break; | 
| 289 | 
             // 2003-04-16: required for xmltree-to-item transition | 
             // 2003-04-16: required for xmltree-to-item transition | 
| 290 | 
             // 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 | 
| 451 | 
  | 
  | 
| 452 | 
             $_out[options][ecoms][$label][ecom_abstract_type] = "item"; | 
             $_out[options][ecoms][$label][ecom_abstract_type] = "item"; | 
| 453 | 
           } | 
           } | 
| 454 | 
  | 
           // Action.Select | 
| 455 | 
  | 
           if($_in[ecom_data_action_select]) { | 
| 456 | 
  | 
            if(is_array($_in[ecom_data_form_checkbox])) { | 
| 457 | 
  | 
             $cnt = sizeof($_in[ecom_data_form_checkbox]); | 
| 458 | 
  | 
             $tmp = array(); | 
| 459 | 
  | 
             foreach($_in[ecom_data_form_checkbox] as $ident) { | 
| 460 | 
  | 
                 if($ident) { array_push($tmp, $ident); } | 
| 461 | 
  | 
             } | 
| 462 | 
  | 
             if($cnt == 1) { | 
| 463 | 
  | 
               print "Single selection, ident : " . $tmp[0] . "<br>"; | 
| 464 | 
  | 
               $_out[options][ecoms][$label][ecom_data_ident] = $tmp[0]; | 
| 465 | 
  | 
               $_out[options][ecoms][$label][ecom_abstract_type] = "item"; | 
| 466 | 
  | 
             } elseif($cnt > 1) { | 
| 467 | 
  | 
               // TODO: implement multi-selection actions on rows(items) here!! | 
| 468 | 
  | 
                 print "Cannot do Multi-Selections with Action SELECT!!" . "<br>"; | 
| 469 | 
  | 
             } | 
| 470 | 
  | 
  | 
| 471 | 
  | 
             $requestTracker = mkObject("Application::Request::Tracker"); | 
| 472 | 
  | 
             $page_state = $requestTracker->getPointer(); | 
| 473 | 
  | 
             $pre_out = $page_state[options]; | 
| 474 | 
  | 
             //print "pre_out: " . Dumper($pre_out); | 
| 475 | 
  | 
  | 
| 476 | 
  | 
             $_out[options][ecoms][$label][ecom_mode] = "select"; | 
| 477 | 
  | 
             $_out[options][ecoms][$label][ecom_data_meta_xe] = $pre_out[options][ecoms][$label][ecom_data_meta]; | 
| 478 | 
  | 
             $_out[options][ecoms][$label][ecom_data_meta] = $_in[ecom_data_ident]; | 
| 479 | 
  | 
            } | 
| 480 | 
  | 
           } | 
| 481 | 
         '), | 
         '), | 
| 482 | 
  | 
  | 
| 483 | 
         // propagate datasources to ecoms | 
         // propagate datasources to ecoms |