namespace Combodo\iTop\Application\Dashlet\Base; use Combodo\iTop\Application\Dashlet\Dashlet; use Combodo\iTop\Application\UI\Base\Component\Dashlet\DashletFactory; use DesignerForm; use DesignerTextField; use Dict; use utils; class DashletHeaderStatic extends Dashlet { /** * @inheritdoc */ public function __construct($oModelReflection, $sId) { parent::__construct($oModelReflection, $sId); $this->aProperties['title'] = Dict::S('UI:DashletHeaderStatic:Prop-Title:Default'); // TODO 3.3 default icon $this->aProperties['icon'] = null; } /** * @inheritdoc */ public function Render($oPage, $bEditMode = false, $aExtraParams = []) { $sTitle = $this->aProperties['title']; $sIcon = $this->aProperties['icon']; $oIconSelect = $this->oModelReflection->GetIconSelectionField('icon'); $sIconPath = ''; if (utils::IsNotNullOrEmptyString($sIcon)) { $sIconPath = utils::HtmlEntities($oIconSelect->MakeFileUrl($sIcon)); } return DashletFactory::MakeForDashletHeaderStatic($this->oModelReflection->DictString($sTitle), $sIconPath); } }