mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 09:38:48 +02:00
N°3537 run_query : use Field instead of InputWithLabel
This commit is contained in:
@@ -10,36 +10,46 @@ namespace Combodo\iTop\Application\UI\Base\Component\Input;
|
||||
|
||||
use Combodo\iTop\Application\UI\Base\UIBlock;
|
||||
|
||||
/**
|
||||
* You might want to use a {@link \Combodo\iTop\Application\UI\Base\Component\Field\Field} component instead...
|
||||
*
|
||||
* @package Combodo\iTop\Application\UI\Base\Component\Input
|
||||
*/
|
||||
class InputWithLabel extends UIBlock
|
||||
{
|
||||
public const DEFAULT_HTML_TEMPLATE_REL_PATH = 'base/components/input/inputwithlabel';
|
||||
|
||||
/** @var string */
|
||||
protected $sLabel;
|
||||
/** @var \Combodo\iTop\Application\UI\Base\Component\Input\AbstractInput */
|
||||
/** @var \Combodo\iTop\Application\UI\Base\Component\Input\Input */
|
||||
protected $oInput;
|
||||
/** @var bool */
|
||||
protected $bHasBr;
|
||||
|
||||
public function __construct(string $sLabel, AbstractInput $oInput, ?string $sId, ?bool $bHasBr = null)
|
||||
/**
|
||||
* @param string $sLabel
|
||||
* @param \Combodo\iTop\Application\UI\Base\Component\Input\AbstractInput $oInput
|
||||
* @param string|null $sId
|
||||
*/
|
||||
public function __construct(string $sLabel, AbstractInput $oInput, ?string $sId)
|
||||
{
|
||||
parent::__construct($sId);
|
||||
$this->sLabel = $sLabel;
|
||||
$this->oInput = $oInput;
|
||||
|
||||
if (is_null($bHasBr)) {
|
||||
$this->bHasBr = ($oInput instanceof TextArea);
|
||||
} else {
|
||||
$this->bHasBr = $bHasBr;
|
||||
}
|
||||
}
|
||||
|
||||
public function GetInput(): AbstractInput
|
||||
/**
|
||||
* @return \Combodo\iTop\Application\UI\Base\Component\Input\AbstractInput
|
||||
*/
|
||||
public function GetInput()
|
||||
{
|
||||
return $this->oInput;
|
||||
}
|
||||
|
||||
public function SetInput(AbstractInput $oInput): InputWithLabel
|
||||
/**
|
||||
* @param \Combodo\iTop\Application\UI\Base\Component\Input\AbstractInput $oInput
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function SetInput(AbstractInput $oInput)
|
||||
{
|
||||
$this->oInput = $oInput;
|
||||
|
||||
@@ -63,12 +73,6 @@ class InputWithLabel extends UIBlock
|
||||
public function SetLabel(string $sLabel): InputWithLabel
|
||||
{
|
||||
$this->sLabel = $sLabel;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function HasBr(): bool
|
||||
{
|
||||
return $this->bHasBr;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user