. */ /** * Simple date column */ require_once(ROOTPATH."include/list/TextColumn.php"); abstract class AjaxLinkColumn extends TextColumn { protected $linkText; protected $image; /** * Constructor * * @param string name of the column (as provided in the parameter of getCellValue()) * @param string header value * @param string text of link, or alt/title of image when present * @param string type of image */ public function __construct($name, $header, $linkText, $image=NULL) { parent::__construct($name, $header); $this->linkText = $linkText; $this->image = $image; } public function getCellValue($rowNum, $row) { if( $this->isVisible($row) ) { if( $this->image==NULL ) { $displayLink = $this->linkText; }else { $displayLink = IconHelper::getIcon($this->image, $this->linkText); } if( $this->isEnabled($row) ) { return "getJsLink($row)."\">".$displayLink.""; }else { return "".$displayLink.""; } }else { return ""; } } protected function isEnabled($row) { return true; } protected function isVisible($row) { return true; } protected abstract function getJsLink($row); } ?>