mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-01 14:38:47 +02:00
Prerequisites to the custom fields
SVN:trunk[3940]
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
|
||||
namespace Combodo\iTop\Form\Field;
|
||||
|
||||
use \Closure;
|
||||
use \DBObject;
|
||||
use \Combodo\iTop\Form\Field\TextField;
|
||||
|
||||
/**
|
||||
@@ -28,5 +30,81 @@ use \Combodo\iTop\Form\Field\TextField;
|
||||
*/
|
||||
class TextAreaField extends TextField
|
||||
{
|
||||
const ENUM_FORMAT_TEXT = 'text';
|
||||
const ENUM_FORMAT_HTML = 'html';
|
||||
const DEFAULT_FORMAT = 'html';
|
||||
|
||||
protected $sFormat;
|
||||
protected $oObject;
|
||||
protected $sTransactionId;
|
||||
|
||||
public function __construct($sId, Closure $onFinalizeCallback = null, DBObject $oObject = null)
|
||||
{
|
||||
parent::__construct($sId, $onFinalizeCallback);
|
||||
$this->sFormat = static::DEFAULT_FORMAT;
|
||||
$this->oObject = $oObject;
|
||||
$this->sTransactionId = null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function GetFormat()
|
||||
{
|
||||
return $this->sFormat;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $sFormat
|
||||
* @return \Combodo\iTop\Form\Field\TextAreaField
|
||||
*/
|
||||
public function SetFormat($sFormat)
|
||||
{
|
||||
$this->sFormat = $sFormat;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return DBObject
|
||||
*/
|
||||
public function GetObject()
|
||||
{
|
||||
return $this->oObject;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param DBObject $oObject
|
||||
* @return \Combodo\iTop\Form\Field\TextAreaField
|
||||
*/
|
||||
public function SetObject(DBObject $oObject)
|
||||
{
|
||||
$this->oObject = $oObject;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the transaction id for the field. This is usally used/setted when using a html format that allows upload of files/images
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function GetTransactionId()
|
||||
{
|
||||
return $this->sTransactionId;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $sTransactionId
|
||||
* @return \Combodo\iTop\Form\Field\TextAreaField
|
||||
*/
|
||||
public function SetTransactionId($sTransactionId)
|
||||
{
|
||||
$this->sTransactionId = $sTransactionId;
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user