/[cvs]/nfo/php/libs/com.newsblob.phphtmllib/widgets/data_list/DataList.inc
ViewVC logotype

Diff of /nfo/php/libs/com.newsblob.phphtmllib/widgets/data_list/DataList.inc

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

revision 1.2 by jonen, Fri Jan 31 08:47:12 2003 UTC revision 1.3 by jonen, Mon Feb 3 16:21:09 2003 UTC
# Line 296  class DataList extends BaseWidget { Line 296  class DataList extends BaseWidget {
296           * live.           * live.
297           */           */
298          var $_image_path = "img/widgets";          var $_image_path = "img/widgets";
299            
300            
301    
302          /**          /**
303           * The constructor           * The constructor
# Line 306  class DataList extends BaseWidget { Line 307  class DataList extends BaseWidget {
307           * @param string - the column to use as the default sorting order           * @param string - the column to use as the default sorting order
308           * @param boolean - sort the default column in reverse order?           * @param boolean - sort the default column in reverse order?
309           */           */
310          function DataList($title, $width = "100%", $default_orderby='',          function DataList($title, $width = "100%", $default_orderby='',
311                                            $default_reverseorder=FALSE) {                                            $default_reverseorder=FALSE ) {
312                  $this->set_title( $title );                  $this->set_title( $title );
313                  $this->set_form_name( str_replace(' ', '_', strtolower($title)) );                  $this->set_form_name( str_replace(' ', '_', strtolower($title)) );
314                  $this->set_width( $width );                  $this->set_width( $width );
# Line 320  class DataList extends BaseWidget { Line 321  class DataList extends BaseWidget {
321                  }                  }
322          $this->_default_reverseorder = $default_reverseorder;          $this->_default_reverseorder = $default_reverseorder;
323    
   
324          //Set the global prefix for our variables.          //Set the global prefix for our variables.
325          //want to make sure we can have multiple          //want to make sure we can have multiple
326          //item lists per html page.          //item lists per html page.
# Line 444  class DataList extends BaseWidget { Line 444  class DataList extends BaseWidget {
444                                                  $obj = $this->_clean_string($obj, $col_name);                                                  $obj = $this->_clean_string($obj, $col_name);
445                      }                      }
446                                          //                                          //
447                                          $this->child_add_row_cell($obj, $col_name, ($cnt == $col_count) ? TRUE : FALSE);                                          $this->child_add_row_cell($obj, $col_name, ($cnt == $col_count) ? TRUE : FALSE );
448                                          $cnt++;                                          $cnt++;
449                                  }                                  }
450                          }                          }
# Line 1079  class DataList extends BaseWidget { Line 1079  class DataList extends BaseWidget {
1079                  return (int) $_REQUEST[$this->_showallVar];                  return (int) $_REQUEST[$this->_showallVar];
1080      }      }
1081    
     /**  
      * This is the basic function for letting us  
      * do a mapping between the column name in  
      * the header, to the value found in the DB.  
      *  
      * NOTE: this function is meant to be overridden  
      *       so that you can push whatever you want.  
      *  
      * @param array - $row_data - the entire data for the row  
      * @param string - $col_name - the name of the column header  
      *                             for this row to render.  
      * @return  mixed - either a HTMLTag object, or raw text.  
      */  
     function build_column_item($row_data, $col_name) {  
         $key = $this->_columns[$col_name]["data_name"];  
   
         if ($row_data[$key] == '') {  
             return " ";  
         } else {  
             return $this->_filter_column_string($row_data[$key]);  
         }  
     }  
   
   
     /**  
      * This does some magic filtering on the data  
      * that we display in a column.  This helps  
      * to prevent nast data that may have html  
      * tags in it.  
      *  
      * @param string - the column data u want to filter  
      * @return string the cleaned/filtered data  
      */  
     function _filter_column_string($data) {  
         return htmlspecialchars(trim($data));  
     }  
1082    
1083    
1084          /*******************************************/          /*******************************************/
# Line 1678  class DataList extends BaseWidget { Line 1642  class DataList extends BaseWidget {
1642       * @return string the cleaned/filtered data       * @return string the cleaned/filtered data
1643       */       */
1644      function filter_column_string($data) {      function filter_column_string($data) {
1645          return htmlspecialchars(trim($data));          // WAS: return htmlspecialchars(trim($data));
1646            
1647            // NEW: require 'flib/Application/i18n/TextEncode.php'
1648            //  this will do a 'htmlentities' RECURSIVE on each item
1649            $encoder = new TextEncode($data);
1650            $encoder->toHTML();
1651            return $data;
1652      }      }
1653                    
1654    

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

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