/[cvs]/nfo/php/libs/org.netfrag.app/WebExplorer/MVC.php
ViewVC logotype

Diff of /nfo/php/libs/org.netfrag.app/WebExplorer/MVC.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by jonen, Sat Apr 19 16:20:47 2003 UTC revision 1.19 by jonen, Mon Jul 14 09:54:58 2003 UTC
# Line 4  Line 4 
4   * $Id$   * $Id$
5   *   *
6   * $Log$   * $Log$
7     * Revision 1.19  2003/07/14 09:54:58  jonen
8     * fixed bug related to 'item delete'
9     *
10     * Revision 1.18  2003/07/02 12:18:00  jonen
11     * fixed bugs
12     *
13     * Revision 1.17  2003/06/25 23:45:05  joko
14     * trying to switch from "ap" completely to "t"
15     *
16     * Revision 1.16  2003/05/13 14:53:56  joko
17     * reset mvc-params "filter" and "meta" in tree mode!?
18     *
19     * Revision 1.15  2003/05/10 18:19:55  jonen
20     * + added stuff relating to 'create/add new' links/buttons
21     *
22   * Revision 1.14  2003/04/19 16:20:47  jonen   * Revision 1.14  2003/04/19 16:20:47  jonen
23   * + added handle of ecom 'UMnav' according to page 'Benutzverwaltung'   * + added handle of ecom 'UMnav' according to page 'Benutzverwaltung'
24   *   *
# Line 117  class WebExplorer_MVC extends Site_WebAp Line 132  class WebExplorer_MVC extends Site_WebAp
132          // parameters about data identifiers, locations, sources and associated meta-information          // parameters about data identifiers, locations, sources and associated meta-information
133          'ecom_data_locator_key',          'ecom_data_locator_key',
134          'ecom_data_ident',          'ecom_data_ident',
135          'ecom_data_meta',          'ecom_data_meta', 'ecom_data_meta_x',
136          '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',
137          'ecom_data_form_checkbox', 'ecom_data_form_action',          'ecom_data_form_checkbox', 'ecom_data_form_action',
138          'ecom_data_source_key',          'ecom_data_source_key',
139          'ecom_data_filter',          'ecom_data_filter',
# Line 154  class WebExplorer_MVC extends Site_WebAp Line 169  class WebExplorer_MVC extends Site_WebAp
169            'ecom_data_ident' => array( query_arg => 'ecdid' ),            'ecom_data_ident' => array( query_arg => 'ecdid' ),
170            // e.g. a classname or a filename            // e.g. a classname or a filename
171            'ecom_data_meta' => array( query_arg => 'ecdm' ),            'ecom_data_meta' => array( query_arg => 'ecdm' ),
172              // extended meta, e.g. 2nd parent identifier
173              'ecom_data_meta_x' => array( query_arg => 'ecdmx' ),
174            // filter the data: e.g.            // filter the data: e.g.
175            //    - an xpath-query (xpq),            //    - an xpath-query (xpq),
176            //    - an abstract/custom filter string or            //    - an abstract/custom filter string or
# Line 165  class WebExplorer_MVC extends Site_WebAp Line 182  class WebExplorer_MVC extends Site_WebAp
182            'ecom_data_action_edit' => array( query_arg => 'ecdfe' ),            'ecom_data_action_edit' => array( query_arg => 'ecdfe' ),
183            'ecom_data_action_cancel' => array( query_arg => 'ecdfc' ),            'ecom_data_action_cancel' => array( query_arg => 'ecdfc' ),
184            'ecom_data_action_delete' => array( query_arg => 'ecdfd' ),            'ecom_data_action_delete' => array( query_arg => 'ecdfd' ),
185              'ecom_data_action_create' => array( query_arg => 'ecdfcr' ),
186            // ... required for data lists.            // ... required for data lists.
187            'ecom_data_form_action' => array( query_arg => 'ecdfa' ),            'ecom_data_form_action' => array( query_arg => 'ecdfa' ),
188            'ecom_data_form_checkbox' => array( query_arg => 'checkbox' ),            'ecom_data_form_checkbox' => array( query_arg => 'checkbox' ),
# Line 245  class WebExplorer_MVC extends Site_WebAp Line 263  class WebExplorer_MVC extends Site_WebAp
263            $requestTracker = mkObject("Application::Request::Tracker");            $requestTracker = mkObject("Application::Request::Tracker");
264            $page_state = $requestTracker->getPointer();            $page_state = $requestTracker->getPointer();
265            $pre_out = $page_state[options];            $pre_out = $page_state[options];
266            //print Dumper($pre_out);            //print "pre_out: " . Dumper($pre_out);
267                        
268            // clean-up unwanted variables            // clean-up unwanted variables
269            $label = $_in[ecom_label];            $label = $_in[ecom_label];
270            switch ($_in[ecom_abstract_type]) {            switch ($_in[ecom_abstract_type]) {
271              case "list":              case "list":
272                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]); }
273                  if ($pre_out[options][ecoms][$label][ecom_data_meta_x]) { unset($pre_out[options][ecoms][$label][ecom_data_meta_x]); }
274                break;                break;
275              // 2003-04-16: required for xmltree-to-item transition              // 2003-04-16: required for xmltree-to-item transition
276              // 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
277              case "item":              case "item":
278                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]); }
279                break;                break;
280                case "tree":
281                  if ($pre_out[options][ecoms][$label][ecom_data_filter]) { unset($pre_out[options][ecoms][$label][ecom_data_filter]); }
282                  if ($pre_out[options][ecoms][$label][ecom_data_meta]) { unset($pre_out[options][ecoms][$label][ecom_data_meta]); }
283                  break;
284            }            }
285            $_out = $pre_out;            $_out = $pre_out;
286          '),          '),
# Line 272  class WebExplorer_MVC extends Site_WebAp Line 295  class WebExplorer_MVC extends Site_WebAp
295    
296          // rewrite idents          // rewrite idents
297          create_function('&$_in, &$_out', '          create_function('&$_in, &$_out', '
298            
299              // old version: ap == explorer
300             // map Topic to Page if exists             // map Topic to Page if exists
301             if($_in[topic]) {             //if ($_in[topic]) {
302              $_in[ap] = $_in[topic];             // $_in[ap] = $_in[topic];
303            }             //}          
304            $idents = array ( ap, );            //$idents = array ( ap );
305            foreach($idents as $key) {            //foreach($idents as $key) {
306              $_out[options][idents][$key] = $_in[$key];            //  $_out[options][idents][$key] = $_in[$key];
307            }            //}
308              
309              // 2003-06-26: switched from ap=explorer to t=DataBrowser
310              $_out[options][idents][t] = $_in[topic];
311    
312          '),          '),
313                    
314          // check right $_GET[ap]          // check right $_GET[ap] - depreciated
315          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;'),
316    
317          // write components variables to out          // write components variables to out
318          create_function('&$_in, &$_out', '          create_function('&$_in, &$_out', '
319            $vars = array(            $vars = array(
320              ecom_type, ecom_abstract_type, ecom_mode, ecom_data_locator_key,              ecom_type, ecom_abstract_type, ecom_mode, ecom_data_locator_key,
321              ecom_data_ident, ecom_data_meta, ecom_data_filter              ecom_data_ident, ecom_data_meta, ecom_data_filter, ecom_data_meta_x
322            );            );
323            //  ecom_call_method, ecom_call_args            //  ecom_call_method, ecom_call_args
324            if($_in[ecom_label]) {            if($_in[ecom_label]) {
325              foreach($vars as $key) {              foreach($vars as $key) {
326                if($_in[$key]) {                if($_in[$key]) {
327                    //print "var: " . $key . " value: " . $_in[$key] . "<br>";
328                  $label = $_in[ecom_label];                  $label = $_in[ecom_label];
329                  $_out[options][ecoms][$label][$key] = $_in[$key];                  $_out[options][ecoms][$label][$key] = $_in[$key];
330                }                }
# Line 343  class WebExplorer_MVC extends Site_WebAp Line 373  class WebExplorer_MVC extends Site_WebAp
373          // handle data form action(button)          // handle data form action(button)
374          create_function('&$_in, &$_out', '          create_function('&$_in, &$_out', '
375            $label = $_in[ecom_label];            $label = $_in[ecom_label];
376            if($_in[ecom_data_form_action] && is_array($_in[ecom_data_form_checkbox])) {            if($_in[ecom_data_form_action]) {
377                //print "from action button pressed!<br>";
378               if(is_array($_in[ecom_data_form_checkbox])) {
379              $cnt = sizeof($_in[ecom_data_form_checkbox]);              $cnt = sizeof($_in[ecom_data_form_checkbox]);
380                $tmp = array();
381                foreach($_in[ecom_data_form_checkbox] as $ident) {
382                    if($ident) { array_push($tmp, $ident); }
383                }
384              if($cnt == 1) {              if($cnt == 1) {
385                foreach($_in[ecom_data_form_checkbox] as $ident) {                 print "Single selection, ident : " . $tmp[0] . "<br>";
386                  $_out[options][ecoms][$label][ecom_data_ident] = $ident;                  $_out[options][ecoms][$label][ecom_data_ident] = $tmp[0];
               }  
               $_out[options][ecoms][$label][ecom_data_meta] = $_in[ecom_data_ident];  
               $_out[options][ecoms][$label][ecom_mode] = $_in[ecom_data_form_action];  
387                $_out[options][ecoms][$label][ecom_abstract_type] = "item";                $_out[options][ecoms][$label][ecom_abstract_type] = "item";
388              } else {              } elseif($cnt > 1) {
389                // TODO: implement multi-selection actions on rows(items) here!!                // TODO: implement multi-selection actions on rows(items) here!!
390                    print "Multi-Selection!! Current Ident(s) $tmp" . "<br>";
391                    $_out[options][ecoms][$label][ecom_data_ident] = $tmp;
392                    $_out[options][ecoms][$label][ecom_abstract_type] = "item";
393              }              }
394               } else {
395                 print "ident: " . Dumper($_out[options][ecoms][$label][ecom_data_ident]) . "<br>";
396               }
397               $_out[options][ecoms][$label][ecom_data_meta] = $_in[ecom_data_ident];
398               $_out[options][ecoms][$label][ecom_mode] = $_in[ecom_data_form_action];
399               //print "in: " . Dumper($_in) . "<br>";
400               //print "out: " . Dumper($_out) . "<br>";
401            }            }
402          '),          '),
403    
# Line 362  class WebExplorer_MVC extends Site_WebAp Line 405  class WebExplorer_MVC extends Site_WebAp
405          // handle data form buttons          // handle data form buttons
406          create_function('&$_in, &$_out', '          create_function('&$_in, &$_out', '
407            $label = $_in[ecom_label];            $label = $_in[ecom_label];
408            if($_in[ecom_data_action_edit]) { $_out[options][ecoms][$label][ecom_mode] = "edit"; }            if($_in[ecom_data_action_edit]) {
409            if($_in[ecom_data_action_cancel]) { $_out[options][ecoms][$label][ecom_mode] = "view"; }              $_out[options][ecoms][$label][ecom_mode] = "edit";
410                $_out[options][ecoms][$label][ecom_abstract_type] = "item";
411              }
412              if($_in[ecom_data_action_cancel]) {
413                $_out[options][ecoms][$label][ecom_mode] = "view";
414                $_out[options][ecoms][$label][ecom_abstract_type] = "item";
415              }
416    
417              // Action.Create
418              if($_in[ecom_data_action_create]) {
419                //print Dumper($_out[options][ecoms][$label]);
420                $_out[options][ecoms][$label][ecom_mode] = "create";
421                $_out[options][ecoms][$label][ecom_abstract_type] = "item";
422              }
423                        
424            // Action.Delete [new of 2003-04-09]            // Action.Delete [new of 2003-04-09]
425            if ($_in[ecom_data_action_delete]) {            if ($_in[ecom_data_action_delete]) {
# Line 374  class WebExplorer_MVC extends Site_WebAp Line 430  class WebExplorer_MVC extends Site_WebAp
430              // 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?
431              // look at ecom/FlexibleDataItem!              // look at ecom/FlexibleDataItem!
432    
433                $_out[options][ecoms][$label][ecom_abstract_type] = "item";
434            }            }
           
435          '),          '),
436    
437          // propagate datasources to ecoms          // propagate datasources to ecoms

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.19

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed