/** * Generates the module content (TYPO3 6.2). * * @param array $row * @return void */ protected function moduleContentLegacy(array $row) { // TCE forms methods *must* be invoked before $this->doc->startPage() $wizard = $this->tceforms->printNeededJSFunctions_top(); $wizard .= $this->buildFormLegacy($row); $wizard .= $this->tceforms->printNeededJSFunctions(); $this->content .= $wizard; }
/** * @param string $table * @param array|string $data * @return string */ public function render($table = NULL, $data = NULL) { if (!$data) { $data = array(); } if ($table) { if (!$data['uid']) { $data['uid'] = "none"; } if (!$data['pid']) { $data['pid'] = "0"; } $this->pageRenderer->loadPrototype(); $this->pageRenderer->loadExtJS(); $this->tceforms = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Form\\FormEngine'); $this->tceforms->initDefaultBEMode(); // EXTBASE FORMS $this->tceforms->prependFormFieldNames = $this->getFieldNamePrefix(); $this->tceforms->formName = $table; $this->tceforms->totalWrap = '<div class="typo3-TCEforms"> | </div>'; $this->tceforms->doSaveFieldName = 'doSave'; $this->tceforms->localizationMode = GeneralUtility::inList('text,media', $this->localizationMode) ? $this->localizationMode : ''; $this->tceforms->returnUrl = $this->R_URI; $this->tceforms->palettesCollapsed = !$this->MOD_SETTINGS['showPalettes']; $this->tceforms->disableRTE = !$GLOBALS['BE_USER']->isRTE(); $this->tceforms->enableClickMenu = TRUE; $this->tceforms->enableTabMenu = TRUE; $panel = $this->tceforms->getMainFields($table, $data); $body = $this->tceforms->printNeededJSFunctions_top(); $body .= $this->tceforms->wrapTotal($panel, $data, $table); $body .= $this->tceforms->printNeededJSFunctions(); if (count($this->tceforms->commentMessages)) { $body .= ' <!-- TCEFORM messages ' . htmlspecialchars(implode(LF, $this->tceforms->commentMessages)) . ' --> '; } } else { return "Tabelle wurde nicht angegeben."; } return $body; }
/** * Main module operation * * @return void */ public function main() { $body = ''; // Begin edit: if (is_array($this->editconf)) { // Initialize TCEforms (rendering the forms) $this->tceforms = GeneralUtility::makeInstance(FormEngine::class); $this->tceforms->doSaveFieldName = 'doSave'; $this->tceforms->localizationMode = GeneralUtility::inList('text,media', $this->localizationMode) ? $this->localizationMode : ''; // text,media is keywords defined in TYPO3 Core API..., see "l10n_cat" $this->tceforms->returnUrl = $this->R_URI; if ($this->editRegularContentFromId) { $this->editRegularContentFromId(); } // Creating the editing form, wrap it with buttons, document selector etc. $editForm = $this->makeEditForm(); if ($editForm) { $this->firstEl = reset($this->elementsData); // Checking if the currently open document is stored in the list of "open documents" - if not, then add it: if (($this->docDat[1] !== $this->storeUrlMd5 || !isset($this->docHandler[$this->storeUrlMd5])) && !$this->dontStoreDocumentRef) { $this->docHandler[$this->storeUrlMd5] = array($this->storeTitle, $this->storeArray, $this->storeUrl, $this->firstEl); $this->getBackendUser()->pushModuleData('FormEngine', array($this->docHandler, $this->storeUrlMd5)); BackendUtility::setUpdateSignal('OpendocsController::updateNumber', count($this->docHandler)); } // Module configuration $this->modTSconfig = $this->viewId ? BackendUtility::getModTSconfig($this->viewId, 'mod.xMOD_alt_doc') : array(); $body = $this->tceforms->printNeededJSFunctions_top(); $body .= $this->compileForm($editForm); $body .= $this->tceforms->printNeededJSFunctions(); } } // Access check... // The page will show only if there is a valid page and if this page may be viewed by the user $this->pageinfo = BackendUtility::readPageAccess($this->viewId, $this->perms_clause); // Setting up the buttons and markers for docheader $docHeaderButtons = $this->getButtons(); $markers = array('LANGSELECTOR' => $this->langSelector(), 'EXTRAHEADER' => $this->extraFormHeaders(), 'CSH' => $docHeaderButtons['csh'], 'CONTENT' => $body); // Build the <body> for the module $this->content = $this->doc->startPage('TYPO3 Edit Document'); $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers); $this->content .= $this->doc->endPage(); $this->content = $this->doc->insertStylesAndJS($this->content); }
/** * Main module operation * * @return void */ public function main() { // Begin edit: if (is_array($this->editconf)) { // Initialize TCEforms (rendering the forms) $this->tceforms = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Form\\FormEngine'); $this->tceforms->initDefaultBEMode(); $this->tceforms->doSaveFieldName = 'doSave'; $this->tceforms->localizationMode = GeneralUtility::inList('text,media', $this->localizationMode) ? $this->localizationMode : ''; // text,media is keywords defined in TYPO3 Core API..., see "l10n_cat" $this->tceforms->returnUrl = $this->R_URI; $this->tceforms->palettesCollapsed = !$this->MOD_SETTINGS['showPalettes']; $this->tceforms->disableRTE = !$GLOBALS['BE_USER']->isRTE(); $this->tceforms->enableClickMenu = TRUE; $this->tceforms->enableTabMenu = TRUE; // Clipboard is initialized: // Start clipboard $this->tceforms->clipObj = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Clipboard\\Clipboard'); // Initialize - reads the clipboard content from the user session $this->tceforms->clipObj->initializeClipboard(); // Setting external variables: $this->tceforms->edit_showFieldHelp = $GLOBALS['BE_USER']->uc['edit_showFieldHelp']; if ($this->editRegularContentFromId) { $this->editRegularContentFromId(); } // Creating the editing form, wrap it with buttons, document selector etc. $editForm = $this->makeEditForm(); if ($editForm) { $this->firstEl = reset($this->elementsData); // Checking if the currently open document is stored in the list of "open documents" - if not, then add it: if (($this->docDat[1] !== $this->storeUrlMd5 || !isset($this->docHandler[$this->storeUrlMd5])) && !$this->dontStoreDocumentRef) { $this->docHandler[$this->storeUrlMd5] = array($this->storeTitle, $this->storeArray, $this->storeUrl, $this->firstEl); $GLOBALS['BE_USER']->pushModuleData('alt_doc.php', array($this->docHandler, $this->storeUrlMd5)); BackendUtility::setUpdateSignal('OpendocsController::updateNumber', count($this->docHandler)); } // Module configuration $this->modTSconfig = $this->viewId ? BackendUtility::getModTSconfig($this->viewId, 'mod.xMOD_alt_doc') : array(); $body = $this->tceforms->printNeededJSFunctions_top(); $body .= $this->compileForm($editForm); $body .= $this->tceforms->printNeededJSFunctions(); $body .= $this->functionMenus(); $body .= $this->tceformMessages(); } } // Access check... // The page will show only if there is a valid page and if this page may be viewed by the user $this->pageinfo = BackendUtility::readPageAccess($this->viewId, $this->perms_clause); // Setting up the buttons and markers for docheader $docHeaderButtons = $this->getButtons(); $markers = array('LANGSELECTOR' => $this->langSelector(), 'EXTRAHEADER' => $this->extraFormHeaders(), 'CSH' => $docHeaderButtons['csh'], 'CONTENT' => $body); // Build the <body> for the module $this->content = $this->doc->startPage('TYPO3 Edit Document'); $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers); $this->content .= $this->doc->endPage(); $this->content = $this->doc->insertStylesAndJS($this->content); }