[ 'renderType' => 'localizationStateSelector', ], 'otherLanguageContent' => [ 'renderType' => 'otherLanguageContent', 'after' => [ 'localizationStateSelector', ], ], 'defaultLanguageDifferences' => [ 'renderType' => 'defaultLanguageDifferences', 'after' => [ 'otherLanguageContent', ], ], ]; /** * Render code editor element * * @return array As defined in initializeResultArray() of AbstractNode * @throws InvalidModeException * @throws \InvalidArgumentException * @throws \BadFunctionCallException */ public function render(): array { $this->resultArray = $this->initializeResultArray(); $this->resultArray['javaScriptModules'][] = JavaScriptModuleInstruction::create('@typo3/backend/code-editor/element/code-mirror-element.js'); // Compile and register code editor configuration GeneralUtility::makeInstance(CodeEditor::class)->registerConfiguration(); $addonRegistry = GeneralUtility::makeInstance(AddonRegistry::class); $registeredAddons = $addonRegistry->getAddons(); foreach ($registeredAddons as $addon) { foreach ($addon->getCssFiles() as $cssFile) { $this->resultArray['stylesheetFiles'][] = $cssFile; } } $parameterArray = $this->data['parameterArray']; $attributes = [ 'wrap' => 'off', 'data-formengine-validation-rules' => $this->getValidationDataAsJsonString($parameterArray['fieldConf']['config']), ]; if (isset($parameterArray['fieldConf']['config']['rows']) && MathUtility::canBeInterpretedAsInteger($parameterArray['fieldConf']['config']['rows'])) { $attributes['rows'] = $parameterArray['fieldConf']['config']['rows']; } $settings = []; if ($parameterArray['fieldConf']['config']['readOnly'] ?? false) { $settings['readonly'] = true; } if ($parameterArray['fieldConf']['config']['appearance']['lineWrapping'] ?? false) { $settings['linewrapping'] = true; } $editorHtml = $this->getHTMLCodeForEditor( $parameterArray['itemFormElName'], 'form-control font-monospace enable-tab', $parameterArray['itemFormElValue'], $attributes, $settings, [ 'target' => 0, 'effectivePid' => $this->data['effectivePid'] ?? 0, ] ); $fieldInformationResult = $this->renderFieldInformation(); $fieldInformationHtml = $fieldInformationResult['html']; $this->resultArray = $this->mergeChildReturnIntoExistingResult($this->resultArray, $fieldInformationResult, false); $fieldControlResult = $this->renderFieldControl(); $fieldControlHtml = $fieldControlResult['html']; $this->resultArray = $this->mergeChildReturnIntoExistingResult($this->resultArray, $fieldControlResult, false); $fieldWizardResult = $this->renderFieldWizard(); $fieldWizardHtml = $fieldWizardResult['html']; $this->resultArray = $this->mergeChildReturnIntoExistingResult($this->resultArray, $fieldWizardResult, false); $html = []; $html[] = '