[ 'renderType' => 'localizationStateSelector', ], 'otherLanguageContent' => [ 'renderType' => 'otherLanguageContent', 'after' => [ 'localizationStateSelector', ], ], 'defaultLanguageDifferences' => [ 'renderType' => 'defaultLanguageDifferences', 'after' => [ 'otherLanguageContent', ], ], ]; /** * This will render a series of radio buttons. * * @return array As defined in initializeResultArray() of AbstractNode */ public function render(): array { $resultArray = $this->initializeResultArray(); $disabled = ''; if ($this->data['parameterArray']['fieldConf']['config']['readOnly'] ?? false) { $disabled = ' disabled'; } $fieldInformationResult = $this->renderFieldInformation(); $fieldInformationHtml = $fieldInformationResult['html']; $resultArray = $this->mergeChildReturnIntoExistingResult($resultArray, $fieldInformationResult, false); $fieldWizardResult = $this->renderFieldWizard(); $fieldWizardHtml = $fieldWizardResult['html']; $resultArray = $this->mergeChildReturnIntoExistingResult($resultArray, $fieldWizardResult, false); $html = []; $html[] = '
'; $html[] = $fieldInformationHtml; $html[] = '
'; $html[] = '
'; foreach ($this->data['parameterArray']['fieldConf']['config']['items'] as $itemNumber => $itemLabelAndValue) { $label = $itemLabelAndValue['label']; $value = $itemLabelAndValue['value']; $radioId = htmlspecialchars(StringUtility::getUniqueId('formengine-radio-') . '-' . $itemNumber); $radioElementAttrs = array_merge( [ 'type' => 'radio', 'id' => $radioId, 'value' => $value, 'class' => 'form-check-input', 'name' => $this->data['parameterArray']['itemFormElName'], ], $this->getOnFieldChangeAttrs('click', $this->data['parameterArray']['fieldChangeFunc'] ?? []) ); if ((string)$value === (string)$this->data['parameterArray']['itemFormElValue']) { $radioElementAttrs['checked'] = 'checked'; } $html[] = '
'; $html[] = ''; $html[] = ''; $html[] = '
'; } $html[] = '
'; if (!$disabled && !empty($fieldWizardHtml)) { $html[] = '
'; $html[] = $fieldWizardHtml; $html[] = '
'; } $html[] = '
'; $html[] = '
'; $resultArray['html'] = $this->wrapWithFieldsetAndLegend(implode(LF, $html)); return $resultArray; } }