mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
Add UIBlocks to twig (WIP)
This commit is contained in:
@@ -46,6 +46,8 @@ class Field extends UIBlock
|
||||
protected $sValueRaw;
|
||||
/** @var string */
|
||||
protected $sLabel;
|
||||
/** @var string */
|
||||
protected $sValueId;
|
||||
/**
|
||||
* Could be Input, but we have legacy code that needs to set raw HTML !
|
||||
*
|
||||
@@ -60,6 +62,7 @@ class Field extends UIBlock
|
||||
parent::__construct($sId);
|
||||
$this->sLabel = $sLabel;
|
||||
$this->oValue = $oValue;
|
||||
$this->sValueId = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -341,4 +344,24 @@ class Field extends UIBlock
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function GetValueId(): ?string
|
||||
{
|
||||
return $this->sValueId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $sValueId
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function SetValueId(?string $sValueId)
|
||||
{
|
||||
$this->sValueId = $sValueId;
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -71,4 +71,20 @@ class FieldFactory
|
||||
|
||||
return $oField;
|
||||
}
|
||||
|
||||
public static function MakeLarge(string $sLabel, $sValueHtml)
|
||||
{
|
||||
$oField = new Field($sLabel, new Html($sValueHtml));
|
||||
$oField->SetLayout(Field::ENUM_FIELD_LAYOUT_LARGE);
|
||||
return $oField;
|
||||
}
|
||||
|
||||
public static function MakeSmall(string $sLabel, $sValueHtml)
|
||||
{
|
||||
$oField = new Field($sLabel, new Html($sValueHtml));
|
||||
$oField->SetLayout(Field::ENUM_FIELD_LAYOUT_SMALL);
|
||||
return $oField;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user