Location: PHPKode > scripts > phpSortable > phpsortable/phpSortable/class.phpSortColumn.php
<?php

/**
 * The phpSortColumn class 
 * 
 * Help class for the phpSortable class.<br> 
 * Defines the structure of the table columns.<br><br> 
 * 
 * last review: 04.02.07 <br><br>
 * 
 * @author Wagner O. Wutzke 
 * 
 * @version 2.0 
 * 
 * @link http://www.phpclasses.org/browse/package/3704.html
 *
 * @package phpSortable 
 * 
 */

class phpSortColumn {
	
	/**
	 * @var string the name of the column at the MySQL table
	 */
	var $name = "";
	
	/**
	 * @var string the Titel of the column at the HTML table
	 */
	var $title = "";
	
	/**
	 * @var string the format function to be called on formating this column data.
	 * The function shall output some string, calling echo or print functions after 
	 * formating the read data.
	 * The string should have a $readVal variable as parameter. If it has other parameter,
	 * thex can be also be given hier.<br> Example: "myFunction($readVal, \"hallo!\", 2)".
	 */
	var $formatFunction = "";
	
	/**
	 * @var string data type for this column. Until now "date", "link" or "" are possible.
	 */
	var $type = "";
	
	/**
	 * @var string if data type for this column is "link", the desired 
	 * link should be given hier. Normally the urlKey and the 
	 * corresponding data are appended to this link.
	 */
	var $link = "";
	
	/**
	 * @var string if data type for this column is "link",
	 * it is possible to show an image as a button for the link.
	 * Hier should the full image path be given.
	 */
	var $img = "";
	
	/**
	 * @var bool if it is set true, the column name and the 
	 * current column data are appended to this link.
	 */
	var $appendDataToLink = "";
	
	/**
	 * @var string target window for the opened link
	 */
	var $target = "";
	
	/**
	 * @var string expression to be evaluated. If the expression is true, doesnt show the cell content
	 */
	var $dontShowIf = "";
	
	/**
	 * @var string second key name to be added to the url links
	 */
	var $secondKey = "";
	
	/**
	 * @var string name of the table column to used as second key value
	 */
	var $secondKeyColumn = "";
	
	
	/**
	 * @access public
	 * @return phpSortColumn default constructor for this class
	 */
	public function __construct 
	($name, $title, $formatFunction="", $type="", $link="", $img="", $appendDataToLink=false, $target="", $dontShowIf="", $secondKey="", $secondKeyColumn="") {
		$this->name = $name;
		$this->title = $title;
		$this->formatFunction = $formatFunction;
		$this->type = $type;
		$this->link = $link;
		$this->target = $target;
		$this->appendDataToLink = $appendDataToLink;
		$this->img = $img;
		$this->dontShowIf = $dontShowIf;
		$this->secondKey = $secondKey;
		$this->secondKeyColumn = $secondKeyColumn;
	}
}
?>
Return current item: phpSortable