2 namespace TYPO3\CMS\Backend\Controller\Wizard;
23 use TYPO3\CMS\Backend\Form\FormEngine;
75 parent::__construct();
95 $this->MCONF[
'name'] =
'wizard_rte';
112 $response->
getBody()->write($this->moduleTemplate->renderContent());
121 public function main()
123 $this->content .=
'<form action="'
124 . htmlspecialchars(BackendUtility::getModuleUrl(
'tce_db'))
125 .
'" method="post" enctype="multipart/form-data" id="RteController" name="editform" '
126 .
' onsubmit="return TBE_EDITOR.checkSubmit(1);">';
134 $this->P[
'uid'] = $versionedRecord[
'uid'];
137 if ($this->P[
'table']
148 $formDataCompilerInput = [
149 'vanillaUid' => (int)$this->P[
'uid'],
150 'tableName' => $this->P[
'table'],
152 'disabledWizards' =>
true,
155 $formData = $formDataCompiler->compile($formDataCompilerInput);
157 $formData[
'fieldListToRender'] = $this->P[
'field'];
158 $formData[
'renderType'] =
'outerWrapContainer';
159 $formResult = $nodeFactory->create($formData)->render();
163 $formResultCompiler->mergeResult($formResult);
166 $this->moduleTemplate->addJavaScriptCode(
167 'RteWizardInlineCode',
168 'function jumpToUrl(URL,formEl) {
169 if (document.editform) {
170 if (!TBE_EDITOR.isFormChanged()) {
171 window.location.href = URL;
173 if (formEl.type=="checkbox") formEl.checked = formEl.checked ? 0 : 1;
176 window.location.href = URL;
183 if ($this->popView) {
184 $this->moduleTemplate->addJavaScriptCode(
187 $formData[
'databaseRow'][
'pid'],
194 $pageTsConfigMerged = $formData[
'pageTsConfigMerged'];
195 if ((
string)$pageTsConfigMerged[
'TCEFORM.'][$this->P[
'table'] .
'.'][$this->P[
'field'] .
'.'][
'RTEfullScreenWidth'] !==
'') {
196 $width = (string)$pageTsConfigMerged[
'TCEFORM.'][$this->P[
'table'] .
'.'][$this->P[
'field'] .
'.'][
'RTEfullScreenWidth'];
201 $formContent = $formResult[
'html'];
203 <table border="0" cellpadding="0" cellspacing="0" width="' . $width .
'" id="typo3-rtewizard">
205 <td width="' . $width .
'" colspan="2" id="c-formContent">' . $formContent .
'</td>
211 $formContent .=
'<input type="hidden" name="redirect" value="' . htmlspecialchars($this->R_URI) .
'" />
212 <input type="hidden" name="_serialNumber" value="' . md5(microtime()) .
'" />';
214 $this->content .= $formResultCompiler->JStop()
216 . $formResultCompiler->printNeededJSFunctions();
219 $this->content .=
'<h2>' . $this->
getLanguageService()->getLL(
'forms_title',
true) .
'</h2>'
220 .
'<div><span class="text-danger">'
228 $this->content .=
'</form>';
229 $this->moduleTemplate->setContent($this->content);
251 $buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
252 if ($this->P[
'table']
260 $undoRes = $databaseConnection->exec_SELECTquery(
263 'tablename=' . $databaseConnection->fullQuoteStr(
266 ) .
' AND recuid=' . (int)$this->P[
'uid'],
271 if ($undoButtonR = $databaseConnection->sql_fetch_assoc($undoRes)) {
276 $closeButton = $buttonBar->makeLinkButton()
278 ->setTitle($this->
getLanguageService()->sL(
'LLL:EXT:lang/locallang_core.xlf:rm.closeDoc',
true))
279 ->setIcon($this->moduleTemplate->getIconFactory()->getIcon(
'actions-document-close',
Icon::SIZE_SMALL));
283 $saveButton = $buttonBar->makeInputButton()
284 ->setName(
'_savedok_x')
286 ->setForm(
'RteController')
287 ->setOnClick(
'TBE_EDITOR.checkAndDoSubmit(1); return false;')
288 ->setTitle($this->
getLanguageService()->sL(
'LLL:EXT:lang/locallang_core.xlf:rm.saveDoc',
true))
289 ->setIcon($this->moduleTemplate->getIconFactory()->getIcon(
'actions-document-save',
Icon::SIZE_SMALL));
291 $saveAndViewButton = $buttonBar->makeInputButton()
292 ->setName(
'_savedokview_x')
294 ->setForm(
'RteController')
296 .
' TBE_EDITOR.checkAndDoSubmit(1); return false;')
297 ->setTitle($this->
getLanguageService()->sL(
'LLL:EXT:lang/locallang_core.xlf:rm.saveDocShow',
true))
299 $this->moduleTemplate->getIconFactory()->getIcon(
'actions-document-save-view',
Icon::SIZE_SMALL)
303 $saveAndCloseButton = $buttonBar->makeInputButton()
304 ->setName(
'_saveandclosedok_x')
306 ->setForm(
'RteController')
308 .
'; TBE_EDITOR.checkAndDoSubmit(1); return false;')
309 ->setTitle($this->
getLanguageService()->sL(
'LLL:EXT:lang/locallang_core.xlf:rm.saveCloseDoc',
true))
310 ->setIcon($this->moduleTemplate->getIconFactory()->getIcon(
311 'actions-document-save-close',
316 $saveSplitButton = $buttonBar->makeSplitButton()
317 ->addItem($saveButton)
318 ->addItem($saveAndViewButton)
319 ->addItem($saveAndCloseButton);
324 $aOnClick =
'window.location.href=' .
326 BackendUtility::getModuleUrl(
329 'element' => $this->P[
'table'] .
':' . $this->P[
'uid'],
330 'revert' =>
'field:' . $this->P[
'field'],
332 'returnUrl' => $this->R_URI,
335 ) .
'; return false;';
338 'LLL:EXT:lang/locallang_wizards.xlf:rte_undoLastChange'
340 $lastChangeLabel = sprintf(
343 (
$GLOBALS[
'EXEC_TIME'] - $undoButtonR[
'tstamp']),
345 'LLL:EXT:lang/locallang_core.xlf:labels.minutesHoursDaysYears'
350 $undoRevertButton = $buttonBar->makeLinkButton()
352 ->setOnClick($aOnClick)
353 ->setTitle($lastChangeLabel)
354 ->setIcon($this->moduleTemplate->getIconFactory()->getIcon(
'actions-edit-undo',
Icon::SIZE_SMALL));
358 $shortButton = $buttonBar->makeShortcutButton()
359 ->setModuleName($this->MCONF[
'name'])
360 ->setGetVariables([
'P']);
361 $buttonBar->addButton($shortButton);