98 $this->doSaveFieldName = $resultArray[
'doSaveFieldName'];
99 foreach ($resultArray[
'additionalJavaScriptPost'] as $element) {
100 $this->additionalJavaScriptPost[] = $element;
102 foreach ($resultArray[
'additionalJavaScriptSubmit'] as $element) {
103 $this->additionalJavaScriptSubmit[] = $element;
105 if (!empty($resultArray[
'requireJsModules'])) {
106 foreach ($resultArray[
'requireJsModules'] as $module) {
109 if (is_string($module)) {
111 $moduleName = $module;
113 } elseif (is_array($module)) {
115 foreach ($module as $key => $value) {
121 if ($moduleName !==
null) {
122 if (!empty($this->requireJsModules[$moduleName]) && $callback !==
null) {
123 $existingValue = $this->requireJsModules[$moduleName];
124 if (!is_array($existingValue)) {
125 $existingValue = [$existingValue];
127 $existingValue[] = $callback;
128 $this->requireJsModules[$moduleName] = $existingValue;
130 $this->requireJsModules[$moduleName] = $callback;
136 foreach ($resultArray[
'additionalHiddenFields'] as $element) {
137 $this->hiddenFieldAccum[] = $element;
139 foreach ($resultArray[
'stylesheetFiles'] as $stylesheetFile) {
140 if (!in_array($stylesheetFile, $this->stylesheetFiles)) {
141 $this->stylesheetFiles[] = $stylesheetFile;
145 if (!empty($resultArray[
'inlineData'])) {
147 $resultInlineData = $resultArray[
'inlineData'];
149 $this->inlineData = $resultArrayInlineData;
152 if (!empty($resultArray[
'additionalInlineLanguageLabelFiles'])) {
153 foreach ($resultArray[
'additionalInlineLanguageLabelFiles'] as $additionalInlineLanguageLabelFile) {
154 $this->additionalInlineLanguageLabelFiles[] = $additionalInlineLanguageLabelFile;
167 foreach ($this->stylesheetFiles as $stylesheetFile) {
198 $uriBuilder = GeneralUtility::makeInstance(\
TYPO3\CMS\Backend\Routing\UriBuilder::class);
201 $html = implode(LF, $this->hiddenFieldAccum);
204 $this->requireJsModules[
'TYPO3/CMS/Backend/FormEngine'] =
'function(FormEngine) {
205 FormEngine.initialize(
206 ' . GeneralUtility::quoteJSvalue((
string)$uriBuilder->buildUriFromRoute(
'wizard_element_browser')) .
',
207 ' . (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'USdateFormat'] ?
'1' :
'0') .
'
210 $this->requireJsModules[
'TYPO3/CMS/Backend/FormEngineReview'] =
null;
212 foreach ($this->requireJsModules as $moduleName => $callbacks) {
213 if (!is_array($callbacks)) {
214 $callbacks = [$callbacks];
216 foreach ($callbacks as $callback) {
223 $popupWindowWidth = 800;
224 $popupWindowHeight = 600;
225 $popupWindowSize = trim($backendUser->getTSConfig()[
'options.'][
'popupWindowSize'] ??
'');
226 if (!empty($popupWindowSize)) {
227 list($popupWindowWidth, $popupWindowHeight) = GeneralUtility::intExplode(
'x', $popupWindowSize);
231 $rtePopupWindowSize = trim($backendUser->getTSConfig()[
'options.'][
'rte.'][
'popupWindowSize'] ??
'');
232 if (!empty($rtePopupWindowSize)) {
233 list($rtePopupWindowWidth, $rtePopupWindowHeight) = GeneralUtility::trimExplode(
'x', $rtePopupWindowSize);
235 $rtePopupWindowWidth = !empty($rtePopupWindowWidth) ? (int)$rtePopupWindowWidth : $popupWindowWidth;
236 $rtePopupWindowHeight = !empty($rtePopupWindowHeight) ? (int)$rtePopupWindowHeight : $popupWindowHeight;
239 $textareaSettings = [
240 'autosize' => (bool)$backendUser->uc[
'resizeTextareas_Flexible'],
241 'RTEPopupWindow' => [
242 'width' => $rtePopupWindowWidth,
243 'height' => $rtePopupWindowHeight
250 'width' => $popupWindowWidth,
251 'height' => $popupWindowHeight
258 $dateFormat = (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'USdateFormat'] ? [
'MM-DD-YYYY',
'HH:mm MM-DD-YYYY'] : [
'DD-MM-YYYY',
'HH:mm DD-MM-YYYY']);
264 if (!empty($this->additionalInlineLanguageLabelFiles)) {
265 foreach ($this->additionalInlineLanguageLabelFiles as $additionalInlineLanguageLabelFile) {
275 'FormEngine.noRecordTitle' => $this->
getLanguageService()->
sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.no_title'),
276 'FormEngine.fieldsChanged' => $this->
getLanguageService()->
sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.fieldsChanged'),
277 'FormEngine.fieldsMissing' => $this->
getLanguageService()->
sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.fieldsMissing'),
278 'FormEngine.maxItemsAllowed' => $this->
getLanguageService()->
sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.maxItemsAllowed'),
279 'FormEngine.refreshRequiredTitle' => $this->
getLanguageService()->
sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:mess.refreshRequired.title'),
280 'FormEngine.refreshRequiredContent' => $this->
getLanguageService()->
sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:mess.refreshRequired.content'),
281 'FormEngine.remainingCharacters' => $this->
getLanguageService()->
sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.remainingCharacters'),
284 $out = LF .
'TBE_EDITOR.doSaveFieldName = "' . ($this->doSaveFieldName ? addslashes($this->doSaveFieldName) :
'') .
'";';
287 if (!empty($this->inlineData)) {
288 $out .= LF .
'inline.addToDataArray(' . json_encode($this->inlineData) .
');';
291 if ($this->additionalJavaScriptSubmit) {
292 $additionalJS_submit = implode(
'', $this->additionalJavaScriptSubmit);
293 $additionalJS_submit = str_replace([CR, LF],
'', $additionalJS_submit);
294 $out .=
'TBE_EDITOR.addActionChecks("submit", "' . addslashes($additionalJS_submit) .
'");';
296 $out .= LF . implode(LF, $this->additionalJavaScriptPost);
298 return $html . LF .
"\t" . GeneralUtility::wrapJS($out);
326 if ($this->pageRenderer ===
null) {
327 $this->pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);