10, 'style' => 'height: auto;' ]; return $aOptions; } /** @inheritdoc */ public function InitInputs(): void { parent::InitInputs(); $this->AddInput(new FormInput(self::INPUT_CLASS_NAME, ClassIOFormat::class)); $this->AddInput(new FormInput(self::INPUT_ATTRIBUTE, AttributeIOFormat::class)); } public function UpdateOptions(): array { $aOptions = parent::UpdateOptions(); $oBindingClassName = $this->GetInput(self::INPUT_CLASS_NAME)->GetBinding(); if($oBindingClassName->oOutput->Value() === null || $oBindingClassName->oOutput->Value() == "") return $aOptions; $oClassName = $oBindingClassName->oOutput->Value(); $oBindingAttribute = $this->GetInput(self::INPUT_ATTRIBUTE)->GetBinding(); if($oBindingAttribute->oOutput->Value() === null || $oBindingAttribute->oOutput->Value() == "") return $aOptions; $oAttribute = $oBindingAttribute->oOutput->Value(); $oAttDef = \MetaModel::GetAttributeDef(strval($oClassName), strval($oAttribute)); $aValues = $oAttDef->GetAllowedValues(); $aOptions['choices'] = array_flip($aValues); return $aOptions; } /** @inheritdoc */ public function GetFormType(): string { return AttributeValueChoiceType::class; } }