| 4 | 
  * $Id$ | 
  * $Id$ | 
| 5 | 
  * | 
  * | 
| 6 | 
  * $Log$ | 
  * $Log$ | 
| 7 | 
  | 
  * Revision 1.15  2003/05/10 18:19:55  jonen | 
| 8 | 
  | 
  * + added stuff relating to 'create/add new' links/buttons | 
| 9 | 
  | 
  * | 
| 10 | 
  | 
  * Revision 1.14  2003/04/19 16:20:47  jonen | 
| 11 | 
  | 
  * + added handle of ecom 'UMnav' according to page 'Benutzverwaltung' | 
| 12 | 
  | 
  * | 
| 13 | 
  * Revision 1.13  2003/04/18 15:30:24  joko | 
  * Revision 1.13  2003/04/18 15:30:24  joko | 
| 14 | 
  * NEW: parameter 'ecom_data_filter' - used for 'items' | 
  * NEW: parameter 'ecom_data_filter' - used for 'items' | 
| 15 | 
  *   (introduced to filter xml-payload at backend side via xpath queries) | 
  *   (introduced to filter xml-payload at backend side via xpath queries) | 
| 120 | 
         // parameters about data identifiers, locations, sources and associated meta-information | 
         // parameters about data identifiers, locations, sources and associated meta-information | 
| 121 | 
         'ecom_data_locator_key', | 
         'ecom_data_locator_key', | 
| 122 | 
         'ecom_data_ident',  | 
         'ecom_data_ident',  | 
| 123 | 
         'ecom_data_meta',  | 
         'ecom_data_meta', 'ecom_data_meta_x', | 
| 124 | 
         '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', | 
| 125 | 
         'ecom_data_form_checkbox', 'ecom_data_form_action', | 
         'ecom_data_form_checkbox', 'ecom_data_form_action', | 
| 126 | 
         'ecom_data_source_key', | 
         'ecom_data_source_key', | 
| 127 | 
         'ecom_data_filter', | 
         'ecom_data_filter', | 
| 157 | 
           'ecom_data_ident' => array( query_arg => 'ecdid' ), | 
           'ecom_data_ident' => array( query_arg => 'ecdid' ), | 
| 158 | 
           // e.g. a classname or a filename | 
           // e.g. a classname or a filename | 
| 159 | 
           'ecom_data_meta' => array( query_arg => 'ecdm' ), | 
           'ecom_data_meta' => array( query_arg => 'ecdm' ), | 
| 160 | 
  | 
           // extended meta, e.g. 2nd parent identifier | 
| 161 | 
  | 
           'ecom_data_meta_x' => array( query_arg => 'ecdmx' ), | 
| 162 | 
           // filter the data: e.g.  | 
           // filter the data: e.g.  | 
| 163 | 
           //    - an xpath-query (xpq),  | 
           //    - an xpath-query (xpq),  | 
| 164 | 
           //    - an abstract/custom filter string or | 
           //    - an abstract/custom filter string or | 
| 170 | 
           'ecom_data_action_edit' => array( query_arg => 'ecdfe' ), | 
           'ecom_data_action_edit' => array( query_arg => 'ecdfe' ), | 
| 171 | 
           'ecom_data_action_cancel' => array( query_arg => 'ecdfc' ), | 
           'ecom_data_action_cancel' => array( query_arg => 'ecdfc' ), | 
| 172 | 
           'ecom_data_action_delete' => array( query_arg => 'ecdfd' ), | 
           'ecom_data_action_delete' => array( query_arg => 'ecdfd' ), | 
| 173 | 
  | 
           'ecom_data_action_create' => array( query_arg => 'ecdfcr' ), | 
| 174 | 
           // ... required for data lists. | 
           // ... required for data lists. | 
| 175 | 
           'ecom_data_form_action' => array( query_arg => 'ecdfa' ), | 
           'ecom_data_form_action' => array( query_arg => 'ecdfa' ), | 
| 176 | 
           'ecom_data_form_checkbox' => array( query_arg => 'checkbox' ), | 
           'ecom_data_form_checkbox' => array( query_arg => 'checkbox' ), | 
| 251 | 
           $requestTracker = mkObject("Application::Request::Tracker"); | 
           $requestTracker = mkObject("Application::Request::Tracker"); | 
| 252 | 
           $page_state = $requestTracker->getPointer(); | 
           $page_state = $requestTracker->getPointer(); | 
| 253 | 
           $pre_out = $page_state[options]; | 
           $pre_out = $page_state[options]; | 
| 254 | 
           //print Dumper($pre_out); | 
           //print "pre_out: " . Dumper($pre_out); | 
| 255 | 
            | 
            | 
| 256 | 
           // clean-up unwanted variables | 
           // clean-up unwanted variables | 
| 257 | 
           $label = $_in[ecom_label]; | 
           $label = $_in[ecom_label]; | 
| 258 | 
           switch ($_in[ecom_abstract_type]) { | 
           switch ($_in[ecom_abstract_type]) { | 
| 259 | 
             case "list": | 
             case "list": | 
| 260 | 
               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]); } | 
| 261 | 
  | 
               if ($pre_out[options][ecoms][$label][ecom_data_meta_x]) { unset($pre_out[options][ecoms][$label][ecom_data_meta_x]); } | 
| 262 | 
               break; | 
               break; | 
| 263 | 
             // 2003-04-16: required for xmltree-to-item transition | 
             // 2003-04-16: required for xmltree-to-item transition | 
| 264 | 
             // 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 | 
