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

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

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

revision 1.11 by jonen, Sat May 10 17:58:45 2003 UTC revision 1.13 by jonen, Thu Oct 7 14:17:50 2004 UTC
# Line 4  Line 4 
4  ##    $Id$  ##    $Id$
5  ## -------------------------------------------------------------------------  ## -------------------------------------------------------------------------
6  ##    $Log$  ##    $Log$
7    ##    Revision 1.13  2004/10/07 14:17:50  jonen
8    ##    + pass filter-values to backend now! (page-control!)
9    ##
10    ##    Revision 1.12  2004/05/06 17:14:35  jonen
11    ##     updated
12    ##
13  ##    Revision 1.11  2003/05/10 17:58:45  jonen  ##    Revision 1.11  2003/05/10 17:58:45  jonen
14  ##    + reworked to implement 'create/add new' item  ##    + reworked to implement 'create/add new' item
15  ##  ##
# Line 102  class GenericGUIDataList extends Default Line 108  class GenericGUIDataList extends Default
108    
109      // call parent constructor      // call parent constructor
110      $parent =  get_parent_class($this);      $parent =  get_parent_class($this);
111      $this->$parent($title, $width = "100%", $default_orderby='', $default_reverseorder=FALSE);          $this->$parent($title, $width = "100%", $default_orderby='', $default_reverseorder=FALSE);
112    }    }
113    
114    
# Line 138  class GenericGUIDataList extends Default Line 144  class GenericGUIDataList extends Default
144        // V5:        // V5:
145        //print "options: " . Dumper($this->_options);        //print "options: " . Dumper($this->_options);
146                
147    
148              //HACK 2004-10-07: page-filter done by backend now,
149              //                 filter-values are passed to backend
150          $this->_options['data_locator_meta']['filter']['offset'] = $this->offset();
151          $this->_options['data_locator_meta']['filter']['numrows'] = $this->numrows();
152          $this->_options['data_locator_meta']['filter']['search_field'] = $this->search_field();
153          $this->_options['data_locator_meta']['filter']['search_value'] = $this->search_value();
154          $this->_options['data_locator_meta']['filter']['search_modifier'] = $this->simple_search_modifier_value();
155          
156          //$this->_set("offsetVar", 0);
157          
158        $initial_locator = php::mkComponent( 'DataSource::Locator', array( adapter_type => 'phpHtmlLib' ) );        $initial_locator = php::mkComponent( 'DataSource::Locator', array( adapter_type => 'phpHtmlLib' ) );
159        //print "1st locator: " . Dumper($initial_locator);        //print "1st locator: " . Dumper($initial_locator);
160                
# Line 161  class GenericGUIDataList extends Default Line 178  class GenericGUIDataList extends Default
178        $source = $proxy->get_adapter();        $source = $proxy->get_adapter();
179    
180        // V4:        // V4:
181            //$source = $this->_datasource;              //$source = $this->_datasource;
182          
183        //print "objectlist-source: " . Dumper($source);        //print "objectlist-source: " . Dumper($source);
184        //exit;        //exit;
185    
# Line 179  class GenericGUIDataList extends Default Line 196  class GenericGUIDataList extends Default
196                        
197          //print Dumper($source);          //print Dumper($source);
198            $headers = $source->get_header();            $headers = $source->get_header();
199            //print Dumper($headers);            //print "headers: " . Dumper($headers);
200                        
201            $this->set_title( $this->get_title() . ' - ' . $source->get_total_rows() . ' Einträge' );            $this->set_title( $this->get_title() . ' - ' . $source->get_total_rows() . ' Einträge' );
202                        
203            foreach($headers as $val) {            foreach($headers as $val) {
204                  $this->add_header_item($val, "150", $val, SORTABLE, SEARCHABLE);                  $this->add_header_item($val, "150", $val, SORTABLE, SEARCHABLE);
205      }      }
206        
207    
208  /*  /*
209          $this->add_header_item("Uid", "200", "uid", SORTABLE, SEARCHABLE);          $this->add_header_item("Uid", "200", "uid", SORTABLE, SEARCHABLE);
# Line 209  class GenericGUIDataList extends Default Line 227  class GenericGUIDataList extends Default
227       * @return TDtag object       * @return TDtag object
228       */       */
229     function wrap_column_item($obj, $col_name, $row_data) {     function wrap_column_item($obj, $col_name, $row_data) {
230        
231            //print "item: " . Dumper($obj) . "<br>";
232    
233          //make sure its set to something.          //make sure its set to something.
234          if ($obj == '') {          if ($obj == '') {
# Line 406  class GenericGUIDataList extends Default Line 426  class GenericGUIDataList extends Default
426    
427      /**      /**
428       * this is the method that builds       * this is the method that builds
429       * the contents for the 'create new' actionbar       * the contents for the buttons of actionbar
430       * td cell.       * td cell.
431       *       *
432       * @return ContainerWidget object       * @return ContainerWidget object
433       */       */
434      function actionbar_cell_new() {      function actionbar_cell_new() {
435          $action_create = $this->_options['actionbar']['create'];          $action_buttons = $this->_options['actionbar']['buttons'];
436    
437          if(is_array($action_create)) {          if(is_array($action_buttons)) {
438            $action_form = container(            $action_form = container();
439              foreach($action_buttons as $type) {
440                $action_form->add(
441                               _HTML_SPACE,                               _HTML_SPACE,
442                               form_submit($action_create['name'], $action_create['value'])                               form_submit($type['name'], $type['value'])
443                               );                               );
444              }
445            return $action_form;            return $action_form;
446          } else {          } else {
447            return _HTML_SPACE;            return _HTML_SPACE;
# Line 470  class GenericGUIDataList extends Default Line 493  class GenericGUIDataList extends Default
493          if ( $this->_show_results() ) {          if ( $this->_show_results() ) {
494              $this->data_prefetch();              $this->data_prefetch();
495          }          }
496            
497          //This function gives the child class          //This function gives the child class
498          //a chance to build the tables/divs/containers          //a chance to build the tables/divs/containers
499          //that will be responsible for the look/feel          //that will be responsible for the look/feel
# Line 541  class GenericGUIDataList extends Default Line 564  class GenericGUIDataList extends Default
564    
565          function child_add_row_cell($obj, $col_name, $last_in_row_flag, $row_data) {          function child_add_row_cell($obj, $col_name, $last_in_row_flag, $row_data) {
566          if (!$this->_cur_col_cntr) {          if (!$this->_cur_col_cntr) {
567            //if (!isset($this->_cur_col_cntr)) {
568              $this->_cur_col_cntr = 1;              $this->_cur_col_cntr = 1;
569              //lets see if we need to add an action column              //lets see if we need to add an action column
570              //as the first column.              //as the first column.

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.13

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