/[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.3 by jonen, Sun Apr 6 01:40:35 2003 UTC revision 1.5 by jonen, Sat May 10 18:07:31 2003 UTC
# Line 4  Line 4 
4  ##    $Id$  ##    $Id$
5  ##    -----------------------------------------------------------------------------  ##    -----------------------------------------------------------------------------
6  ##    $Log$  ##    $Log$
7    ##    Revision 1.5  2003/05/10 18:07:31  jonen
8    ##    + added values needed for 'create/add new' links
9    ##    - purged depreciated code
10    ##
11    ##    Revision 1.4  2003/04/09 09:53:13  joko
12    ##    fixes regarding modification of decode-function-behavior
13    ##
14  ##    Revision 1.3  2003/04/06 01:40:35  jonen  ##    Revision 1.3  2003/04/06 01:40:35  jonen
15  ##    + removed duplicated decode functions  ##    + removed duplicated decode functions
16  ##  ##
# Line 112  class DataItem extends InfoTable { Line 119  class DataItem extends InfoTable {
119     $result = $this->_datasource->_result;     $result = $this->_datasource->_result;
120      if (is_array($result)) {      if (is_array($result)) {
121        foreach($result as $key => $value) {        foreach($result as $key => $value) {
122          if(!$value) { $value = _HTML_SPACE; }          // set empty values to 'html spacer' for render
123          // if item is match by expression we will replace it with an link object            // TODO: integer value '0' is interpretted as non-existing value! Hack this!!
124            if(!$value && !is_array($value)) { $value = _HTML_SPACE; }
125            // if decode options are true, trie to decode values(e.g. for inhiterance)
126          if($this->_options['decode']) {          if($this->_options['decode']) {
127           $utils = php::mkComponent('WebExplorer::utils');            $utils = php::mkComponent('WebExplorer::utils');
128           $hidden = $this->_hidden_elements;            $hidden = $this->_hidden_elements;
129           $options = $this->_options['decode_args'];            $options = $this->_options['decode_args'];
130           if($utils->decode_item_expr($value, $hidden, $options)) {              $options[label] = $key;
131            $this->add_element($key, $utils->decode_item_expr($value, $hidden, $options));              $options[parent_guid] = $this->_options['parent']['guid'];
132            }              $options[parent_class] = $this->_options['parent']['class'];
133            // if item is an Array we will replace it with an selection form object              // if item is matched by a special expression we will replace it with an html-link object  
134            elseif($utils->decode_item_array($value, $hidden, $options) ) {            $utils->decode_item_expr($value, $hidden, $options);
135              $this->add_element($key, $utils->decode_item_array($value, $hidden, $options));            // if item is an Array we will replace it with an html-link object  
136            } else {            $utils->decode_item_array($value, $hidden, $options);
137              $this->add_element($key, $value);            $this->add_element($key, $value);
           }  
138          } else {          } else {
139            $this->add_element($key, $value);            $this->add_element($key, $value);
140          }          }

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

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