/** * JavaScript code used for input-field evaluation. * * @param string $formname The identification of the form on the page. * @param boolean $update Just extend/update existing settings, e.g. for AJAX call * @return string A section with JavaScript - if $update is FALSE, embedded in <script></script> */ public function JSbottom($formname = 'forms[0]', $update = FALSE) { $result = parent::JSbottom($formname, $update); $enableMediaFilePicker = (bool) $this->getBackendUser()->getTSConfigVal('options.vidi.enableMediaFilePicker'); if (!$update && $enableMediaFilePicker) { /** @var $pageRenderer \TYPO3\CMS\Core\Page\PageRenderer */ $pageRenderer = $GLOBALS['SOBE']->doc->getPageRenderer(); // Override JS. $pageRenderer->loadRequireJsModule('TYPO3/CMS/Media/FormEngine'); } return $result; }
/** * Determines and sets several script calls to a JSON array, that would have been executed if processed in non-AJAX mode. * * @param array &$jsonArray Reference of the array to be used for JSON * @param array $config The configuration of the IRRE field of the parent record * @return void */ protected function getCommonScriptCalls(&$jsonArray, $config) { // Add data that would have been added at the top of a regular TCEforms call: if ($headTags = $this->getHeadTags()) { $jsonArray['headData'] = $headTags; } // Add the JavaScript data that would have been added at the bottom of a regular TCEforms call: $jsonArray['scriptCall'][] = $this->fObj->JSbottom($this->fObj->formName, TRUE); // If script.aculo.us Sortable is used, update the Observer to know the record: if ($config['appearance']['useSortable']) { $jsonArray['scriptCall'][] = 'inline.createDragAndDropSorting(\'' . $this->inlineNames['object'] . '_records\');'; } // if TCEforms has some JavaScript code to be executed, just do it if ($this->fObj->extJSCODE) { $jsonArray['scriptCall'][] = $this->fObj->extJSCODE; } }