N°8772 - Form dependencies manager implementation - WIP

This commit is contained in:
Eric Espie
2025-10-23 15:11:14 +02:00
parent 98c0b11db7
commit fd449d195d
13 changed files with 133 additions and 55 deletions

View File

@@ -7,11 +7,11 @@ use Combodo\iTop\Forms\Block\FormInput;
class AttributeChoiceFormBlock extends ChoiceFormBlock
{
public const INPUT_CLASS_NAME = 'class_name';
public function InitInputs(): void
{
$this->AddInput(new FormInput('class_name', 'string'));
$this->AddInput(new FormInput(self::INPUT_CLASS_NAME, 'string'));
}

View File

@@ -0,0 +1,27 @@
<?php
namespace Combodo\iTop\Forms\Block\DataModel;
use Combodo\iTop\Forms\Block\Base\ChoiceFormBlock;
use Combodo\iTop\Forms\Block\FormInput;
class AttributeValueChoiceFormBlock extends ChoiceFormBlock
{
public const INPUT_CLASS_NAME = 'class_name';
public const INPUT_ATTRIBUTE = 'attribute';
public function __construct(string $sName, array $aOptions = [])
{
$aOptions['multiple'] = true;
parent::__construct($sName, $aOptions);
}
public function InitInputs(): void
{
$this->AddInput(new FormInput(self::INPUT_CLASS_NAME, 'string'));
$this->AddInput(new FormInput(self::INPUT_ATTRIBUTE, 'string'));
}
}

View File

@@ -8,9 +8,12 @@ use Combodo\iTop\Forms\Block\FormOutput;
class OqlFormBlock extends StringFormBlock
{
public const OUTPUT_SELECTED_CLASS = 'selected_class';
public function InitOutputs(): void
{
$this->AddOutput(new FormOutput('selected_class', 'string'));
parent::InitOutputs();
$this->AddOutput(new FormOutput(self::OUTPUT_SELECTED_CLASS, 'string'));
}
}