| 296 | 
         create_function('&$_in, &$_out', ' | 
         create_function('&$_in, &$_out', ' | 
| 297 | 
           $vars = array(  | 
           $vars = array(  | 
| 298 | 
             ecom_type, ecom_abstract_type, ecom_mode, ecom_data_locator_key, | 
             ecom_type, ecom_abstract_type, ecom_mode, ecom_data_locator_key, | 
| 299 | 
             ecom_data_ident, ecom_data_meta, ecom_data_filter | 
             ecom_data_ident, ecom_data_meta, ecom_data_filter, ecom_data_meta_x | 
| 300 | 
           ); | 
           ); | 
| 301 | 
           //  ecom_call_method, ecom_call_args | 
           //  ecom_call_method, ecom_call_args | 
| 302 | 
           if($_in[ecom_label]) { | 
           if($_in[ecom_label]) { | 
| 333 | 
           return; | 
           return; | 
| 334 | 
         '), | 
         '), | 
| 335 | 
  | 
  | 
| 336 | 
  | 
         // handle data form action(button) | 
| 337 | 
  | 
         create_function('&$_in, &$_out', ' | 
| 338 | 
  | 
           if($_in[ap] == "Benutzerverwaltung" || $_in[topic] == "Benutzerverwaltung") { | 
| 339 | 
  | 
             if(!$_out[options][ecoms][UMnav]) { | 
| 340 | 
  | 
               $_out[options][ecoms][UMnav] = array( | 
| 341 | 
  | 
                               ecom_type => "nav", | 
| 342 | 
  | 
                               ecom_abstract_type => "tree", | 
| 343 | 
  | 
                               ecom_mode => "link", | 
| 344 | 
  | 
                               ecom_data_locator_key => "rpc", | 
| 345 | 
  | 
                               ); | 
| 346 | 
  | 
             } | 
| 347 | 
  | 
           } | 
| 348 | 
  | 
         '), | 
| 349 | 
  | 
  | 
| 350 | 
         // handle data form action(button) | 
         // handle data form action(button) | 
| 351 | 
         create_function('&$_in, &$_out', ' | 
         create_function('&$_in, &$_out', ' | 
| 352 | 
           $label = $_in[ecom_label]; | 
           $label = $_in[ecom_label]; | 
| 353 | 
           if($_in[ecom_data_form_action] && is_array($_in[ecom_data_form_checkbox])) { | 
           if($_in[ecom_data_form_action]) { | 
| 354 | 
  | 
             //print "from action button pressed!<br>"; | 
| 355 | 
  | 
            if(is_array($_in[ecom_data_form_checkbox])) { | 
| 356 | 
             $cnt = sizeof($_in[ecom_data_form_checkbox]); | 
             $cnt = sizeof($_in[ecom_data_form_checkbox]); | 
| 357 | 
  | 
             $tmp = array(); | 
| 358 | 
  | 
             foreach($_in[ecom_data_form_checkbox] as $ident) { | 
| 359 | 
  | 
                 if($ident) { array_push($tmp, $ident); } | 
| 360 | 
  | 
             } | 
| 361 | 
             if($cnt == 1) { | 
             if($cnt == 1) { | 
| 362 | 
               foreach($_in[ecom_data_form_checkbox] as $ident) { | 
                //print "Single selection, ident : " . $tmp[0] . "<br>"; | 
| 363 | 
                 $_out[options][ecoms][$label][ecom_data_ident] = $ident; | 
                 $_out[options][ecoms][$label][ecom_data_ident] = $tmp[0]; | 
| 364 | 
               } | 
             } 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 { | 
  | 
| 365 | 
               // TODO: implement multi-selection actions on rows(items) here!! | 
               // TODO: implement multi-selection actions on rows(items) here!! | 
| 366 | 
  | 
                 print "Multi-Selection!! Current Ident(s) $tmp" . "<br>"; | 
| 367 | 
  | 
                 $_out[options][ecoms][$label][ecom_data_ident] = $tmp; | 
| 368 | 
             } | 
             } | 
| 369 | 
  | 
            } else { | 
| 370 | 
  | 
              print "ident: " . Dumper($_out[options][ecoms][$label][ecom_data_ident]) . "<br>"; | 
| 371 | 
  | 
            } | 
| 372 | 
  | 
            //$_out[options][ecoms][$label][ecom_data_meta] = $_in[ecom_data_ident];  | 
| 373 | 
  | 
            $_out[options][ecoms][$label][ecom_mode] = $_in[ecom_data_form_action]; | 
| 374 | 
  | 
            $_out[options][ecoms][$label][ecom_abstract_type] = "item"; | 
| 375 | 
           } | 
           } | 
| 376 | 
         '), | 
         '), | 
| 377 | 
  | 
  | 
| 381 | 
           $label = $_in[ecom_label]; | 
           $label = $_in[ecom_label]; | 
| 382 | 
           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"; } | 
| 383 | 
           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"; } | 
| 384 | 
  | 
  | 
| 385 | 
  | 
           // Action.Create  | 
| 386 | 
  | 
           if($_in[ecom_data_action_create]) { | 
| 387 | 
  | 
             print Dumper($_out[options][ecoms][$label]); | 
| 388 | 
  | 
             $_out[options][ecoms][$label][ecom_mode] = "create"; | 
| 389 | 
  | 
           } | 
| 390 | 
            | 
            | 
| 391 | 
           // Action.Delete [new of 2003-04-09] | 
           // Action.Delete [new of 2003-04-09] | 
| 392 | 
           if ($_in[ecom_data_action_delete]) { | 
           if ($_in[ecom_data_action_delete]) { |