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

Diff of /nfo/php/libs/org.netfrag.app/WebExplorer/Module/DataItem.php

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

revision 1.1 by jonen, Fri Apr 4 00:50:44 2003 UTC revision 1.8 by jonen, Sun Dec 14 01:53:15 2003 UTC
# Line 4  Line 4 
4  ##    $Id$  ##    $Id$
5  ##    -----------------------------------------------------------------------------  ##    -----------------------------------------------------------------------------
6  ##    $Log$  ##    $Log$
7    ##    Revision 1.8  2003/12/14 01:53:15  jonen
8    ##    implemented 'SELECT' mode for selecting existing object-refereneces as child-nodes
9    ##
10    ##    Revision 1.7  2003/11/22 18:44:41  udo
11    ##    update for expand data item
12    ##
13    ##    Revision 1.6  2003/05/13 14:55:52  joko
14    ##    parameters for MetaBox
15    ##
16    ##    Revision 1.5  2003/05/10 18:27:17  jonen
17    ##    + supports now mode 'create' via widget 'CreateDataItem'
18    ##
19    ##    Revision 1.4  2003/04/11 00:52:19  joko
20    ##    minor update: prepared for being one level more abstract by using $negotiation_options
21    ##
22    ##    Revision 1.3  2003/04/10 06:27:36  joko
23    ##    ++ _args[mode] == 'delete'  =>  new FlexibleDataItem
24    ##
25    ##    Revision 1.2  2003/04/06 01:33:45  jonen
26    ##    + purged code
27    ##
28  ##    Revision 1.1  2003/04/04 00:50:44  jonen  ##    Revision 1.1  2003/04/04 00:50:44  jonen
29  ##    + initial commit  ##    + initial commit
30  ##  ##
# Line 14  Line 35 
35  ##    -----------------------------------------------------------------------------  ##    -----------------------------------------------------------------------------
36  */  */
37    
38    
39    loadModule('WebExplorer::Module::AbstractGUIModule');
40    
41  class WebExplorer_Module_DataItem extends WebExplorer_Module_AbstractGUIModule {  class WebExplorer_Module_DataItem extends WebExplorer_Module_AbstractGUIModule {
42    
43    
44    function set_gui_object() {    function set_gui_object() {
45      if($this->_args['mode'] == 'view') {  
46        // NEW [2003-04-22]: inject metadata about chooser (item|list|tree) into _args[options]
47        // Please visit WebExplorer::Module::DataTree - there is a similar chooser at the top!!!
48        // TODO: abstract this out into some reusable, generic component sometimes (SimpleChooser?)
49        $this->_args[options][links] = array(
50          'list' => array(
51            array( name => 'item', url => url::view_as('item') ),
52            array( name => 'tree', url => url::view_as('tree', array( ecdid => $_GET[ecdm] )) ),
53            //array( name => 'reset filter', url => url::filter('tree') ),
54          ),
55          'meta' => array(
56            'selected' => $this->_args[options][data_locator_meta][abstract_type]
57          )
58        );
59        
60        // debug
61        //print Dumper($this->_args) . "<br>";
62    
63        
64        if($this->_args['mode'] == 'view') {
65        $this->_gui_object = new DataItem($this->_args['caption'], $this->_args['options']);        $this->_gui_object = new DataItem($this->_args['caption'], $this->_args['options']);
66      }      }
67      elseif($this->_args['mode'] == 'edit') {      elseif($this->_args['mode'] == 'edit') {
68       $this->_gui_object = new EditDataItem($this->_args['caption'], $this->_args['options'] );       $this->_gui_object = new EditDataItem($this->_args['caption'], $this->_args['options'] );
69        }
70        elseif($this->_args['mode'] == 'delete') {
71         // 'EditDataItem' already has an infrastructure to do "Confirm"ations,
72         // so we just try to use it here to let the user confirm the new "delete"-action.
73        
74         // TODO:
75         // Try to implement this aspect of the required infrastructure independent of
76         // an 'EditDataItem'. Maybe it should become a 'GenericNegotiation'-ecom-component?!
77         // Aim: Abstract way of handling 'Confirm', 'Cancel' actions on arbitrary "question"???
78         $negotiation_options = array(
79         );
80        
81         $this->_gui_object = new FlexibleNegotiation($this->_args['caption'], $this->_args['options'], $negotiation_options );
82      }      }
   }  
83        
84  /*      elseif($this->_args['mode'] == 'create') {
85    function view_DataItem() {       $this->_gui_object = new CreateDataItem($this->_args['caption'], $this->_args['options'] );
86        $initial_locator = php::mkComponent( 'DataSource::Locator', array( adapter_type => 'phpHtmlLib' ) );      }
87        $proxy = php::mkComponent('DataSource::Generic', $initial_locator, $this->_args['options']['data_locator_meta']);      // added this for full expanded objects
88        $source = $proxy->get_adapter();      elseif($this->_args['mode'] == 'expand') {
89        $source->do_query();       $this->_gui_object = new ExpandDataItem($this->_args['caption'], $this->_args['options'] );
90        $result = $source->_result;      }
91      //print Dumper($source->_result);      elseif($this->_args['mode'] == 'expandedit') {
92         $this->_gui_object = new ExpandEditDataItem($this->_args['caption'], $this->_args['options'] );
     $table = new InfoTable($this->_args['caption'], $width="100%", "center");  
     if (is_array($result)) {  
       foreach($result as $key => $value) {  
         if(!$value) { $value = "&nbsp;"; }  
         $table->add_row(span_font10bold($key), $value);  
       }  
93      }      }
94      // build submit form      elseif($this->_args['mode'] == 'select') {
95      $container = container(       $this->_gui_object = new EditDataItem($this->_args['caption'], $this->_args['options'] );
96                      form_open($this->_args['caption'], $_SERVER['PHP_SELF'], 'POST'),      }
                     form_submit('ecitem', "edit"),  
                     form_close()  
                     );  
     //$table->add_row(div_build_spacergif_tag(), $container);  
     $table->add_row("&nbsp;", $container);  
     return $table;  
97    }    }
98  */  
     
99    
100  }  }
101    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.8

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