mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
N°8772 - compilation of choices from inputs
This commit is contained in:
@@ -22,6 +22,7 @@ abstract class AbstractValueType
|
||||
protected array $aInputs = [];
|
||||
protected array $aOutputs = [];
|
||||
protected array $aInputValues = [];
|
||||
protected array $aDynamicInputValues = [];
|
||||
protected array $aFormBlockOptionsForPHP = [];
|
||||
|
||||
public function InitFromDomNode(DesignElement $oDomNode): void
|
||||
@@ -56,6 +57,11 @@ abstract class AbstractValueType
|
||||
return $this->aInputs[$sInputName]->GetDataType();
|
||||
}
|
||||
|
||||
public function GetDynamicInputValues(): array
|
||||
{
|
||||
return $this->aDynamicInputValues;
|
||||
}
|
||||
|
||||
public function GetOutputs(): array
|
||||
{
|
||||
return $this->aOutputs;
|
||||
|
||||
33
sources/PropertyTree/ValueType/ValueTypeChoiceFromInput.php
Normal file
33
sources/PropertyTree/ValueType/ValueTypeChoiceFromInput.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* @copyright Copyright (C) 2010-2025 Combodo SAS
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
namespace Combodo\iTop\PropertyTree\ValueType;
|
||||
|
||||
use Combodo\iTop\DesignElement;
|
||||
use Combodo\iTop\Forms\Block\Base\ChoiceFromInputsBlock;
|
||||
use Combodo\iTop\PropertyTree\ValueType\AbstractValueType;
|
||||
use utils;
|
||||
|
||||
class ValueTypeChoiceFromInput extends AbstractValueType
|
||||
{
|
||||
public function GetFormBlockClass(): string
|
||||
{
|
||||
return ChoiceFromInputsBlock::class;
|
||||
}
|
||||
|
||||
public function InitFromDomNode(DesignElement $oDomNode): void
|
||||
{
|
||||
parent::InitFromDomNode($oDomNode);
|
||||
|
||||
foreach ($oDomNode->GetNodes('values/value') as $oValueNode) {
|
||||
/** @var DesignElement $oValueNode */
|
||||
$sValue = $oValueNode->GetAttribute('id');
|
||||
$sLabel = $oValueNode->GetChildText('label');
|
||||
$this->aDynamicInputValues[$sValue] = $sLabel;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user