295 |
* specify a new path to where your images |
* specify a new path to where your images |
296 |
* live. |
* live. |
297 |
*/ |
*/ |
298 |
var $_image_path = "/phphtmllib/images/widgets"; |
var $_image_path = "img/widgets"; |
299 |
|
|
300 |
|
|
301 |
|
|
302 |
/** |
/** |
303 |
* The constructor |
* The constructor |
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 ); |
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. |
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 |
} |
} |
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 |
/*******************************************/ |
/*******************************************/ |
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 |
|
|