/[cvs]/nfo/php/libs/org.netfrag.patches/phphtmllib/widgets/DataItem.php
ViewVC logotype

Diff of /nfo/php/libs/org.netfrag.patches/phphtmllib/widgets/DataItem.php

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

revision 1.5 by jonen, Sat May 10 18:07:31 2003 UTC revision 1.7 by udo, Sat Nov 22 18:40:58 2003 UTC
# Line 4  Line 4 
4  ##    $Id$  ##    $Id$
5  ##    -----------------------------------------------------------------------------  ##    -----------------------------------------------------------------------------
6  ##    $Log$  ##    $Log$
7    ##    Revision 1.7  2003/11/22 18:40:58  udo
8    ##    bug fix
9    ##
10    ##    Revision 1.6  2003/05/13 16:24:30  joko
11    ##    title addendum
12    ##    MetaBox - header style
13    ##
14  ##    Revision 1.5  2003/05/10 18:07:31  jonen  ##    Revision 1.5  2003/05/10 18:07:31  jonen
15  ##    + added values needed for 'create/add new' links  ##    + added values needed for 'create/add new' links
16  ##    - purged depreciated code  ##    - purged depreciated code
# Line 45  class DataItem extends InfoTable { Line 52  class DataItem extends InfoTable {
52    function DataItem($title, $options = array()) {    function DataItem($title, $options = array()) {
53      $this->_options = $options;      $this->_options = $options;
54    
55      $parent =  get_parent_class($this);      //print "title: $title<br/>";
56        //print "options:" . Dumper($options) . "<br>";
57    
58        $title .= $this->get_title_addendum();
59    
60        $parent =  get_parent_class($this);    
61        // debug (WARNNING!!! Sometime an recursive loop happens here
62        //        if class $parent is eq current class!!)
63        //print "parent: " . Dumper($parent) . "<br>";
64        
65      $this->$parent($title, $width="100%", "center");      $this->$parent($title, $width="100%", "center");
66    
67      // fetch data      // fetch data
# Line 95  class DataItem extends InfoTable { Line 111  class DataItem extends InfoTable {
111    }    }
112    
113    function get_data_source() {    function get_data_source() {
114        
115        $initial_locator = php::mkComponent( 'DataSource::Locator', array( adapter_type => 'phpHtmlLib' ) );        $initial_locator = php::mkComponent( 'DataSource::Locator', array( adapter_type => 'phpHtmlLib' ) );
116        $proxy = php::mkComponent('DataSource::Generic', $initial_locator, $this->_options['data_locator_meta']);        $proxy = php::mkComponent('DataSource::Generic', $initial_locator, $this->_options['data_locator_meta']);
117        $source = $proxy->get_adapter();        $source = $proxy->get_adapter();
# Line 126  class DataItem extends InfoTable { Line 143  class DataItem extends InfoTable {
143          if($this->_options['decode']) {          if($this->_options['decode']) {
144            $utils = php::mkComponent('WebExplorer::utils');            $utils = php::mkComponent('WebExplorer::utils');
145            $hidden = $this->_hidden_elements;            $hidden = $this->_hidden_elements;
146            $options = $this->_options['decode_args'];            $options = $this->_options['decode_args'];          
147            $options[label] = $key;            $options[label] = $key;
148            $options[parent_guid] = $this->_options['parent']['guid'];            $options[parent_guid] = $this->_options['parent']['guid'];
149            $options[parent_class] = $this->_options['parent']['class'];            $options[parent_class] = $this->_options['parent']['class'];
# Line 134  class DataItem extends InfoTable { Line 151  class DataItem extends InfoTable {
151            $utils->decode_item_expr($value, $hidden, $options);            $utils->decode_item_expr($value, $hidden, $options);
152            // if item is an Array we will replace it with an html-link object              // if item is an Array we will replace it with an html-link object  
153            $utils->decode_item_array($value, $hidden, $options);            $utils->decode_item_array($value, $hidden, $options);
154              
155            $this->add_element($key, $value);            $this->add_element($key, $value);
156          } else {          } else {
157            $this->add_element($key, $value);            $this->add_element($key, $value);
# Line 170  class DataItem extends InfoTable { Line 188  class DataItem extends InfoTable {
188    }    }
189    
190    
191      // Please visit WebExplorer::Module::DataItem - there is a similar chooser at the top!!!
192      // TODO: abstract this out into some reusable, generic component sometimes (SimpleChooser?)
193      // (also take a look at WebExplorer::Module::DataTree)
194      function get_title_addendum() {
195        
196        // MetaBox / Chooser - resolve / display some links which probably have been declared in some other layer
197        //$this->header = html_span();
198    
199        // Build a header-style MetaBox.
200        // This will get injected into the header of the DataItem.
201        $this->header_box = php::mkComponent('MetaBox', array(
202          box_mode => 'header',
203          caption => $this->_options['caption'],
204          payload => $this->_options['links'],
205        ) );
206    
207        return $this->header_box->render();
208        
209      }
210    
211  }  }
212    
213    

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.7

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