2 namespace TYPO3\CMS\Backend\Form;
100 $this->doSaveFieldName = $resultArray[
'doSaveFieldName'];
101 foreach ($resultArray[
'additionalJavaScriptPost'] as $element) {
102 $this->additionalJS_post[] = $element;
104 foreach ($resultArray[
'additionalJavaScriptSubmit'] as $element) {
105 $this->additionalJS_submit[] = $element;
107 if (!empty($resultArray[
'requireJsModules'])) {
108 foreach ($resultArray[
'requireJsModules'] as $module) {
111 if (is_string($module)) {
113 $moduleName = $module;
115 }
elseif (is_array($module)) {
117 foreach ($module as $key => $value) {
123 if ($moduleName !== null) {
124 if (!empty($this->requireJsModules[$moduleName]) && $callback !== null) {
125 $existingValue = $this->requireJsModules[$moduleName];
126 if (!is_array($existingValue)) {
127 $existingValue = array($existingValue);
129 $existingValue[] = $callback;
130 $this->requireJsModules[$moduleName] = $existingValue;
132 $this->requireJsModules[$moduleName] = $callback;
137 $this->extJSCODE = $this->extJSCODE . LF . $resultArray[
'extJSCODE'];
138 $this->inlineData = $resultArray[
'inlineData'];
139 foreach ($resultArray[
'additionalHiddenFields'] as $element) {
140 $this->hiddenFieldAccum[] = $element;
142 foreach ($resultArray[
'stylesheetFiles'] as $stylesheetFile) {
143 if (!in_array($stylesheetFile, $this->stylesheetFiles)) {
144 $this->stylesheetFiles[] = $stylesheetFile;
148 if (!empty($resultArray[
'inlineData'])) {
150 $resultInlineData = $resultArray[
'inlineData'];
152 $this->inlineData = $resultArrayInlineData;
163 $stylesheetHtml = [];
164 foreach ($this->stylesheetFiles as $stylesheetFile) {
165 $stylesheetHtml[] =
'<link rel="stylesheet" type="text/css" href="' . $stylesheetFile .
'" />';
167 return implode(LF, $stylesheetHtml);
181 $pageRenderer->addInlineSetting(
'FormEngine',
'formName',
'editform');
182 $pageRenderer->addInlineSetting(
'FormEngine',
'backPath',
'');
193 protected function JSbottom($formname =
'forms[0]')
199 $html = implode(LF, $this->hiddenFieldAccum);
203 $this->requireJsModules[
'TYPO3/CMS/Backend/FormEngine'] =
'function(FormEngine) {
206 $this->requireJsModules[
'TYPO3/CMS/Backend/FormEngineValidation'] =
'function(FormEngineValidation) {
207 FormEngineValidation.setUsMode(' . (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'USdateFormat'] ?
'1' :
'0') .
');
208 FormEngineValidation.registerReady();
212 foreach ($this->requireJsModules as $moduleName => $callbacks) {
213 if (!is_array($callbacks)) {
214 $callbacks = array($callbacks);
216 foreach ($callbacks as $callback) {
223 $pageRenderer->addJsFile(
'sysext/backend/Resources/Public/JavaScript/tree.js');
225 $pageRenderer->addJsFile(
'sysext/backend/Resources/Public/JavaScript/notifications.js');
229 $pageRenderer->addJsFile(
'sysext/rtehtmlarea/Resources/Public/JavaScript/HTMLArea/NameSpace/NameSpace.js');
234 $textareaSettings = array(
235 'autosize' => (
bool)$beUserAuth->uc[
'resizeTextareas_Flexible']
237 $pageRenderer->addInlineSettingArray(
'Textarea', $textareaSettings);
239 $this->
loadJavascriptLib(
'sysext/backend/Resources/Public/JavaScript/jsfunc.tbe_editor.js');
240 $pageRenderer->loadRequireJsModule(
'TYPO3/CMS/Backend/ValueSlider');
242 $dateFormat = (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'USdateFormat'] ? array(
'MM-DD-YYYY',
'HH:mm MM-DD-YYYY') : array(
'DD-MM-YYYY',
'HH:mm DD-MM-YYYY'));
243 $pageRenderer->addInlineSetting(
'DateTimePicker',
'DateFormat', $dateFormat);
247 if ($clientInfo[
'BROWSER'] ==
'msie' && $clientInfo[
'VERSION'] <= 9) {
248 $this->
loadJavascriptLib(
'sysext/core/Resources/Public/JavaScript/Contrib/placeholders.jquery.min.js');
251 $pageRenderer->loadRequireJsModule(
'TYPO3/CMS/Filelist/FileListLocalisation');
259 $this->
loadJavascriptLib(
'sysext/t3editor/Resources/Public/JavaScript/Contrib/codemirror/js/codemirror.js');
262 $this->
loadJavascriptLib(
'sysext/backend/Resources/Public/JavaScript/jsfunc.inline.js');
268 TBE_EDITOR.formname = "' . $formname .
'";
269 TBE_EDITOR.formnameUENC = "' . rawurlencode($formname) .
'";
270 TBE_EDITOR.backPath = "";
271 TBE_EDITOR.isPalettedoc = null;
272 TBE_EDITOR.doSaveFieldName = "' . ($this->doSaveFieldName ? addslashes($this->doSaveFieldName) :
'') .
'";
273 TBE_EDITOR.labels.fieldsChanged = ' .
GeneralUtility::quoteJSvalue($languageService->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.fieldsChanged')) .
';
274 TBE_EDITOR.labels.fieldsMissing = ' .
GeneralUtility::quoteJSvalue($languageService->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.fieldsMissing')) .
';
275 TBE_EDITOR.labels.maxItemsAllowed = ' .
GeneralUtility::quoteJSvalue($languageService->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.maxItemsAllowed')) .
';
276 TBE_EDITOR.labels.refresh_login = ' .
GeneralUtility::quoteJSvalue($languageService->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_login')) .
';
277 TBE_EDITOR.labels.refreshRequired = {};
278 TBE_EDITOR.labels.refreshRequired.title = ' .
GeneralUtility::quoteJSvalue($languageService->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refreshRequired.title')) .
';
279 TBE_EDITOR.labels.refreshRequired.content = ' .
GeneralUtility::quoteJSvalue($languageService->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refreshRequired.content')) .
';
280 TBE_EDITOR.labels.remainingCharacters = ' .
GeneralUtility::quoteJSvalue($languageService->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.remainingCharacters')) .
';
281 TBE_EDITOR.customEvalFunctions = {};
285 if (!empty($this->inlineData)) {
287 inline.addToDataArray(' . json_encode($this->inlineData) .
');
291 if ($this->additionalJS_submit) {
342 if ($this->pageRenderer === null) {