mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-27 12:38:44 +02:00
Move dashboard blocks to itop project and keep demonstrator one
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Combodo\iTop\Application\Dashboard\FormBlock;
|
||||
|
||||
use Combodo\iTop\Forms\Block\Base\FormBlock;
|
||||
use Combodo\iTop\Forms\IO\Format\StringIOFormat;
|
||||
use Combodo\iTop\Forms\Register\IORegister;
|
||||
use Combodo\iTop\PropertyType\PropertyTypeService;
|
||||
|
||||
class DashletPropertiesFormBlock extends FormBlock
|
||||
{
|
||||
// inputs
|
||||
public const INPUT_DASHLET_TYPE = 'dashlet_type';
|
||||
|
||||
protected function RegisterIO(IORegister $oIORegister): void
|
||||
{
|
||||
parent::RegisterIO($oIORegister);
|
||||
$oIORegister->AddInput(self::INPUT_DASHLET_TYPE, StringIOFormat::class);
|
||||
}
|
||||
|
||||
public function GetFormType(): string
|
||||
{
|
||||
$sDashletType = strval($this->GetInputValue(self::INPUT_DASHLET_TYPE));
|
||||
$oDashlet = PropertyTypeService::GetInstance()->GetFormBlockById($sDashletType, 'Dashlet');
|
||||
|
||||
return $oDashlet->GetFormType();
|
||||
}
|
||||
|
||||
public function GetOptions(): array
|
||||
{
|
||||
$sDashletType = strval($this->GetInputValue(self::INPUT_DASHLET_TYPE));
|
||||
$oDashlet = PropertyTypeService::GetInstance()->GetFormBlockById($sDashletType, 'Dashlet');
|
||||
|
||||
return $oDashlet->GetOptions();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user