mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-28 21:18:46 +02:00
Move dashboard blocks to itop project and keep demonstrator one
This commit is contained in:
48
sources/Application/Dashboard/FormBlock/DashletFormBlock.php
Normal file
48
sources/Application/Dashboard/FormBlock/DashletFormBlock.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace Combodo\iTop\Application\Dashboard\FormBlock;
|
||||
|
||||
use Combodo\iTop\Forms\Block\Base\ChoiceFormBlock;
|
||||
use Combodo\iTop\Forms\Block\Base\FormBlock;
|
||||
use Combodo\iTop\Forms\Block\Base\IntegerFormBlock;
|
||||
use Combodo\iTop\PropertyType\PropertyTypeService;
|
||||
|
||||
class DashletFormBlock extends FormBlock
|
||||
{
|
||||
protected function BuildForm(): void
|
||||
{
|
||||
// type
|
||||
$aPropertyTypes = PropertyTypeService::GetInstance()->ListPropertyTypesByType('Dashlet');
|
||||
$this->Add('class', ChoiceFormBlock::class, [
|
||||
'label' => 'Class',
|
||||
'choices' => array_combine($aPropertyTypes, $aPropertyTypes),
|
||||
]);
|
||||
|
||||
// column
|
||||
$this->Add('position_x', IntegerFormBlock::class, [
|
||||
'label' => 'Position X',
|
||||
]);
|
||||
|
||||
// row
|
||||
$this->Add('position_y', IntegerFormBlock::class, [
|
||||
'label' => 'Position Y',
|
||||
]);
|
||||
|
||||
// column
|
||||
$this->Add('height', IntegerFormBlock::class, [
|
||||
'label' => 'Height',
|
||||
]);
|
||||
|
||||
// row
|
||||
$this->Add('width', IntegerFormBlock::class, [
|
||||
'label' => 'Width',
|
||||
]);
|
||||
|
||||
// dashlet
|
||||
$this->Add('dashlet', DashletPropertiesFormBlock::class, [
|
||||
'label' => 'Dashlet',
|
||||
])
|
||||
->InputDependsOn(DashletPropertiesFormBlock::INPUT_DASHLET_TYPE, 'class', ChoiceFormBlock::OUTPUT_VALUE);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user