Prerequisites to the custom fields

SVN:trunk[3940]
This commit is contained in:
Guillaume Lajarige
2016-03-09 16:58:31 +00:00
parent ced87e71cb
commit daa090d4fe
9 changed files with 188 additions and 54 deletions

View File

@@ -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;
}
}