‪TYPO3CMS  9.5
EditDocumentController.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
18 use Psr\Http\Message\ResponseInterface;
19 use Psr\Http\Message\ServerRequestInterface;
55 
64 {
67 
72  public const ‪DOCUMENT_CLOSE_MODE_REDIRECT = 1; // works like DOCUMENT_CLOSE_MODE_DEFAULT
73  public const ‪DOCUMENT_CLOSE_MODE_CLEAR_ALL = 3;
74  public const ‪DOCUMENT_CLOSE_MODE_NO_REDIRECT = 4;
75 
79  private ‪$deprecatedPublicMethods = [
80  'makeEditForm' => 'Using EditDocumentController::makeEditForm() is deprecated and will not be possible anymore in TYPO3 v10.0.',
81  'compileForm' => 'Using EditDocumentController::compileForm() is deprecated and will not be possible anymore in TYPO3 v10.0.',
82  'languageSwitch' => 'Using EditDocumentController::languageSwitch() is deprecated and will not be possible anymore in TYPO3 v10.0.',
83  'getLanguages' => 'Using EditDocumentController::getLanguages() is deprecated and will not be possible anymore in TYPO3 v10.0.',
84  'fixWSversioningInEditConf' => 'Using EditDocumentController::fixWSversioningInEditConf() is deprecated and will not be possible anymore in TYPO3 v10.0.',
85  'getRecordForEdit' => 'Using EditDocumentController::getRecordForEdit() is deprecated and will not be possible anymore in TYPO3 v10.0.',
86  ];
87 
94  'editconf' => 'Using $editconf of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
95  'defVals' => 'Using $defVals of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
96  'overrideVals' => 'Using $overrideVals of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
97  'columnsOnly' => 'Using $columnsOnly of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
98  'returnUrl' => 'Using $returnUrl of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
99  'closeDoc' => 'Using $closeDoc of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
100  'doSave' => 'Using $doSave of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
101  'returnEditConf' => 'Using $returnEditConf of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
102  'uc' => 'Using $uc of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
103  'retUrl' => 'Using $retUrl of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
104  'R_URL_parts' => 'Using $R_URL_parts of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
105  'R_URL_getvars' => 'Using $R_URL_getvars of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
106  'storeArray' => 'Using $storeArray of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
107  'storeUrl' => 'Using $storeUrl of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
108  'storeUrlMd5' => 'Using $storeUrlMd5 of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
109  'docDat' => 'Using $docDat of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
110  'docHandler' => 'Using $docHandler of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
111  'cmd' => 'Using $cmd of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
112  'mirror' => 'Using $mirror of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
113  'cacheCmd' => 'Using $cacheCmd of class EditDocumentTemplate from the outside is discouraged, the variable will be removed.',
114  'redirect' => 'Using $redirect of class EditDocumentTemplate from the outside is discouraged, the variable will be removed.',
115  'returnNewPageId' => 'Using $returnNewPageId of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
116  'popViewId' => 'Using $popViewId of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
117  'popViewId_addParams' => 'Using $popViewId_addParams of class EditDocumentTemplate from the outside is discouraged, the variable will be removed.',
118  'viewUrl' => 'Using $viewUrl of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
119  'recTitle' => 'Using $recTitle of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
120  'noView' => 'Using $noView of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
121  'MCONF' => 'Using $MCONF of class EditDocumentTemplate from the outside is discouraged, the variable will be removed.',
122  'doc' => 'Using $doc of class EditDocumentTemplate from the outside is discouraged, the variable will be removed.',
123  'perms_clause' => 'Using $perms_clause of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
124  'template' => 'Using $template of class EditDocumentTemplate from the outside is discouraged, the variable will be removed.',
125  'content' => 'Using $content of class EditDocumentTemplate from the outside is discouraged, the variable will be removed.',
126  'R_URI' => 'Using $R_URI of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
127  'pageinfo' => 'Using $pageinfo of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
128  'storeTitle' => 'Using $storeTitle of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
129  'firstEl' => 'Using $firstEl of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
130  'errorC' => 'Using $errorC of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
131  'newC' => 'Using $newC of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
132  'viewId' => 'Using $viewId of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
133  'viewId_addParams' => 'Using $viewId_addParams of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
134  'modTSconfig' => 'Using $modTSconfig of class EditDocumentTemplate from the outside is discouraged, the variable will be removed.',
135  'dontStoreDocumentRef' => 'Using $dontStoreDocumentRef of class EditDocumentTemplate from the outside is discouraged, as this variable is only used for internal storage.',
136  ];
137 
144  protected ‪$editconf = [];
145 
152  protected ‪$columnsOnly;
153 
159  protected ‪$defVals;
160 
166  protected ‪$overrideVals;
167 
174  protected ‪$returnUrl;
175 
183  protected ‪$retUrl;
184 
190  protected ‪$closeDoc;
191 
199  protected ‪$doSave;
200 
208  public ‪$data;
209 
215  protected ‪$cmd;
216 
222  protected ‪$mirror;
223 
228  protected ‪$cacheCmd;
229 
234  protected ‪$redirect;
235 
242  protected ‪$returnNewPageId = false;
243 
250  protected ‪$uc;
251 
257  protected ‪$popViewId;
258 
263  protected ‪$popViewId_addParams;
264 
270  protected ‪$viewUrl;
271 
277  protected ‪$recTitle;
278 
284  protected ‪$noView;
285 
289  protected ‪$perms_clause;
290 
296  protected ‪$returnEditConf;
297 
303  protected ‪$workspace;
304 
309  protected ‪$doc;
310 
314  protected ‪$template;
315 
319  protected ‪$content;
320 
326  protected ‪$R_URL_parts;
327 
334  protected ‪$R_URL_getvars;
335 
341  protected ‪$R_URI;
342 
347  protected ‪$MCONF;
348 
352  protected ‪$pageinfo;
353 
360  protected ‪$storeTitle = '';
361 
368  protected ‪$storeArray;
369 
375  protected ‪$storeUrl;
376 
382  protected ‪$storeUrlMd5;
383 
389  protected ‪$docDat;
390 
399  protected ‪$docHandler;
400 
408  public ‪$elementsData;
409 
415  protected ‪$firstEl;
416 
422  protected ‪$errorC;
423 
429  protected ‪$newC;
430 
437  protected ‪$viewId;
438 
445 
449  protected ‪$modTSconfig = [];
450 
454  protected ‪$formResultCompiler;
455 
461  protected ‪$dontStoreDocumentRef = 0;
462 
466  protected ‪$signalSlotDispatcher;
467 
473  protected ‪$previewData = [];
474 
480  protected ‪$moduleTemplate;
481 
487  protected ‪$isSavedRecord;
488 
494  protected ‪$isPageInFreeTranslationMode = false;
495 
499  protected ‪$uriBuilder;
500 
504  public function ‪__construct()
505  {
506  $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
507  $this->moduleTemplate->setUiBlock(true);
508  $this->uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
509  // @todo Used by TYPO3\CMS\Backend\Configuration\TypoScript\ConditionMatching
510  ‪$GLOBALS['SOBE'] = $this;
511  $this->‪getLanguageService()->‪includeLLFile('EXT:backend/Resources/Private/Language/locallang_alt_doc.xlf');
512  }
513 
520  public function ‪mainAction(ServerRequestInterface $request): ResponseInterface
521  {
522  // Unlock all locked records
524  if ($response = $this->‪preInit($request)) {
525  return $response;
526  }
527 
528  // Process incoming data via DataHandler?
529  $parsedBody = $request->getParsedBody();
530  if ($this->doSave
531  || isset($parsedBody['_savedok'])
532  || isset($parsedBody['_saveandclosedok'])
533  || isset($parsedBody['_savedokview'])
534  || isset($parsedBody['_savedoknew'])
535  || isset($parsedBody['_duplicatedoc'])
536  ) {
537  if ($response = $this->‪processData($request)) {
538  return $response;
539  }
540  }
541 
542  $this->‪init($request);
543  $this->‪main($request);
544 
545  return new HtmlResponse($this->moduleTemplate->renderContent());
546  }
547 
554  public function ‪preInit(ServerRequestInterface $request = null): ?ResponseInterface
555  {
556  if ($request === null) {
557  // Missing argument? This method must have been called from outside.
558  // Method will be protected and $request mandatory in TYPO3 v10.0, giving core freedom to move stuff around
559  // New v10 signature: "protected function preInit(ServerRequestInterface $request): ?ResponseInterface"
560  // @deprecated since TYPO3 v9, method argument $request will be set to mandatory
561  trigger_error('EditDocumentController->preInit() will be set to protected in TYPO3 v10.0. Do not call from other extension.', E_USER_DEPRECATED);
562  $request = ‪$GLOBALS['TYPO3_REQUEST'];
563  }
564 
565  if ($response = $this->‪localizationRedirect($request)) {
566  return $response;
567  }
568 
569  $parsedBody = $request->getParsedBody();
570  $queryParams = $request->getQueryParams();
571 
572  $this->editconf = $parsedBody['edit'] ?? $queryParams['edit'] ?? [];
573  $this->defVals = $parsedBody['defVals'] ?? $queryParams['defVals'] ?? null;
574  $this->overrideVals = $parsedBody['overrideVals'] ?? $queryParams['overrideVals'] ?? null;
575  $this->columnsOnly = $parsedBody['columnsOnly'] ?? $queryParams['columnsOnly'] ?? null;
576  $this->returnUrl = GeneralUtility::sanitizeLocalUrl($parsedBody['returnUrl'] ?? $queryParams['returnUrl'] ?? null);
577  $this->closeDoc = (int)($parsedBody['closeDoc'] ?? $queryParams['closeDoc'] ?? self::DOCUMENT_CLOSE_MODE_DEFAULT);
578  $this->doSave = (bool)($parsedBody['doSave'] ?? $queryParams['doSave'] ?? false);
579  $this->returnEditConf = (bool)($parsedBody['returnEditConf'] ?? $queryParams['returnEditConf'] ?? false);
580  $this->workspace = $parsedBody['workspace'] ?? $queryParams['workspace'] ?? null;
581  $this->uc = $parsedBody['uc'] ?? $queryParams['uc'] ?? null;
582 
583  // Set overrideVals as default values if defVals does not exist.
584  // @todo: Why?
585  if (!is_array($this->defVals) && is_array($this->overrideVals)) {
586  $this->defVals = ‪$this->overrideVals;
587  }
588  $this->‪addSlugFieldsToColumnsOnly($queryParams);
589 
590  // Set final return URL
591  $this->retUrl = $this->returnUrl ?: (string)$this->uriBuilder->buildUriFromRoute('dummy');
592 
593  // Change $this->editconf if versioning applies to any of the records
595 
596  // Prepare R_URL (request url)
597  $this->R_URL_parts = parse_url($request->getAttribute('normalizedParams')->getRequestUri());
598  $this->R_URL_getvars = $queryParams;
599  $this->R_URL_getvars['edit'] = ‪$this->editconf;
600 
601  // Prepare 'open documents' url, this is later modified again various times
602  $this->‪compileStoreData();
603  // Backend user session data of this module
604  $this->docDat = $this->‪getBackendUser()->‪getModuleData('FormEngine', 'ses');
605  $this->docHandler = $this->docDat[0];
606 
607  // Close document if a request for closing the document has been sent
608  if ((int)$this->closeDoc > self::DOCUMENT_CLOSE_MODE_DEFAULT) {
609  if ($response = $this->‪closeDocument($this->closeDoc, $request)) {
610  return $response;
611  }
612  }
613 
614  // Sets a temporary workspace, this request is based on
615  if ($this->workspace !== null) {
616  $this->‪getBackendUser()->‪setTemporaryWorkspace($this->workspace);
617  }
618 
619  $this->‪emitFunctionAfterSignal('preInit', $request);
620 
621  return null;
622  }
623 
630  public function ‪doProcessData()
631  {
632  trigger_error('EditDocumentController->doProcessData() will be removed in TYPO3 v10.0.', E_USER_DEPRECATED);
633 
634  $out = $this->doSave
635  || isset($_POST['_savedok'])
636  || isset($_POST['_saveandclosedok'])
637  || isset($_POST['_savedokview'])
638  || isset($_POST['_savedoknew'])
639  || isset($_POST['_duplicatedoc']);
640  return $out;
641  }
642 
648  protected function ‪addSlugFieldsToColumnsOnly(array $queryParams): void
649  {
650  ‪$data = $queryParams['edit'] ?? [];
651  ‪$data = array_keys(‪$data);
652  $table = reset(‪$data);
653  if ($this->columnsOnly && $table !== false && isset(‪$GLOBALS['TCA'][$table])) {
654  ‪$fields = GeneralUtility::trimExplode(',', $this->columnsOnly, true);
655  foreach (‪$fields as $field) {
656  if (isset(‪$GLOBALS['TCA'][$table]['columns'][$field]) && ‪$GLOBALS['TCA'][$table]['columns'][$field]['config']['type'] === 'slug') {
657  foreach (‪$GLOBALS['TCA'][$table]['columns'][$field]['config']['generatorOptions']['fields'] as ‪$fields) {
658  $this->columnsOnly .= ',' . (is_array(‪$fields) ? implode(',', ‪$fields) : ‪$fields);
659  }
660  }
661  }
662  }
663  }
664 
671  public function ‪processData(ServerRequestInterface $request = null): ?ResponseInterface
672  {
673  // @deprecated Variable can be removed in TYPO3 v10.0
674  $deprecatedCaller = false;
675  if ($request === null) {
676  // Missing argument? This method must have been called from outside.
677  // Method will be protected and $request mandatory in TYPO3 v10.0, giving core freedom to move stuff around
678  // New v10 signature: "protected function processData(ServerRequestInterface $request): ?ResponseInterface"
679  // @deprecated since TYPO3 v9, method argument $request will be set to mandatory
680  trigger_error('EditDocumentController->processData() will be set to protected in TYPO3 v10.0. Do not call from other extension.', E_USER_DEPRECATED);
681  $request = ‪$GLOBALS['TYPO3_REQUEST'];
682  $deprecatedCaller = true;
683  }
684 
685  $parsedBody = $request->getParsedBody();
686  $queryParams = $request->getQueryParams();
687 
688  $beUser = $this->‪getBackendUser();
689 
690  // Processing related GET / POST vars
691  $this->data = $parsedBody['data'] ?? $queryParams['data'] ?? [];
692  $this->cmd = $parsedBody['cmd'] ?? $queryParams['cmd'] ?? [];
693  $this->mirror = $parsedBody['mirror'] ?? $queryParams['mirror'] ?? [];
694  // @deprecated property cacheCmd is unused and can be removed in TYPO3 v10.0
695  $this->cacheCmd = $parsedBody['cacheCmd'] ?? $queryParams['cacheCmd'] ?? null;
696  // @deprecated property redirect is unused and can be removed in TYPO3 v10.0
697  $this->redirect = $parsedBody['redirect'] ?? $queryParams['redirect'] ?? null;
698  $this->returnNewPageId = (bool)($parsedBody['returnNewPageId'] ?? $queryParams['returnNewPageId'] ?? false);
699 
700  // Only options related to $this->data submission are included here
701  $tce = GeneralUtility::makeInstance(DataHandler::class);
702 
703  $tce->setControl($parsedBody['control'] ?? $queryParams['control'] ?? []);
704 
705  // Set internal vars
706  if (isset($beUser->uc['neverHideAtCopy']) && $beUser->uc['neverHideAtCopy']) {
707  $tce->neverHideAtCopy = 1;
708  }
709  // Load DataHandler with data
710  $tce->start($this->data, $this->cmd);
711  if (is_array($this->mirror)) {
712  $tce->setMirror($this->mirror);
713  }
714 
715  // Perform the saving operation with DataHandler:
716  if ($this->doSave === true) {
717  // @todo: Make DataHandler understand UploadedFileInterface and submit $request->getUploadedFiles() instead of $_FILES here
718  $tce->process_uploads($_FILES);
719  $tce->process_datamap();
720  $tce->process_cmdmap();
721  }
722  // If pages are being edited, we set an instruction about updating the page tree after this operation.
723  if ($tce->pagetreeNeedsRefresh
724  && (isset($this->data['pages']) || $beUser->workspace != 0 && !empty($this->data))
725  ) {
726  ‪BackendUtility::setUpdateSignal('updatePageTree');
727  }
728  // If there was saved any new items, load them:
729  if (!empty($tce->substNEWwithIDs_table)) {
730  // Save the expanded/collapsed states for new inline records, if any
732  $newEditConf = [];
733  foreach ($this->editconf as $tableName => $tableCmds) {
734  $keys = array_keys($tce->substNEWwithIDs_table, $tableName);
735  if (!empty($keys)) {
736  foreach ($keys as $key) {
737  $editId = $tce->substNEWwithIDs[$key];
738  // Check if the $editId isn't a child record of an IRRE action
739  if (!(is_array($tce->newRelatedIDs[$tableName])
740  && in_array($editId, $tce->newRelatedIDs[$tableName]))
741  ) {
742  // Translate new id to the workspace version
744  $beUser->workspace,
745  $tableName,
746  $editId,
747  'uid'
748  )) {
749  $editId = $versionRec['uid'];
750  }
751  $newEditConf[$tableName][$editId] = 'edit';
752  }
753  // Traverse all new records and forge the content of ->editconf so we can continue to edit these records!
754  if ($tableName === 'pages'
755  && $this->retUrl !== (string)$this->uriBuilder->buildUriFromRoute('dummy')
756  && $this->retUrl !== $this->getCloseUrl()
757  && $this->returnNewPageId
758  ) {
759  $this->retUrl .= '&id=' . $tce->substNEWwithIDs[$key];
760  }
761  }
762  } else {
763  $newEditConf[$tableName] = $tableCmds;
764  }
765  }
766  // Reset editconf if newEditConf has values
767  if (!empty($newEditConf)) {
768  $this->editconf = $newEditConf;
769  }
770  // Finally, set the editconf array in the "getvars" so they will be passed along in URLs as needed.
771  $this->R_URL_getvars['edit'] = ‪$this->editconf;
772  // Unset default values since we don't need them anymore.
773  unset($this->R_URL_getvars['defVals']);
774  // Recompile the store* values since editconf changed
775  $this->‪compileStoreData();
776  }
777  // See if any records was auto-created as new versions?
778  if (!empty($tce->autoVersionIdMap)) {
779  $this->‪fixWSversioningInEditConf($tce->autoVersionIdMap);
780  }
781  // If a document is saved and a new one is created right after.
782  if (isset($parsedBody['_savedoknew']) && is_array($this->editconf)) {
783  if (‪$redirect = $this->‪closeDocument(self::DOCUMENT_CLOSE_MODE_NO_REDIRECT, $request)) {
784  return ‪$redirect;
785  }
786  // Find the current table
787  reset($this->editconf);
788  $nTable = key($this->editconf);
789  // Finding the first id, getting the records pid+uid
790  reset($this->editconf[$nTable]);
791  $nUid = key($this->editconf[$nTable]);
792  $recordFields = 'pid,uid';
793  if (!empty(‪$GLOBALS['TCA'][$nTable]['ctrl']['versioningWS'])) {
794  $recordFields .= ',t3ver_oid';
795  }
796  $nRec = ‪BackendUtility::getRecord($nTable, $nUid, $recordFields);
797  // Determine insertion mode: 'top' is self-explaining,
798  // otherwise new elements are inserted after one using a negative uid
799  $insertRecordOnTop = ($this->‪getTsConfigOption($nTable, 'saveDocNew') === 'top');
800  // Setting a blank editconf array for a new record:
801  $this->editconf = [];
802  // Determine related page ID for regular live context
803  if ($nRec['pid'] != -1) {
804  if ($insertRecordOnTop) {
805  $relatedPageId = $nRec['pid'];
806  } else {
807  $relatedPageId = -$nRec['uid'];
808  }
809  } else {
810  // Determine related page ID for workspace context
811  if ($insertRecordOnTop) {
812  // Fetch live version of workspace version since the pid value is always -1 in workspaces
813  $liveRecord = ‪BackendUtility::getRecord($nTable, $nRec['t3ver_oid'], $recordFields);
814  $relatedPageId = $liveRecord['pid'];
815  } else {
816  // Use uid of live version of workspace version
817  $relatedPageId = -$nRec['t3ver_oid'];
818  }
819  }
820  $this->editconf[$nTable][$relatedPageId] = 'new';
821  // Finally, set the editconf array in the "getvars" so they will be passed along in URLs as needed.
822  $this->R_URL_getvars['edit'] = ‪$this->editconf;
823  // Recompile the store* values since editconf changed...
824  $this->‪compileStoreData();
825  }
826  // If a document should be duplicated.
827  if (isset($parsedBody['_duplicatedoc']) && is_array($this->editconf)) {
828  $this->‪closeDocument(self::DOCUMENT_CLOSE_MODE_NO_REDIRECT, $request);
829  // Find current table
830  reset($this->editconf);
831  $nTable = key($this->editconf);
832  // Find the first id, getting the records pid+uid
833  reset($this->editconf[$nTable]);
834  $nUid = key($this->editconf[$nTable]);
836  $nUid = $tce->substNEWwithIDs[$nUid];
837  }
838 
839  $recordFields = 'pid,uid';
840  if (!empty(‪$GLOBALS['TCA'][$nTable]['ctrl']['versioningWS'])) {
841  $recordFields .= ',t3ver_oid';
842  }
843  $nRec = ‪BackendUtility::getRecord($nTable, $nUid, $recordFields);
844 
845  // Setting a blank editconf array for a new record:
846  $this->editconf = [];
847 
848  if ($nRec['pid'] != -1) {
849  $relatedPageId = -$nRec['uid'];
850  } else {
851  $relatedPageId = -$nRec['t3ver_oid'];
852  }
853 
855  $duplicateTce = GeneralUtility::makeInstance(DataHandler::class);
856 
857  $duplicateCmd = [
858  $nTable => [
859  $nUid => [
860  'copy' => $relatedPageId
861  ]
862  ]
863  ];
864 
865  $duplicateTce->start([], $duplicateCmd);
866  $duplicateTce->process_cmdmap();
867 
868  $duplicateMappingArray = $duplicateTce->copyMappingArray;
869  $duplicateUid = $duplicateMappingArray[$nTable][$nUid];
870 
871  if ($nTable === 'pages') {
872  ‪BackendUtility::setUpdateSignal('updatePageTree');
873  }
874 
875  $this->editconf[$nTable][$duplicateUid] = 'edit';
876  // Finally, set the editconf array in the "getvars" so they will be passed along in URLs as needed.
877  $this->R_URL_getvars['edit'] = ‪$this->editconf;
878  // Recompile the store* values since editconf changed...
879  $this->‪compileStoreData();
880 
881  // Inform the user of the duplication
882  $flashMessage = GeneralUtility::makeInstance(
883  FlashMessage::class,
884  $this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.recordDuplicated'),
885  '',
887  );
888  $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
889  $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
890  $defaultFlashMessageQueue->enqueue($flashMessage);
891  }
892  // If a preview is requested
893  if (isset($parsedBody['_savedokview'])) {
894  // Get the first table and id of the data array from DataHandler
895  $table = reset(array_keys($this->data));
896  $id = reset(array_keys($this->data[$table]));
898  $id = $tce->substNEWwithIDs[$id];
899  }
900  // Store this information for later use
901  $this->previewData['table'] = $table;
902  $this->previewData['id'] = $id;
903  }
904  $tce->printLogErrorMessages();
905 
906  if ((int)$this->closeDoc < self::DOCUMENT_CLOSE_MODE_DEFAULT
907  || isset($parsedBody['_saveandclosedok'])
908  ) {
909  // Redirect if element should be closed after save
910  $possibleRedirect = $this->‪closeDocument(abs($this->closeDoc), $request);
911  if ($deprecatedCaller && $possibleRedirect) {
912  // @deprecated fall back if method has been called from outside. This if can be removed in TYPO3 v10.0
913  ‪HttpUtility::redirect($possibleRedirect->getHeaders()['location'][0]);
914  }
915  return $possibleRedirect;
916  }
917  return null;
918  }
919 
925  public function ‪init(ServerRequestInterface $request = null): void
926  {
927  if ($request === null) {
928  // Missing argument? This method must have been called from outside.
929  // Method will be protected and $request mandatory in TYPO3 v10.0, giving core freedom to move stuff around
930  // New v10 signature: "protected function init(ServerRequestInterface $request): void
931  // @deprecated since TYPO3 v9, method argument $request will be set to mandatory
932  trigger_error('EditDocumentController->init() will be set to protected in TYPO3 v10.0. Do not call from other extension.', E_USER_DEPRECATED);
933  $request = ‪$GLOBALS['TYPO3_REQUEST'];
934  }
935 
936  $parsedBody = $request->getParsedBody();
937  $queryParams = $request->getQueryParams();
938 
939  $beUser = $this->‪getBackendUser();
940 
941  // @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0, unused, remove call in TYPO3 v10.0
942  $this->popViewId_addParams = $parsedBody['popViewId_addParams'] ?? $queryParams['popViewId_addParams'] ?? '';
943 
944  $this->popViewId = (int)($parsedBody['popViewId'] ?? $queryParams['popViewId'] ?? 0);
945  $this->viewUrl = (string)($parsedBody['viewUrl'] ?? $queryParams['viewUrl'] ?? '');
946  $this->recTitle = (string)($parsedBody['recTitle'] ?? $queryParams['recTitle'] ?? '');
947  $this->noView = (bool)($parsedBody['noView'] ?? $queryParams['noView'] ?? false);
948  $this->perms_clause = $beUser->getPagePermsClause(‪Permission::PAGE_SHOW);
949  // Set other internal variables:
950  $this->R_URL_getvars['returnUrl'] = ‪$this->retUrl;
951  $this->R_URI = $this->R_URL_parts['path'] . ‪HttpUtility::buildQueryString($this->R_URL_getvars, '?');
952 
953  // @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0, unused
954  $this->MCONF['name'] = 'xMOD_alt_doc.php';
955  // @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0, unused
956  $this->doc = ‪$GLOBALS['TBE_TEMPLATE'];
957 
958  $pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
959  $pageRenderer->addInlineLanguageLabelFile('EXT:backend/Resources/Private/Language/locallang_alt_doc.xlf');
960 
961  // override the default jumpToUrl
962  $this->moduleTemplate->addJavaScriptCode(
963  'jumpToUrl',
964  '
965  // Info view:
966  function launchView(table,uid) {
967  console.warn(\'Calling launchView() has been deprecated in TYPO3 v9 and will be removed in TYPO3 v10.0\');
968  var thePreviewWindow = window.open(
969  ' . GeneralUtility::quoteJSvalue((string)$this->uriBuilder->buildUriFromRoute('show_item') . '&table=') . ' + encodeURIComponent(table) + "&uid=" + encodeURIComponent(uid),
970  "ShowItem" + Math.random().toString(16).slice(2),
971  "height=300,width=410,status=0,menubar=0,resizable=0,location=0,directories=0,scrollbars=1,toolbar=0"
972  );
973  if (thePreviewWindow && thePreviewWindow.focus) {
974  thePreviewWindow.focus();
975  }
976  }
977  function deleteRecord(table,id,url) {
978  window.location.href = ' . GeneralUtility::quoteJSvalue((string)$this->uriBuilder->buildUriFromRoute('tce_db') . '&cmd[') . '+table+"]["+id+"][delete]=1&redirect="+escape(url);
979  }
980  ' . (isset($parsedBody['_savedokview']) && $this->popViewId ? $this->‪generatePreviewCode() : '')
981  );
982  // Set context sensitive menu
983  $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ContextMenu');
984 
985  $this->‪emitFunctionAfterSignal('init', $request);
986  }
987 
993  protected function ‪generatePreviewCode(): string
994  {
995  $previewPageId = $this->‪getPreviewPageId();
996  $previewPageRootLine = ‪BackendUtility::BEgetRootLine($previewPageId);
997  $anchorSection = $this->‪getPreviewUrlAnchorSection();
998  $previewUrlParameters = $this->‪getPreviewUrlParameters($previewPageId);
999 
1000  return '
1001  if (window.opener) {
1002  '
1004  $previewPageId,
1005  '',
1006  $previewPageRootLine,
1007  $anchorSection,
1008  $this->viewUrl,
1009  $previewUrlParameters,
1010  false
1011  )
1012  . '
1013  } else {
1014  '
1016  $previewPageId,
1017  '',
1018  $previewPageRootLine,
1019  $anchorSection,
1020  $this->viewUrl,
1021  $previewUrlParameters
1022  )
1023  . '
1024  }';
1025  }
1026 
1033  protected function ‪getPreviewUrlParameters(int $previewPageId): string
1034  {
1035  $linkParameters = [];
1036  $table = $this->previewData['table'] ?: $this->firstEl['table'];
1037  $recordId = $this->previewData['id'] ?: $this->firstEl['uid'];
1038  $previewConfiguration = ‪BackendUtility::getPagesTSconfig($previewPageId)['TCEMAIN.']['preview.'][$table . '.'] ?? [];
1039  $recordArray = ‪BackendUtility::getRecord($table, $recordId);
1040 
1041  // language handling
1042  $languageField = ‪$GLOBALS['TCA'][$table]['ctrl']['languageField'] ?? '';
1043  if ($languageField && !empty($recordArray[$languageField])) {
1044  $recordId = $this->‪resolvePreviewRecordId($table, $recordArray, $previewConfiguration);
1045  $language = $recordArray[$languageField];
1046  if ($language > 0) {
1047  $linkParameters['L'] = $language;
1048  }
1049  }
1050 
1051  // Always use live workspace record uid for the preview
1052  if (‪BackendUtility::isTableWorkspaceEnabled($table) && $recordArray['t3ver_oid'] > 0) {
1053  $recordId = $recordArray['t3ver_oid'];
1054  }
1055 
1056  // map record data to GET parameters
1057  if (isset($previewConfiguration['fieldToParameterMap.'])) {
1058  foreach ($previewConfiguration['fieldToParameterMap.'] as $field => $parameterName) {
1059  $value = $recordArray[$field];
1060  if ($field === 'uid') {
1061  $value = $recordId;
1062  }
1063  $linkParameters[$parameterName] = $value;
1064  }
1065  }
1066 
1067  // add/override parameters by configuration
1068  if (isset($previewConfiguration['additionalGetParameters.'])) {
1069  $additionalGetParameters = [];
1071  $additionalGetParameters,
1072  $previewConfiguration['additionalGetParameters.']
1073  );
1074  $linkParameters = array_replace($linkParameters, $additionalGetParameters);
1075  }
1076 
1077  if (!empty($previewConfiguration['useCacheHash'])) {
1078  $cacheHashCalculator = GeneralUtility::makeInstance(CacheHashCalculator::class);
1079  $fullLinkParameters = ‪HttpUtility::buildQueryString(array_merge($linkParameters, ['id' => $previewPageId]), '&');
1080  $cacheHashParameters = $cacheHashCalculator->getRelevantParameters($fullLinkParameters);
1081  $linkParameters['cHash'] = $cacheHashCalculator->calculateCacheHash($cacheHashParameters);
1082  } elseif (empty(‪$GLOBALS['TYPO3_CONF_VARS']['FE']['disableNoCacheParameter'])) {
1083  $linkParameters['no_cache'] = 1;
1084  }
1085 
1086  return ‪HttpUtility::buildQueryString($linkParameters, '&');
1087  }
1088 
1096  protected function ‪resolvePreviewRecordId(string $table, array $recordArray, array $previewConfiguration): int
1097  {
1098  $l10nPointer = ‪$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'] ?? '';
1099  if ($l10nPointer
1100  && !empty($recordArray[$l10nPointer])
1101  && (
1102  // not set -> default to true
1103  !isset($previewConfiguration['useDefaultLanguageRecord'])
1104  // or set -> use value
1105  || $previewConfiguration['useDefaultLanguageRecord']
1106  )
1107  ) {
1108  return (int)$recordArray[$l10nPointer];
1109  }
1110  return (int)$recordArray['uid'];
1111  }
1112 
1118  protected function ‪getPreviewUrlAnchorSection(): string
1119  {
1120  $table = $this->previewData['table'] ?: $this->firstEl['table'];
1121  $recordId = $this->previewData['id'] ?: $this->firstEl['uid'];
1122 
1123  return $table === 'tt_content' ? '#c' . (int)$recordId : '';
1124  }
1125 
1131  protected function ‪getPreviewPageId(): int
1132  {
1133  $previewPageId = 0;
1134  $table = $this->previewData['table'] ?: $this->firstEl['table'];
1135  $recordId = $this->previewData['id'] ?: $this->firstEl['uid'];
1136  $pageId = $this->popViewId ?: ‪$this->viewId;
1137 
1138  if ($table === 'pages') {
1139  $currentPageId = (int)$recordId;
1140  } else {
1141  $currentPageId = ‪MathUtility::convertToPositiveInteger($pageId);
1142  }
1143 
1144  $previewConfiguration = ‪BackendUtility::getPagesTSconfig($currentPageId)['TCEMAIN.']['preview.'][$table . '.'] ?? [];
1145 
1146  if (isset($previewConfiguration['previewPageId'])) {
1147  $previewPageId = (int)$previewConfiguration['previewPageId'];
1148  }
1149  // if no preview page was configured
1150  if (!$previewPageId) {
1151  $rootPageData = null;
1152  $rootLine = ‪BackendUtility::BEgetRootLine($currentPageId);
1153  $currentPage = reset($rootLine);
1154  // Allow all doktypes below 200
1155  // This makes custom doktype work as well with opening a frontend page.
1156  if ((int)$currentPage['doktype'] <= ‪PageRepository::DOKTYPE_SPACER) {
1157  // try the current page
1158  $previewPageId = $currentPageId;
1159  } else {
1160  // or search for the root page
1161  foreach ($rootLine as $page) {
1162  if ($page['is_siteroot']) {
1163  $rootPageData = $page;
1164  break;
1165  }
1166  }
1167  $previewPageId = isset($rootPageData)
1168  ? (int)$rootPageData['uid']
1169  : $currentPageId;
1170  }
1171  }
1172 
1173  $this->popViewId = $previewPageId;
1174 
1175  return $previewPageId;
1176  }
1177 
1187  protected function ‪parseAdditionalGetParameters(array &$parameters, array $typoScript)
1188  {
1189  foreach ($typoScript as $key => $value) {
1190  if (is_array($value)) {
1191  $key = rtrim($key, '.');
1192  $parameters[$key] = [];
1193  $this->‪parseAdditionalGetParameters($parameters[$key], $value);
1194  } else {
1195  $parameters[$key] = $value;
1196  }
1197  }
1198  }
1199 
1205  public function ‪main(ServerRequestInterface $request = null): void
1206  {
1207  if ($request === null) {
1208  // Set method signature in TYPO3 v10.0 to: "protected function main(ServerRequestInterface $request): void"
1209  trigger_error('EditDocumentController->main() will be set to protected in TYPO3 v10.0.', E_USER_DEPRECATED);
1210  $request = ‪$GLOBALS['TYPO3_REQUEST'];
1211  }
1212 
1213  $body = '';
1214  // Begin edit
1215  if (is_array($this->editconf)) {
1216  $this->formResultCompiler = GeneralUtility::makeInstance(FormResultCompiler::class);
1217 
1218  // Creating the editing form, wrap it with buttons, document selector etc.
1219  $editForm = $this->‪makeEditForm();
1220  if ($editForm) {
1221  $this->firstEl = reset($this->elementsData);
1222  // Checking if the currently open document is stored in the list of "open documents" - if not, add it:
1223  if (($this->docDat[1] !== $this->storeUrlMd5 || !isset($this->docHandler[$this->storeUrlMd5]))
1224  && !$this->dontStoreDocumentRef
1225  ) {
1226  $this->docHandler[‪$this->storeUrlMd5] = [
1231  ];
1232  $this->‪getBackendUser()->‪pushModuleData('FormEngine', [$this->docHandler, $this->storeUrlMd5]);
1233  ‪BackendUtility::setUpdateSignal('OpendocsController::updateNumber', count($this->docHandler));
1234  }
1235  $body = $this->formResultCompiler->addCssFiles();
1236  $body .= $this->‪compileForm($editForm);
1237  $body .= $this->formResultCompiler->printNeededJSFunctions();
1238  $body .= '</form>';
1239  }
1240  }
1241  // Access check...
1242  // The page will show only if there is a valid page and if this page may be viewed by the user
1243  $this->pageinfo = ‪BackendUtility::readPageAccess($this->viewId, $this->perms_clause);
1244  if ($this->pageinfo) {
1245  $this->moduleTemplate->getDocHeaderComponent()->setMetaInformation($this->pageinfo);
1246  }
1247  // Setting up the buttons and markers for doc header
1248  $this->‪getButtons($request);
1249  $this->‪languageSwitch(
1250  (string)($this->firstEl['table'] ?? ''),
1251  (int)($this->firstEl['uid'] ?? 0),
1252  isset($this->firstEl['pid']) ? (int)$this->firstEl['pid'] : null
1253  );
1254  $this->moduleTemplate->setContent($body);
1255  }
1256 
1262  protected function ‪makeEditForm(): string
1263  {
1264  // Initialize variables
1265  $this->elementsData = [];
1266  $this->errorC = 0;
1267  $this->newC = 0;
1268  $editForm = '';
1269  $beUser = $this->‪getBackendUser();
1270  // Traverse the GPvar edit array tables
1271  foreach ($this->editconf as $table => $conf) {
1272  if (is_array($conf) && ‪$GLOBALS['TCA'][$table] && $beUser->check('tables_modify', $table)) {
1273  // Traverse the keys/comments of each table (keys can be a comma list of uids)
1274  foreach ($conf as $cKey => $command) {
1275  if ($command === 'edit' || $command === 'new') {
1276  // Get the ids:
1277  $ids = GeneralUtility::trimExplode(',', $cKey, true);
1278  // Traverse the ids:
1279  foreach ($ids as $theUid) {
1280  // Don't save this document title in the document selector if the document is new.
1281  if ($command === 'new') {
1282  $this->dontStoreDocumentRef = 1;
1283  }
1284 
1285  try {
1286  $formDataGroup = GeneralUtility::makeInstance(TcaDatabaseRecord::class);
1287  $formDataCompiler = GeneralUtility::makeInstance(FormDataCompiler::class, $formDataGroup);
1288  $nodeFactory = GeneralUtility::makeInstance(NodeFactory::class);
1289 
1290  // Reset viewId - it should hold data of last entry only
1291  $this->viewId = 0;
1292  $this->viewId_addParams = '';
1293 
1294  $formDataCompilerInput = [
1295  'tableName' => $table,
1296  'vanillaUid' => (int)$theUid,
1297  'command' => $command,
1298  'returnUrl' => $this->R_URI,
1299  ];
1300  if (is_array($this->overrideVals) && is_array($this->overrideVals[$table])) {
1301  $formDataCompilerInput['overrideValues'] = $this->overrideVals[$table];
1302  }
1303  if (!empty($this->defVals) && is_array($this->defVals)) {
1304  $formDataCompilerInput['defaultValues'] = ‪$this->defVals;
1305  }
1306 
1307  $formData = $formDataCompiler->compile($formDataCompilerInput);
1308 
1309  // Set this->viewId if possible
1310  if ($command === 'new'
1311  && $table !== 'pages'
1312  && !empty($formData['parentPageRow']['uid'])
1313  ) {
1314  $this->viewId = $formData['parentPageRow']['uid'];
1315  } else {
1316  if ($table === 'pages') {
1317  $this->viewId = $formData['databaseRow']['uid'];
1318  } elseif (!empty($formData['parentPageRow']['uid'])) {
1319  $this->viewId = $formData['parentPageRow']['uid'];
1320  // Adding "&L=xx" if the record being edited has a languageField with a value larger than zero!
1321  if (!empty($formData['processedTca']['ctrl']['languageField'])
1322  && is_array($formData['databaseRow'][$formData['processedTca']['ctrl']['languageField']])
1323  && $formData['databaseRow'][$formData['processedTca']['ctrl']['languageField']][0] > 0
1324  ) {
1325  $this->viewId_addParams = '&L=' . $formData['databaseRow'][$formData['processedTca']['ctrl']['languageField']][0];
1326  }
1327  }
1328  }
1329 
1330  // Determine if delete button can be shown
1331  $deleteAccess = false;
1332  if (
1333  $command === 'edit'
1334  || $command === 'new'
1335  ) {
1336  $permission = $formData['userPermissionOnPage'];
1337  if ($formData['tableName'] === 'pages') {
1338  $deleteAccess = $permission & ‪Permission::PAGE_DELETE ? true : false;
1339  } else {
1340  $deleteAccess = $permission & ‪Permission::CONTENT_EDIT ? true : false;
1341  }
1342  }
1343 
1344  // Display "is-locked" message
1345  if ($command === 'edit') {
1346  $lockInfo = ‪BackendUtility::isRecordLocked($table, $formData['databaseRow']['uid']);
1347  if ($lockInfo) {
1348  $flashMessage = GeneralUtility::makeInstance(
1349  FlashMessage::class,
1350  $lockInfo['msg'],
1351  '',
1353  );
1354  $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
1355  $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
1356  $defaultFlashMessageQueue->enqueue($flashMessage);
1357  }
1358  }
1359 
1360  // Record title
1361  if (!$this->storeTitle) {
1362  $this->storeTitle = $this->recTitle
1363  ? htmlspecialchars($this->recTitle)
1364  : BackendUtility::getRecordTitle($table, FormEngineUtility::databaseRowCompatibility($formData['databaseRow']), true);
1365  }
1366 
1367  $this->elementsData[] = [
1368  'table' => $table,
1369  'uid' => $formData['databaseRow']['uid'],
1370  'pid' => $formData['databaseRow']['pid'],
1371  'cmd' => $command,
1372  'deleteAccess' => $deleteAccess
1373  ];
1374 
1375  if ($command !== 'new') {
1376  ‪BackendUtility::lockRecords($table, $formData['databaseRow']['uid'], $table === 'tt_content' ? $formData['databaseRow']['pid'] : 0);
1377  }
1378 
1379  // Set list if only specific fields should be rendered. This will trigger
1380  // ListOfFieldsContainer instead of FullRecordContainer in OuterWrapContainer
1381  if ($this->columnsOnly) {
1382  if (is_array($this->columnsOnly)) {
1383  $formData['fieldListToRender'] = $this->columnsOnly[$table];
1384  } else {
1385  $formData['fieldListToRender'] = ‪$this->columnsOnly;
1386  }
1387  }
1388 
1389  $formData['renderType'] = 'outerWrapContainer';
1390  $formResult = $nodeFactory->create($formData)->render();
1391 
1392  $html = $formResult['html'];
1393 
1394  $formResult['html'] = '';
1395  $formResult['doSaveFieldName'] = 'doSave';
1396 
1397  // @todo: Put all the stuff into FormEngine as final "compiler" class
1398  // @todo: This is done here for now to not rewrite addCssFiles()
1399  // @todo: and printNeededJSFunctions() now
1400  $this->formResultCompiler->mergeResult($formResult);
1401 
1402  // Seems the pid is set as hidden field (again) at end?!
1403  if ($command === 'new') {
1404  // @todo: looks ugly
1405  $html .= LF
1406  . '<input type="hidden"'
1407  . ' name="data[' . htmlspecialchars($table) . '][' . htmlspecialchars($formData['databaseRow']['uid']) . '][pid]"'
1408  . ' value="' . (int)$formData['databaseRow']['pid'] . '" />';
1409  $this->newC++;
1410  }
1411 
1412  $editForm .= $html;
1413  } catch (AccessDeniedException $e) {
1414  $this->errorC++;
1415  // Try to fetch error message from "recordInternals" be user object
1416  // @todo: This construct should be logged and localized and de-uglified
1417  $message = $beUser->errorMsg;
1418  if (empty($message)) {
1419  // Create message from exception.
1420  $message = $e->getMessage() . ' ' . $e->getCode();
1421  }
1422  $editForm .= htmlspecialchars($this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.noEditPermission'))
1423  . '<br /><br />' . htmlspecialchars($message) . '<br /><br />';
1424  } catch (DatabaseRecordException $e) {
1425  $editForm = '<div class="alert alert-warning">' . htmlspecialchars($e->getMessage()) . '</div>';
1426  }
1427  } // End of for each uid
1428  }
1429  }
1430  }
1431  }
1432  return $editForm;
1433  }
1434 
1440  protected function ‪getButtons(ServerRequestInterface $request): void
1441  {
1442  $record = ‪BackendUtility::getRecord($this->firstEl['table'], $this->firstEl['uid']);
1443  $TCActrl = ‪$GLOBALS['TCA'][$this->firstEl['table']]['ctrl'];
1444 
1445  $this->‪setIsSavedRecord();
1446 
1447  $sysLanguageUid = 0;
1448  if (
1449  $this->isSavedRecord
1450  && isset($TCActrl['languageField'], $record[$TCActrl['languageField']])
1451  ) {
1452  $sysLanguageUid = (int)$record[$TCActrl['languageField']];
1453  } elseif (isset($this->defVals['sys_language_uid'])) {
1454  $sysLanguageUid = (int)$this->defVals['sys_language_uid'];
1455  }
1456 
1457  $l18nParent = isset($TCActrl['transOrigPointerField'], $record[$TCActrl['transOrigPointerField']])
1458  ? (int)$record[$TCActrl['transOrigPointerField']]
1459  : 0;
1460 
1461  $this->‪setIsPageInFreeTranslationMode($record, $sysLanguageUid);
1462 
1463  $buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
1464 
1466 
1467  // Show buttons when table is not read-only
1468  if (
1469  !$this->errorC
1470  && !‪$GLOBALS['TCA'][$this->firstEl['table']]['ctrl']['readOnly']
1471  ) {
1474  if ($this->firstEl['cmd'] !== 'new') {
1476  $buttonBar,
1478  4,
1479  $sysLanguageUid,
1480  $l18nParent
1481  );
1483  $buttonBar,
1485  5,
1486  $sysLanguageUid,
1487  $l18nParent
1488  );
1489  }
1493  }
1494 
1498  }
1499 
1503  protected function ‪setIsSavedRecord()
1504  {
1505  if (!is_bool($this->isSavedRecord)) {
1506  $this->isSavedRecord = (
1507  $this->firstEl['cmd'] !== 'new'
1508  && ‪MathUtility::canBeInterpretedAsInteger($this->firstEl['uid'])
1509  );
1510  }
1511  }
1512 
1518  protected function ‪isInconsistentLanguageHandlingAllowed(): bool
1519  {
1520  $allowInconsistentLanguageHandling = ‪BackendUtility::getPagesTSconfig(
1521  $this->pageinfo['uid']
1522  )['mod']['web_layout']['allowInconsistentLanguageHandling'];
1523 
1524  return $allowInconsistentLanguageHandling['value'] === '1';
1525  }
1526 
1533  protected function ‪setIsPageInFreeTranslationMode($record, int $sysLanguageUid)
1534  {
1535  if ($this->firstEl['table'] === 'tt_content') {
1536  if (!$this->isSavedRecord) {
1537  $this->isPageInFreeTranslationMode = $this->‪getFreeTranslationMode(
1538  (int)$this->pageinfo['uid'],
1539  (int)$this->defVals['colPos'],
1540  $sysLanguageUid
1541  );
1542  } else {
1543  $this->isPageInFreeTranslationMode = $this->‪getFreeTranslationMode(
1544  (int)$this->pageinfo['uid'],
1545  (int)$record['colPos'],
1546  $sysLanguageUid
1547  );
1548  }
1549  }
1550  }
1551 
1560  protected function ‪getFreeTranslationMode(int $page, int $column, int $language): bool
1561  {
1562  $freeTranslationMode = false;
1563 
1564  if (
1565  $this->‪getConnectedContentElementTranslationsCount($page, $column, $language) === 0
1566  && $this->‪getStandAloneContentElementTranslationsCount($page, $column, $language) >= 0
1567  ) {
1568  $freeTranslationMode = true;
1569  }
1570 
1571  return $freeTranslationMode;
1572  }
1573 
1581  protected function ‪registerCloseButtonToButtonBar(ButtonBar $buttonBar, string $position, int $group)
1582  {
1583  $closeButton = $buttonBar->makeLinkButton()
1584  ->setHref('#')
1585  ->setClasses('t3js-editform-close')
1586  ->setTitle($this->‪getLanguageService()->sL(
1587  'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:rm.closeDoc'
1588  ))
1589  ->setShowLabelText(true)
1590  ->setIcon($this->moduleTemplate->getIconFactory()->getIcon(
1591  'actions-close',
1593  ));
1594 
1595  $buttonBar->addButton($closeButton, $position, $group);
1596  }
1597 
1605  protected function ‪registerSaveButtonToButtonBar(ButtonBar $buttonBar, string $position, int $group)
1606  {
1607  $saveButton = $buttonBar->makeInputButton()
1608  ->setForm('EditDocumentController')
1609  ->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-document-save', ‪Icon::SIZE_SMALL))
1610  ->setName('_savedok')
1611  ->setShowLabelText(true)
1612  ->setTitle($this->‪getLanguageService()->sL(
1613  'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:rm.saveDoc'
1614  ))
1615  ->setValue('1');
1616 
1617  $buttonBar->addButton($saveButton, $position, $group);
1618  }
1619 
1627  protected function ‪registerViewButtonToButtonBar(ButtonBar $buttonBar, string $position, int $group)
1628  {
1629  if (
1630  $this->viewId // Pid to show the record
1631  && !$this->noView // Passed parameter
1632  && !empty($this->firstEl['table']) // No table
1633 
1634  // @TODO: TsConfig option should change to viewDoc
1635  && $this->‪getTsConfigOption($this->firstEl['table'], 'saveDocView')
1636  ) {
1637  $classNames = 't3js-editform-view';
1638 
1639  $pagesTSconfig = ‪BackendUtility::getPagesTSconfig($this->pageinfo['uid']);
1640 
1641  if (isset($pagesTSconfig['TCEMAIN.']['preview.']['disableButtonForDokType'])) {
1642  $excludeDokTypes = GeneralUtility::intExplode(
1643  ',',
1644  $pagesTSconfig['TCEMAIN.']['preview.']['disableButtonForDokType'],
1645  true
1646  );
1647  } else {
1648  // exclude sysfolders, spacers and recycler by default
1649  $excludeDokTypes = [
1653  ];
1654  }
1655 
1656  if (
1657  !in_array((int)$this->pageinfo['doktype'], $excludeDokTypes, true)
1658  || isset($pagesTSconfig['TCEMAIN.']['preview.'][$this->firstEl['table'] . '.']['previewPageId'])
1659  ) {
1660  $previewPageId = $this->‪getPreviewPageId();
1661  $previewUrl = ‪BackendUtility::getPreviewUrl(
1662  $previewPageId,
1663  '',
1664  ‪BackendUtility::BEgetRootLine($previewPageId),
1666  $this->viewUrl,
1667  $this->‪getPreviewUrlParameters($previewPageId)
1668  );
1669 
1670  $viewButton = $buttonBar->makeLinkButton()
1671  ->setHref($previewUrl)
1672  ->setIcon($this->moduleTemplate->getIconFactory()->getIcon(
1673  'actions-view',
1675  ))
1676  ->setShowLabelText(true)
1677  ->setTitle($this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:rm.viewDoc'));
1678 
1679  if (!$this->isSavedRecord) {
1680  if ($this->firstEl['table'] === 'pages') {
1681  $viewButton->setDataAttributes(['is-new' => '']);
1682  }
1683  }
1684 
1685  if ($classNames !== '') {
1686  $viewButton->setClasses($classNames);
1687  }
1688 
1689  $buttonBar->addButton($viewButton, $position, $group);
1690  }
1691  }
1692  }
1693 
1703  protected function ‪registerNewButtonToButtonBar(
1704  ButtonBar $buttonBar,
1705  string $position,
1706  int $group,
1707  int $sysLanguageUid,
1708  int $l18nParent
1709  ) {
1710  if (
1711  $this->firstEl['table'] !== 'sys_file_metadata'
1712  && !empty($this->firstEl['table'])
1713  && (
1714  (
1715  (
1717  || $this->isPageInFreeTranslationMode
1718  )
1719  && $this->firstEl['table'] === 'tt_content'
1720  )
1721  || (
1722  $this->firstEl['table'] !== 'tt_content'
1723  && (
1724  $sysLanguageUid === 0
1725  || $l18nParent === 0
1726  )
1727  )
1728  )
1729  && $this->‪getTsConfigOption($this->firstEl['table'], 'saveDocNew')
1730  ) {
1731  $classNames = 't3js-editform-new';
1732 
1733  $newButton = $buttonBar->makeLinkButton()
1734  ->setHref('#')
1735  ->setIcon($this->moduleTemplate->getIconFactory()->getIcon(
1736  'actions-add',
1738  ))
1739  ->setShowLabelText(true)
1740  ->setTitle($this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:rm.newDoc'));
1741 
1742  if (!$this->isSavedRecord) {
1743  $newButton->setDataAttributes(['is-new' => '']);
1744  }
1745 
1746  if ($classNames !== '') {
1747  $newButton->setClasses($classNames);
1748  }
1749 
1750  $buttonBar->addButton($newButton, $position, $group);
1751  }
1752  }
1753 
1763  protected function ‪registerDuplicationButtonToButtonBar(
1764  ButtonBar $buttonBar,
1765  string $position,
1766  int $group,
1767  int $sysLanguageUid,
1768  int $l18nParent
1769  ) {
1770  if (
1771  $this->firstEl['table'] !== 'sys_file_metadata'
1772  && !empty($this->firstEl['table'])
1773  && (
1774  (
1775  (
1777  || $this->isPageInFreeTranslationMode
1778  )
1779  && $this->firstEl['table'] === 'tt_content'
1780  )
1781  || (
1782  $this->firstEl['table'] !== 'tt_content'
1783  && (
1784  $sysLanguageUid === 0
1785  || $l18nParent === 0
1786  )
1787  )
1788  )
1789  && $this->‪getTsConfigOption($this->firstEl['table'], 'showDuplicate')
1790  ) {
1791  $classNames = 't3js-editform-duplicate';
1792 
1793  $duplicateButton = $buttonBar->makeLinkButton()
1794  ->setHref('#')
1795  ->setShowLabelText(true)
1796  ->setTitle($this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:rm.duplicateDoc'))
1797  ->setIcon($this->moduleTemplate->getIconFactory()->getIcon(
1798  'actions-document-duplicates-select',
1800  ));
1801 
1802  if (!$this->isSavedRecord) {
1803  $duplicateButton->setDataAttributes(['is-new' => '']);
1804  }
1805 
1806  if ($classNames !== '') {
1807  $duplicateButton->setClasses($classNames);
1808  }
1809 
1810  $buttonBar->addButton($duplicateButton, $position, $group);
1811  }
1812  }
1813 
1821  protected function ‪registerDeleteButtonToButtonBar(ButtonBar $buttonBar, string $position, int $group)
1822  {
1823  if (
1824  $this->firstEl['deleteAccess']
1825  && !$this->‪getDisableDelete()
1826  && $this->isSavedRecord
1827  && count($this->elementsData) === 1
1828  ) {
1829  $classNames = 't3js-editform-delete-record';
1830 
1832  if ($this->firstEl['table'] === 'pages') {
1833  parse_str((string)parse_url(‪$returnUrl, PHP_URL_QUERY), $queryParams);
1834  if (
1835  isset($queryParams['route'], $queryParams['id'])
1836  && (string)$this->firstEl['uid'] === (string)$queryParams['id']
1837  ) {
1838  // TODO: Use the page's pid instead of 0, this requires a clean API to manipulate the page
1839  // tree from the outside to be able to mark the pid as active
1840  ‪$returnUrl = (string)$this->uriBuilder->buildUriFromRoutePath($queryParams['route'], ['id' => 0]);
1841  }
1842  }
1843 
1845  $referenceIndex = GeneralUtility::makeInstance(ReferenceIndex::class);
1846  $numberOfReferences = $referenceIndex->getNumberOfReferencedRecords(
1847  $this->firstEl['table'],
1848  (int)$this->firstEl['uid']
1849  );
1850 
1851  $referenceCountMessage = ‪BackendUtility::referenceCount(
1852  $this->firstEl['table'],
1853  (int)$this->firstEl['uid'],
1854  $this->‪getLanguageService()->sL(
1855  'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.referencesToRecord'
1856  ),
1857  $numberOfReferences
1858  );
1859  $translationCountMessage = ‪BackendUtility::translationCount(
1860  $this->firstEl['table'],
1861  (int)$this->firstEl['uid'],
1862  $this->‪getLanguageService()->sL(
1863  'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.translationsOfRecord'
1864  )
1865  );
1866 
1867  $deleteButton = $buttonBar->makeLinkButton()
1868  ->setClasses($classNames)
1869  ->setDataAttributes([
1870  'return-url' => ‪$returnUrl,
1871  'uid' => $this->firstEl['uid'],
1872  'table' => $this->firstEl['table'],
1873  'reference-count-message' => $referenceCountMessage,
1874  'translation-count-message' => $translationCountMessage
1875  ])
1876  ->setHref('#')
1877  ->setIcon($this->moduleTemplate->getIconFactory()->getIcon(
1878  'actions-edit-delete',
1880  ))
1881  ->setShowLabelText(true)
1882  ->setTitle($this->‪getLanguageService()->getLL('deleteItem'));
1884  $buttonBar->addButton($deleteButton, $position, $group);
1885  }
1886  }
1887 
1895  protected function ‪registerHistoryButtonToButtonBar(ButtonBar $buttonBar, string $position, int $group)
1896  {
1897  if (
1898  count($this->elementsData) === 1
1899  && !empty($this->firstEl['table'])
1900  && $this->‪getTsConfigOption($this->firstEl['table'], 'showHistory')
1901  ) {
1902  $historyButtonOnClick = 'window.location.href=' .
1903  GeneralUtility::quoteJSvalue(
1904  (string)$this->uriBuilder->buildUriFromRoute(
1905  'record_history',
1906  [
1907  'element' => $this->firstEl['table'] . ':' . $this->firstEl['uid'],
1908  'returnUrl' => $this->R_URI,
1909  ]
1910  )
1911  ) . '; return false;';
1912 
1913  $historyButton = $buttonBar->makeLinkButton()
1914  ->setHref('#')
1915  ->setIcon($this->moduleTemplate->getIconFactory()->getIcon(
1916  'actions-document-history-open',
1918  ))
1919  ->setOnClick($historyButtonOnClick)
1920  ->setTitle('Open history of this record')
1921  ;
1922 
1923  $buttonBar->addButton($historyButton, $position, $group);
1924  }
1925  }
1926 
1934  protected function ‪registerColumnsOnlyButtonToButtonBar(ButtonBar $buttonBar, string $position, int $group)
1935  {
1936  if (
1937  $this->columnsOnly
1938  && count($this->elementsData) === 1
1939  ) {
1940  $columnsOnlyButton = $buttonBar->makeLinkButton()
1941  ->setHref($this->R_URI . '&columnsOnly=')
1942  ->setTitle($this->‪getLanguageService()->getLL('editWholeRecord'))
1943  ->setIcon($this->moduleTemplate->getIconFactory()->getIcon(
1944  'actions-open',
1946  ));
1947 
1948  $buttonBar->addButton($columnsOnlyButton, $position, $group);
1949  }
1950  }
1951 
1959  protected function ‪registerOpenInNewWindowButtonToButtonBar(ButtonBar $buttonBar, string $position, int $group)
1960  {
1961  $closeUrl = $this->‪getCloseUrl();
1962  if ($this->returnUrl !== $closeUrl) {
1963  $requestUri = GeneralUtility::linkThisScript([
1964  'returnUrl' => $closeUrl,
1965  ]);
1966  $aOnClick = 'vHWin=window.open('
1967  . GeneralUtility::quoteJSvalue($requestUri) . ','
1968  . GeneralUtility::quoteJSvalue(md5($this->R_URI))
1969  . ',\'width=670,height=500,status=0,menubar=0,scrollbars=1,resizable=1\');vHWin.focus();return false;';
1970 
1971  $openInNewWindowButton = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar()
1972  ->makeLinkButton()
1973  ->setHref('#')
1974  ->setTitle($this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.openInNewWindow'))
1975  ->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-window-open', ‪Icon::SIZE_SMALL))
1976  ->setOnClick($aOnClick);
1977 
1978  $buttonBar->addButton($openInNewWindowButton, $position, $group);
1979  }
1980  }
1981 
1989  protected function ‪registerShortcutButtonToButtonBar(ButtonBar $buttonBar, string $position, int $group)
1990  {
1991  if ($this->returnUrl !== $this->‪getCloseUrl()) {
1992  $shortCutButton = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar()->makeShortcutButton();
1993  $shortCutButton->setModuleName('xMOD_alt_doc.php')
1994  ->setGetVariables([
1995  'returnUrl',
1996  'edit',
1997  'defVals',
1998  'overrideVals',
1999  'columnsOnly',
2000  'returnNewPageId',
2001  'noView']);
2002 
2003  $buttonBar->addButton($shortCutButton, $position, $group);
2004  }
2005  }
2006 
2014  protected function ‪registerCshButtonToButtonBar(ButtonBar $buttonBar, string $position, int $group)
2015  {
2016  $cshButton = $buttonBar->makeHelpButton()->setModuleName('xMOD_csh_corebe')->setFieldName('TCEforms');
2017 
2018  $buttonBar->addButton($cshButton, $position, $group);
2019  }
2020 
2029  protected function ‪getConnectedContentElementTranslationsCount(int $page, int $column, int $language): int
2030  {
2031  $queryBuilder = $this->‪getQueryBuilderForTranslationMode($page, $column, $language);
2032 
2033  return (int)$queryBuilder
2034  ->andWhere(
2035  $queryBuilder->expr()->gt(
2036  ‪$GLOBALS['TCA']['tt_content']['ctrl']['transOrigPointerField'],
2037  $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)
2038  )
2039  )
2040  ->execute()
2041  ->fetchColumn(0);
2042  }
2043 
2052  protected function ‪getStandAloneContentElementTranslationsCount(int $page, int $column, int $language): int
2053  {
2054  $queryBuilder = $this->‪getQueryBuilderForTranslationMode($page, $column, $language);
2055 
2056  return (int)$queryBuilder
2057  ->andWhere(
2058  $queryBuilder->expr()->eq(
2059  ‪$GLOBALS['TCA']['tt_content']['ctrl']['transOrigPointerField'],
2060  $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)
2061  )
2062  )
2063  ->execute()
2064  ->fetchColumn(0);
2065  }
2066 
2075  protected function ‪getQueryBuilderForTranslationMode(int $page, int $column, int $language): ‪QueryBuilder
2076  {
2077  $languageField = ‪$GLOBALS['TCA']['tt_content']['ctrl']['languageField'];
2078 
2079  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
2080  ->getQueryBuilderForTable('tt_content');
2081 
2082  $queryBuilder->getRestrictions()
2083  ->removeAll()
2084  ->add(GeneralUtility::makeInstance(DeletedRestriction::class))
2085  ->add(GeneralUtility::makeInstance(BackendWorkspaceRestriction::class));
2086 
2087  return $queryBuilder
2088  ->count('uid')
2089  ->from('tt_content')
2090  ->where(
2091  $queryBuilder->expr()->eq(
2092  'pid',
2093  $queryBuilder->createNamedParameter($page, \PDO::PARAM_INT)
2094  ),
2095  $queryBuilder->expr()->eq(
2096  $languageField,
2097  $queryBuilder->createNamedParameter($language, \PDO::PARAM_INT)
2098  ),
2099  $queryBuilder->expr()->eq(
2100  'colPos',
2101  $queryBuilder->createNamedParameter($column, \PDO::PARAM_INT)
2102  )
2103  );
2104  }
2105 
2112  protected function ‪compileForm(string $editForm): string
2113  {
2114  $formContent = '
2115  <form
2116  action="' . htmlspecialchars($this->R_URI) . '"
2117  method="post"
2118  enctype="multipart/form-data"
2119  name="editform"
2120  id="EditDocumentController"
2121  onsubmit="TBE_EDITOR.checkAndDoSubmit(1); return false;"
2122  >
2123  ' . $editForm . '
2124  <input type="hidden" name="returnUrl" value="' . htmlspecialchars($this->retUrl) . '" />
2125  <input type="hidden" name="viewUrl" value="' . htmlspecialchars($this->viewUrl) . '" />
2126  <input type="hidden" name="popViewId" value="' . htmlspecialchars((string)$this->viewId) . '" />
2127  <input type="hidden" name="closeDoc" value="0" />
2128  <input type="hidden" name="doSave" value="0" />
2129  <input type="hidden" name="_serialNumber" value="' . md5(microtime()) . '" />
2130  <input type="hidden" name="_scrollPosition" value="" />';
2131  if ($this->returnNewPageId) {
2132  $formContent .= '<input type="hidden" name="returnNewPageId" value="1" />';
2133  }
2134  if ($this->viewId_addParams) {
2135  $formContent .= '<input type="hidden" name="popViewId_addParams" value="' . htmlspecialchars($this->viewId_addParams) . '" />';
2136  }
2137  return $formContent;
2138  }
2139 
2145  public function ‪shortCutLink()
2146  {
2147  trigger_error('EditDocumentController->shortCutLink() will be removed in TYPO3 v10.0.', E_USER_DEPRECATED);
2148 
2149  if ($this->returnUrl !== $this->‪getCloseUrl()) {
2150  $shortCutButton = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar()->makeShortcutButton();
2151  $shortCutButton->setModuleName('xMOD_alt_doc.php')
2152  ->setGetVariables([
2153  'returnUrl',
2154  'edit',
2155  'defVals',
2156  'overrideVals',
2157  'columnsOnly',
2158  'returnNewPageId',
2159  'noView']);
2160  $this->moduleTemplate->getDocHeaderComponent()->getButtonBar()->addButton($shortCutButton);
2161  }
2162  }
2163 
2169  public function ‪openInNewWindowLink()
2170  {
2171  trigger_error('EditDocumentController->openInNewWindowLink() will be removed in TYPO3 v10.0.', E_USER_DEPRECATED);
2172 
2173  $closeUrl = $this->‪getCloseUrl();
2174  if ($this->returnUrl !== $closeUrl) {
2175  $aOnClick = 'vHWin=window.open(' . GeneralUtility::quoteJSvalue(GeneralUtility::linkThisScript(
2176  ['returnUrl' => $closeUrl]
2177  ))
2178  . ','
2179  . GeneralUtility::quoteJSvalue(md5($this->R_URI))
2180  . ',\'width=670,height=500,status=0,menubar=0,scrollbars=1,resizable=1\');vHWin.focus();return false;';
2181  $openInNewWindowButton = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar()
2182  ->makeLinkButton()
2183  ->setHref('#')
2184  ->setTitle($this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.openInNewWindow'))
2185  ->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-window-open', ‪Icon::SIZE_SMALL))
2186  ->setOnClick($aOnClick);
2187  $this->moduleTemplate->getDocHeaderComponent()->getButtonBar()->addButton(
2188  $openInNewWindowButton,
2190  );
2191  }
2192  }
2193 
2200  protected function ‪getDisableDelete(): bool
2201  {
2202  $disableDelete = false;
2203  if ($this->firstEl['table'] === 'sys_file_metadata') {
2204  $row = ‪BackendUtility::getRecord('sys_file_metadata', $this->firstEl['uid'], 'sys_language_uid');
2205  $languageUid = $row['sys_language_uid'];
2206  if ($languageUid === 0) {
2207  $disableDelete = true;
2208  }
2209  } else {
2210  $disableDelete = (bool)$this->‪getTsConfigOption($this->firstEl['table'] ?? '', 'disableDelete');
2211  }
2212  return $disableDelete;
2213  }
2214 
2221  protected function ‪getCloseUrl(): string
2222  {
2223  $closeUrl = GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Public/Html/Close.html');
2224  return ‪PathUtility::getAbsoluteWebPath($closeUrl);
2225  }
2226 
2227  /***************************
2228  *
2229  * Localization stuff
2230  *
2231  ***************************/
2241  protected function ‪languageSwitch(string $table, int $uid, $pid = null)
2242  {
2243  $languageField = ‪$GLOBALS['TCA'][$table]['ctrl']['languageField'];
2244  $transOrigPointerField = ‪$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'];
2245 
2246  // Table editable and activated for languages?
2247  if ($this->‪getBackendUser()->check('tables_modify', $table)
2248  && $languageField
2249  && $transOrigPointerField
2250  ) {
2251  if ($pid === null) {
2252  $row = ‪BackendUtility::getRecord($table, $uid, 'pid');
2253  $pid = $row['pid'];
2254  }
2255  // Get all available languages for the page
2256  // If editing a page, the translations of the current UID need to be fetched
2257  if ($table === 'pages') {
2258  $row = ‪BackendUtility::getRecord($table, $uid, ‪$GLOBALS['TCA']['pages']['ctrl']['transOrigPointerField']);
2259  // Ensure the check is always done against the default language page
2260  $availableLanguages = $this->‪getLanguages(
2261  (int)$row[‪$GLOBALS['TCA']['pages']['ctrl']['transOrigPointerField']] ?: $uid,
2262  $table
2263  );
2264  } else {
2265  $availableLanguages = $this->‪getLanguages((int)$pid, $table);
2266  }
2267  // Page available in other languages than default language?
2268  if (count($availableLanguages) > 1) {
2269  $rowsByLang = [];
2270  $fetchFields = 'uid,' . $languageField . ',' . $transOrigPointerField;
2271  // Get record in current language
2272  $rowCurrent = ‪BackendUtility::getLiveVersionOfRecord($table, $uid, $fetchFields);
2273  if (!is_array($rowCurrent)) {
2274  $rowCurrent = ‪BackendUtility::getRecord($table, $uid, $fetchFields);
2275  }
2276  $currentLanguage = (int)$rowCurrent[$languageField];
2277  // Disabled for records with [all] language!
2278  if ($currentLanguage > -1) {
2279  // Get record in default language if needed
2280  if ($currentLanguage && $rowCurrent[$transOrigPointerField]) {
2282  $table,
2283  $rowCurrent[$transOrigPointerField],
2284  $fetchFields
2285  );
2286  if (!is_array($rowsByLang[0])) {
2287  $rowsByLang[0] = ‪BackendUtility::getRecord(
2288  $table,
2289  $rowCurrent[$transOrigPointerField],
2290  $fetchFields
2291  );
2292  }
2293  } else {
2294  $rowsByLang[$rowCurrent[$languageField]] = $rowCurrent;
2295  }
2296  if ($rowCurrent[$transOrigPointerField] || $currentLanguage === 0) {
2297  // Get record in other languages to see what's already available
2298 
2299  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
2300  ->getQueryBuilderForTable($table);
2301 
2302  $queryBuilder->getRestrictions()
2303  ->removeAll()
2304  ->add(GeneralUtility::makeInstance(DeletedRestriction::class))
2305  ->add(GeneralUtility::makeInstance(BackendWorkspaceRestriction::class));
2306 
2307  $result = $queryBuilder->select(...GeneralUtility::trimExplode(',', $fetchFields, true))
2308  ->from($table)
2309  ->where(
2310  $queryBuilder->expr()->eq(
2311  'pid',
2312  $queryBuilder->createNamedParameter($pid, \PDO::PARAM_INT)
2313  ),
2314  $queryBuilder->expr()->gt(
2315  $languageField,
2316  $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)
2317  ),
2318  $queryBuilder->expr()->eq(
2319  $transOrigPointerField,
2320  $queryBuilder->createNamedParameter($rowsByLang[0]['uid'], \PDO::PARAM_INT)
2321  )
2322  )
2323  ->execute();
2324 
2325  while ($row = $result->fetch()) {
2326  $rowsByLang[$row[$languageField]] = $row;
2327  }
2328  }
2329  $languageMenu = $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
2330  $languageMenu->setIdentifier('_langSelector');
2331  foreach ($availableLanguages as $language) {
2332  $languageId = $language->getLanguageId();
2333  $selectorOptionLabel = $language->getTitle();
2334  // Create url for creating a localized record
2335  $addOption = true;
2336  $href = '';
2337  if (!isset($rowsByLang[$languageId])) {
2338  // Translation in this language does not exist
2339  $selectorOptionLabel .= ' [' . htmlspecialchars($this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.new')) . ']';
2340  $redirectUrl = (string)$this->uriBuilder->buildUriFromRoute('record_edit', [
2341  'justLocalized' => $table . ':' . $rowsByLang[0]['uid'] . ':' . $languageId,
2342  'returnUrl' => $this->retUrl
2343  ]);
2344 
2345  if (array_key_exists(0, $rowsByLang)) {
2347  '&cmd[' . $table . '][' . $rowsByLang[0]['uid'] . '][localize]=' . $languageId,
2348  $redirectUrl
2349  );
2350  } else {
2351  $addOption = false;
2352  }
2353  } else {
2354  $params = [
2355  'edit[' . $table . '][' . $rowsByLang[$languageId]['uid'] . ']' => 'edit',
2356  'returnUrl' => ‪$this->retUrl
2357  ];
2358  if ($table === 'pages') {
2359  // Disallow manual adjustment of the language field for pages
2360  $params['overrideVals'] = [
2361  'pages' => [
2362  'sys_language_uid' => $languageId
2363  ]
2364  ];
2365  }
2366  $href = (string)$this->uriBuilder->buildUriFromRoute('record_edit', $params);
2367  }
2368  if ($addOption) {
2369  $menuItem = $languageMenu->makeMenuItem()
2370  ->setTitle($selectorOptionLabel)
2371  ->setHref($href);
2372  if ($languageId === $currentLanguage) {
2373  $menuItem->setActive(true);
2374  }
2375  $languageMenu->addMenuItem($menuItem);
2376  }
2377  }
2378  $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->addMenu($languageMenu);
2379  }
2380  }
2381  }
2382  }
2383 
2390  public function ‪localizationRedirect(ServerRequestInterface $request = null): ?ResponseInterface
2391  {
2392  $deprecatedCaller = false;
2393  if (!$request instanceof ServerRequestInterface) {
2394  // @deprecated since TYPO3 v9
2395  // Method signature in TYPO3 v10.0: protected function localizationRedirect(ServerRequestInterface $request): ?ResponseInterface
2396  trigger_error('EditDocumentController->localizationRedirect() will be set to protected in TYPO3 v10.0. Do not call from other extension.', E_USER_DEPRECATED);
2397  $justLocalized = $request;
2398  $request = ‪$GLOBALS['TYPO3_REQUEST'];
2399  $deprecatedCaller = true;
2400  } else {
2401  $justLocalized = $request->getQueryParams()['justLocalized'];
2402  }
2403 
2404  if (empty($justLocalized)) {
2405  return null;
2406  }
2407 
2408  list($table, $origUid, $language) = explode(':', $justLocalized);
2409 
2410  if (‪$GLOBALS['TCA'][$table]
2411  && ‪$GLOBALS['TCA'][$table]['ctrl']['languageField']
2412  && ‪$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']
2413  ) {
2414  $parsedBody = $request->getParsedBody();
2415  $queryParams = $request->getQueryParams();
2416 
2417  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table);
2418  $queryBuilder->getRestrictions()
2419  ->removeAll()
2420  ->add(GeneralUtility::makeInstance(DeletedRestriction::class))
2421  ->add(GeneralUtility::makeInstance(BackendWorkspaceRestriction::class));
2422  $localizedRecord = $queryBuilder->select('uid')
2423  ->from($table)
2424  ->where(
2425  $queryBuilder->expr()->eq(
2426  ‪$GLOBALS['TCA'][$table]['ctrl']['languageField'],
2427  $queryBuilder->createNamedParameter($language, \PDO::PARAM_INT)
2428  ),
2429  $queryBuilder->expr()->eq(
2430  ‪$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'],
2431  $queryBuilder->createNamedParameter($origUid, \PDO::PARAM_INT)
2432  )
2433  )
2434  ->execute()
2435  ->fetch();
2436  ‪$returnUrl = $parsedBody['returnUrl'] ?? $queryParams['returnUrl'] ?? '';
2437  if (is_array($localizedRecord)) {
2438  if ($deprecatedCaller) {
2439  // @deprecated fall back if method has been called from outside. This if can be removed in TYPO3 v10.0
2440  $location = (string)$this->uriBuilder->buildUriFromRoute('record_edit', [
2441  'edit[' . $table . '][' . $localizedRecord['uid'] . ']' => 'edit',
2442  'returnUrl' => GeneralUtility::sanitizeLocalUrl(‪$returnUrl)
2443  ]);
2444  ‪HttpUtility::redirect($location);
2445  }
2446  // Create redirect response to self to edit just created record
2447  return new ‪RedirectResponse(
2448  (string)$this->uriBuilder->buildUriFromRoute(
2449  'record_edit',
2450  [
2451  'edit[' . $table . '][' . $localizedRecord['uid'] . ']' => 'edit',
2452  'returnUrl' => GeneralUtility::sanitizeLocalUrl(‪$returnUrl)
2453  ]
2454  ),
2455  303
2456  );
2457  }
2458  }
2459  return null;
2460  }
2461 
2471  protected function ‪getLanguages(int $id, string $table): array
2472  {
2473  // This usually happens when a non-pages record is added after another, so we are fetching the proper page ID
2474  if ($id < 0 && $table !== 'pages') {
2475  $pageId = $this->pageinfo['uid'] ?? null;
2476  if ($pageId !== null) {
2477  $pageId = (int)$pageId;
2478  } else {
2479  $fullRecord = ‪BackendUtility::getRecord($table, abs($id));
2480  $pageId = (int)$fullRecord['pid'];
2481  }
2482  } else {
2483  if ($table === 'pages' && $id > 0) {
2484  $fullRecord = ‪BackendUtility::getRecordWSOL('pages', $id);
2485  $id = (int)($fullRecord['t3ver_oid'] ?: $fullRecord['uid']);
2486  }
2487  $pageId = $id;
2488  }
2489  $site = GeneralUtility::makeInstance(SiteMatcher::class)->matchByPageId($pageId);
2490 
2491  // Fetch the current translations of this page, to only show the ones where there is a page translation
2492  $allLanguages = $site->getAvailableLanguages($this->‪getBackendUser(), false, $pageId);
2493  if ($table !== 'pages' && $id > 0) {
2494  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('pages');
2495  $queryBuilder->getRestrictions()->removeAll()
2496  ->add(GeneralUtility::makeInstance(DeletedRestriction::class))
2497  ->add(GeneralUtility::makeInstance(BackendWorkspaceRestriction::class));
2498  $statement = $queryBuilder->select('uid', ‪$GLOBALS['TCA']['pages']['ctrl']['languageField'])
2499  ->from('pages')
2500  ->where(
2501  $queryBuilder->expr()->eq(
2502  ‪$GLOBALS['TCA']['pages']['ctrl']['transOrigPointerField'],
2503  $queryBuilder->createNamedParameter($pageId, \PDO::PARAM_INT)
2504  )
2505  )
2506  ->execute();
2507 
2508  $availableLanguages = [];
2509 
2510  if ($allLanguages[0] ?? false) {
2511  $availableLanguages = [
2512  0 => $allLanguages[0]
2513  ];
2514  }
2515 
2516  while ($row = $statement->fetch()) {
2517  $languageId = (int)$row[‪$GLOBALS['TCA']['pages']['ctrl']['languageField']];
2518  if (isset($allLanguages[$languageId])) {
2519  $availableLanguages[$languageId] = $allLanguages[$languageId];
2520  }
2521  }
2522  return $availableLanguages;
2523  }
2524  return $allLanguages;
2525  }
2526 
2532  protected function ‪fixWSversioningInEditConf($mapArray = false): void
2533  {
2534  // Traverse the editConf array
2535  if (is_array($this->editconf)) {
2536  // Tables:
2537  foreach ($this->editconf as $table => $conf) {
2538  if (is_array($conf) && ‪$GLOBALS['TCA'][$table]) {
2539  // Traverse the keys/comments of each table (keys can be a comma list of uids)
2540  $newConf = [];
2541  foreach ($conf as $cKey => ‪$cmd) {
2542  if (‪$cmd === 'edit') {
2543  // Traverse the ids:
2544  $ids = GeneralUtility::trimExplode(',', $cKey, true);
2545  foreach ($ids as $idKey => $theUid) {
2546  if (is_array($mapArray)) {
2547  if ($mapArray[$table][$theUid]) {
2548  $ids[$idKey] = $mapArray[$table][$theUid];
2549  }
2550  } else {
2551  // Default, look for versions in workspace for record:
2552  $calcPRec = $this->‪getRecordForEdit((string)$table, (int)$theUid);
2553  if (is_array($calcPRec)) {
2554  // Setting UID again if it had changed, eg. due to workspace versioning.
2555  $ids[$idKey] = $calcPRec['uid'];
2556  }
2557  }
2558  }
2559  // Add the possibly manipulated IDs to the new-build newConf array:
2560  $newConf[implode(',', $ids)] = ‪$cmd;
2561  } else {
2562  $newConf[$cKey] = ‪$cmd;
2563  }
2564  }
2565  // Store the new conf array:
2566  $this->editconf[$table] = $newConf;
2567  }
2568  }
2569  }
2570  }
2571 
2579  protected function ‪getRecordForEdit(string $table, int $theUid)
2580  {
2581  // Fetch requested record:
2582  $reqRecord = ‪BackendUtility::getRecord($table, $theUid, 'uid,pid');
2583  if (is_array($reqRecord)) {
2584  // If workspace is OFFLINE:
2585  if ($this->‪getBackendUser()->workspace != 0) {
2586  // Check for versioning support of the table:
2587  if (‪$GLOBALS['TCA'][$table] && ‪$GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
2588  // If the record is already a version of "something" pass it by.
2589  if ($reqRecord['pid'] == -1) {
2590  // (If it turns out not to be a version of the current workspace there will be trouble, but
2591  // that is handled inside DataHandler then and in the interface it would clearly be an error of
2592  // links if the user accesses such a scenario)
2593  return $reqRecord;
2594  }
2595  // The input record was online and an offline version must be found or made:
2596  // Look for version of this workspace:
2598  $this->‪getBackendUser()->workspace,
2599  $table,
2600  $reqRecord['uid'],
2601  'uid,pid,t3ver_oid'
2602  );
2603  return is_array($versionRec) ? $versionRec : $reqRecord;
2604  }
2605  // This means that editing cannot occur on this record because it was not supporting versioning
2606  // which is required inside an offline workspace.
2607  return false;
2608  }
2609  // In ONLINE workspace, just return the originally requested record:
2610  return $reqRecord;
2611  }
2612  // Return FALSE because the table/uid was not found anyway.
2613  return false;
2614  }
2615 
2621  public function ‪compileStoreDat()
2622  {
2623  trigger_error('EditDocumentController->compileStoreDat() will be removed in TYPO3 v10.0.', E_USER_DEPRECATED);
2624  $this->‪compileStoreData();
2625  }
2626 
2631  protected function ‪compileStoreData(): void
2632  {
2633  // @todo: Refactor in TYPO3 v10.0: This GeneralUtility method fiddles with _GP()
2634  $this->storeArray = GeneralUtility::compileSelectedGetVarsFromArray(
2635  'edit,defVals,overrideVals,columnsOnly,noView,workspace',
2636  $this->R_URL_getvars
2637  );
2638  $this->storeUrl = ‪HttpUtility::buildQueryString($this->storeArray, '&');
2639  $this->storeUrlMd5 = md5($this->storeUrl);
2640  }
2641 
2651  public function ‪getNewIconMode($table, $key = 'saveDocNew')
2652  {
2653  trigger_error('EditDocumentController->getNewIconMode() will be removed in TYPO3 v10.0.', E_USER_DEPRECATED);
2654  return $this->‪getTsConfigOption($table, $key);
2655  }
2656 
2664  protected function ‪getTsConfigOption(string $table, string $key): string
2665  {
2666  return \trim((string)(
2667  $this->‪getBackendUser()->getTSConfig()['options.'][$key . '.'][$table]
2668  ?? $this->‪getBackendUser()->getTSConfig()['options.'][$key]
2669  ?? ''
2670  ));
2671  }
2672 
2685  public function ‪closeDocument($mode = self::DOCUMENT_CLOSE_MODE_DEFAULT, ServerRequestInterface $request = null): ?ResponseInterface
2686  {
2687  // Foreign class call or missing argument? Method will be protected and $request mandatory in TYPO3 v10.0, giving core freedom to move stuff around
2688  $deprecatedCaller = false;
2689  if ($request === null) {
2690  // Set method signature in TYPO3 v10.0 to: "protected function closeDocument($mode, ServerRequestInterface $request): ?ResponseInterface"
2691  trigger_error('EditDocumentController->closeDocument will be set to protected in TYPO3 v10.0.', E_USER_DEPRECATED);
2692  $request = ‪$GLOBALS['TYPO3_REQUEST'];
2693  $deprecatedCaller = true;
2694  }
2695 
2696  $mode = (int)$mode;
2697  // If current document is found in docHandler,
2698  // then unset it, possibly unset it ALL and finally, write it to the session data
2699  if (isset($this->docHandler[$this->storeUrlMd5])) {
2700  // add the closing document to the recent documents
2701  $recentDocs = $this->‪getBackendUser()->‪getModuleData('opendocs::recent');
2702  if (!is_array($recentDocs)) {
2703  $recentDocs = [];
2704  }
2705  $closedDoc = $this->docHandler[‪$this->storeUrlMd5];
2706  $recentDocs = array_merge([$this->storeUrlMd5 => $closedDoc], $recentDocs);
2707  if (count($recentDocs) > 8) {
2708  $recentDocs = array_slice($recentDocs, 0, 8);
2709  }
2710  // remove it from the list of the open documents
2711  unset($this->docHandler[$this->storeUrlMd5]);
2712  if ($mode === self::DOCUMENT_CLOSE_MODE_CLEAR_ALL) {
2713  $recentDocs = array_merge($this->docHandler, $recentDocs);
2714  $this->docHandler = [];
2715  }
2716  $this->‪getBackendUser()->‪pushModuleData('opendocs::recent', $recentDocs);
2717  $this->‪getBackendUser()->‪pushModuleData('FormEngine', [$this->docHandler, $this->docDat[1]]);
2718  ‪BackendUtility::setUpdateSignal('OpendocsController::updateNumber', count($this->docHandler));
2719  }
2720  if ($mode === self::DOCUMENT_CLOSE_MODE_NO_REDIRECT) {
2721  return null;
2722  }
2723  // If ->returnEditConf is set, then add the current content of editconf to the ->retUrl variable: used by
2724  // other scripts, like wizard_add, to know which records was created or so...
2725  if ($this->returnEditConf && $this->retUrl != (string)$this->uriBuilder->buildUriFromRoute('dummy')) {
2726  $this->retUrl .= '&returnEditConf=' . rawurlencode(json_encode($this->editconf));
2727  }
2728  // If mode is NOT set (means 0) OR set to 1, then make a header location redirect to $this->retUrl
2729  if ($mode === self::DOCUMENT_CLOSE_MODE_DEFAULT || $mode === self::DOCUMENT_CLOSE_MODE_REDIRECT) {
2730  if ($deprecatedCaller) {
2731  // @deprecated fall back if method has been called from outside. This if can be removed in TYPO3 v10.0
2732  ‪HttpUtility::redirect($this->retUrl);
2733  }
2734  return new RedirectResponse($this->retUrl, 303);
2735  }
2736  if ($this->retUrl === '') {
2737  return null;
2738  }
2740  if (is_array($this->docHandler) && !empty($this->docHandler)) {
2741  if (!empty($setupArr[2])) {
2742  $sParts = parse_url($request->getAttribute('normalizedParams')->getRequestUri());
2743  ‪$retUrl = $sParts['path'] . '?' . $setupArr[2] . '&returnUrl=' . rawurlencode(‪$retUrl);
2744  }
2745  }
2746  if ($deprecatedCaller) {
2747  // @deprecated fall back if method has been called from outside. This if can be removed in TYPO3 v10.0
2749  }
2750  return new ‪RedirectResponse(‪$retUrl, 303);
2751  }
2752 
2761  public function ‪setDocument($currentDocFromHandlerMD5 = '', ‪$retUrl = '')
2762  {
2763  trigger_error('EditDocumentController->setDocument() will be removed in TYPO3 v10.0.', E_USER_DEPRECATED);
2764  if (‪$retUrl === '') {
2765  return;
2766  }
2767  if (is_array($this->docHandler) && !empty($this->docHandler)) {
2768  if (isset($this->docHandler[$currentDocFromHandlerMD5])) {
2769  $setupArr = $this->docHandler[$currentDocFromHandlerMD5];
2770  } else {
2771  $setupArr = reset($this->docHandler);
2772  }
2773  if ($setupArr[2]) {
2774  $sParts = parse_url(GeneralUtility::getIndpEnv('REQUEST_URI'));
2775  ‪$retUrl = $sParts['path'] . '?' . $setupArr[2] . '&returnUrl=' . rawurlencode(‪$retUrl);
2776  }
2777  }
2779  }
2780 
2787  protected function ‪emitFunctionAfterSignal($signalName, ServerRequestInterface $request): void
2788  {
2789  $this->‪getSignalSlotDispatcher()->‪dispatch(__CLASS__, $signalName . 'After', [$this, 'request' => $request]);
2790  }
2791 
2797  protected function ‪getSignalSlotDispatcher()
2798  {
2799  if (!isset($this->signalSlotDispatcher)) {
2800  $this->signalSlotDispatcher = GeneralUtility::makeInstance(Dispatcher::class);
2801  }
2803  }
2804 
2808  protected function ‪getBackendUser()
2809  {
2810  return ‪$GLOBALS['BE_USER'];
2811  }
2812 
2818  protected function ‪getLanguageService()
2819  {
2820  return ‪$GLOBALS['LANG'];
2821  }
2822 }
‪TYPO3\CMS\Backend\Controller\EditDocumentController\main
‪main(ServerRequestInterface $request=null)
Definition: EditDocumentController.php:1154
‪TYPO3\CMS\Core\DataHandling\DataHandler
Definition: DataHandler.php:81
‪TYPO3\CMS\Backend\Controller\EditDocumentController\registerShortcutButtonToButtonBar
‪registerShortcutButtonToButtonBar(ButtonBar $buttonBar, string $position, int $group)
Definition: EditDocumentController.php:1938
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$popViewId_addParams
‪string $popViewId_addParams
Definition: EditDocumentController.php:243
‪TYPO3\CMS\Backend\Controller\EditDocumentController\getPreviewUrlParameters
‪string getPreviewUrlParameters(int $previewPageId)
Definition: EditDocumentController.php:982
‪TYPO3\CMS\Backend\Template\Components\AbstractControl\setClasses
‪$this setClasses($classes)
Definition: AbstractControl.php:95
‪TYPO3\CMS\Core\Imaging\Icon\SIZE_SMALL
‪const SIZE_SMALL
Definition: Icon.php:29
‪TYPO3\CMS\Backend\Controller\EditDocumentController\getLanguageService
‪TYPO3 CMS Core Localization LanguageService getLanguageService()
Definition: EditDocumentController.php:2767
‪TYPO3\CMS\Backend\Controller\EditDocumentController\processData
‪ResponseInterface null processData(ServerRequestInterface $request=null)
Definition: EditDocumentController.php:620
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$columnsOnly
‪string null $columnsOnly
Definition: EditDocumentController.php:146
‪TYPO3\CMS\Core\Localization\LanguageService\includeLLFile
‪mixed includeLLFile($fileRef, $setGlobal=true, $mergeLocalOntoDefault=false)
Definition: LanguageService.php:260
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$storeUrlMd5
‪string $storeUrlMd5
Definition: EditDocumentController.php:346
‪TYPO3\CMS\Backend\Form\FormResultCompiler
Definition: FormResultCompiler.php:28
‪TYPO3\CMS\Core\Utility\PathUtility
Definition: PathUtility.php:23
‪TYPO3\CMS\Backend\Template\Components\ButtonBar\BUTTON_POSITION_LEFT
‪const BUTTON_POSITION_LEFT
Definition: ButtonBar.php:35
‪TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger
‪static bool canBeInterpretedAsInteger($var)
Definition: MathUtility.php:73
‪TYPO3\CMS\Backend\Template\Components\ButtonBar
Definition: ButtonBar.php:31
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$perms_clause
‪string $perms_clause
Definition: EditDocumentController.php:265
‪TYPO3\CMS\Backend\Utility\BackendUtility\getLinkToDataHandlerAction
‪static string getLinkToDataHandlerAction($parameters, $redirectUrl='')
Definition: BackendUtility.php:2788
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$returnUrl
‪string null $returnUrl
Definition: EditDocumentController.php:165
‪TYPO3\CMS\Backend\Template\Components\Buttons\AbstractButton\setIcon
‪$this setIcon(Icon $icon)
Definition: AbstractButton.php:93
‪TYPO3\CMS\Backend\Controller\EditDocumentController\registerOpenInNewWindowButtonToButtonBar
‪registerOpenInNewWindowButtonToButtonBar(ButtonBar $buttonBar, string $position, int $group)
Definition: EditDocumentController.php:1908
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$editconf
‪array $editconf
Definition: EditDocumentController.php:139
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$mirror
‪array $mirror
Definition: EditDocumentController.php:208
‪TYPO3\CMS\Backend\Controller\EditDocumentController\mainAction
‪ResponseInterface mainAction(ServerRequestInterface $request)
Definition: EditDocumentController.php:469
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$moduleTemplate
‪ModuleTemplate $moduleTemplate
Definition: EditDocumentController.php:432
‪TYPO3\CMS\Backend\Controller\EditDocumentController\getRecordForEdit
‪array false getRecordForEdit(string $table, int $theUid)
Definition: EditDocumentController.php:2528
‪TYPO3\CMS\Backend\Form\Utility\FormEngineUtility\databaseRowCompatibility
‪static array databaseRowCompatibility(array $row)
Definition: FormEngineUtility.php:193
‪TYPO3\CMS\Core\Imaging\Icon
Definition: Icon.php:25
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$elementsData
‪$elementsData
Definition: EditDocumentController.php:370
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$uc
‪array null $uc
Definition: EditDocumentController.php:232
‪TYPO3\CMS\Backend\Controller\EditDocumentController\getLanguages
‪SiteLanguage[] getLanguages(int $id, string $table)
Definition: EditDocumentController.php:2420
‪TYPO3\CMS\Backend\Utility\BackendUtility\setUpdateSignal
‪static setUpdateSignal($set='', $params='')
Definition: BackendUtility.php:3164
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$recTitle
‪string $recTitle
Definition: EditDocumentController.php:255
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$workspace
‪string null $workspace
Definition: EditDocumentController.php:277
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$data
‪$data
Definition: EditDocumentController.php:196
‪TYPO3\CMS\Core\Database\ReferenceIndex
Definition: ReferenceIndex.php:50
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$firstEl
‪array $firstEl
Definition: EditDocumentController.php:376
‪TYPO3\CMS\Backend\Controller\EditDocumentController\getCloseUrl
‪string getCloseUrl()
Definition: EditDocumentController.php:2170
‪TYPO3\CMS\Backend\Controller\EditDocumentController\getTsConfigOption
‪string getTsConfigOption(string $table, string $key)
Definition: EditDocumentController.php:2613
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$template
‪$template
Definition: EditDocumentController.php:287
‪TYPO3\CMS\Backend\Controller\EditDocumentController\getConnectedContentElementTranslationsCount
‪int getConnectedContentElementTranslationsCount(int $page, int $column, int $language)
Definition: EditDocumentController.php:1978
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$R_URL_parts
‪array $R_URL_parts
Definition: EditDocumentController.php:298
‪TYPO3\CMS\Backend\Controller\EditDocumentController\doProcessData
‪bool doProcessData()
Definition: EditDocumentController.php:579
‪TYPO3\CMS\Frontend\Page\PageRepository\DOKTYPE_SPACER
‪const DOKTYPE_SPACER
Definition: PageRepository.php:173
‪TYPO3\CMS\Backend\Controller\EditDocumentController\getPreviewPageId
‪int getPreviewPageId()
Definition: EditDocumentController.php:1080
‪TYPO3\CMS\Backend\Controller\EditDocumentController\setDocument
‪setDocument($currentDocFromHandlerMD5='', $retUrl='')
Definition: EditDocumentController.php:2710
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$isPageInFreeTranslationMode
‪bool $isPageInFreeTranslationMode
Definition: EditDocumentController.php:444
‪TYPO3\CMS\Backend\Controller\EditDocumentController\getDisableDelete
‪bool getDisableDelete()
Definition: EditDocumentController.php:2149
‪TYPO3\CMS\Backend\Controller\EditDocumentController\languageSwitch
‪languageSwitch(string $table, int $uid, $pid=null)
Definition: EditDocumentController.php:2190
‪TYPO3\CMS\Backend\Controller\EditDocumentController\addSlugFieldsToColumnsOnly
‪addSlugFieldsToColumnsOnly(array $queryParams)
Definition: EditDocumentController.php:597
‪TYPO3\CMS\Core\Database\Query\Restriction\BackendWorkspaceRestriction
Definition: BackendWorkspaceRestriction.php:28
‪TYPO3\CMS\Backend\Controller\EditDocumentController\DOCUMENT_CLOSE_MODE_REDIRECT
‪const DOCUMENT_CLOSE_MODE_REDIRECT
Definition: EditDocumentController.php:70
‪TYPO3\CMS\Backend\Utility\BackendUtility\lockRecords
‪static lockRecords($table='', $uid=0, $pid=0)
Definition: BackendUtility.php:3353
‪TYPO3\CMS\Backend\Controller\EditDocumentController\DOCUMENT_CLOSE_MODE_DEFAULT
‪const DOCUMENT_CLOSE_MODE_DEFAULT
Definition: EditDocumentController.php:69
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$isSavedRecord
‪bool $isSavedRecord
Definition: EditDocumentController.php:438
‪TYPO3\CMS\Backend\Utility\BackendUtility\referenceCount
‪static string referenceCount($table, $ref, $msg='', $count=null)
Definition: BackendUtility.php:3787
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$previewData
‪array $previewData
Definition: EditDocumentController.php:426
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$docHandler
‪array $docHandler
Definition: EditDocumentController.php:361
‪TYPO3\CMS\Backend\Controller\EditDocumentController\isInconsistentLanguageHandlingAllowed
‪bool isInconsistentLanguageHandlingAllowed()
Definition: EditDocumentController.php:1467
‪TYPO3\CMS\Backend\Controller\EditDocumentController\DOCUMENT_CLOSE_MODE_CLEAR_ALL
‪const DOCUMENT_CLOSE_MODE_CLEAR_ALL
Definition: EditDocumentController.php:71
‪TYPO3\CMS\Backend\Utility\BackendUtility\BEgetRootLine
‪static array BEgetRootLine($uid, $clause='', $workspaceOL=false, array $additionalFields=[])
Definition: BackendUtility.php:374
‪TYPO3\CMS\Backend\Utility\BackendUtility\getPreviewUrl
‪static string getPreviewUrl( $pageUid, $backPath='', $rootLine=null, $anchorSection='', $alternativeUrl='', $additionalGetVars='', &$switchFocus=true)
Definition: BackendUtility.php:2656
‪$fields
‪$fields
Definition: pages.php:4
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton\setFieldName
‪HelpButton setFieldName($fieldName)
Definition: HelpButton.php:84
‪TYPO3\CMS\Backend\Controller\EditDocumentController\getQueryBuilderForTranslationMode
‪QueryBuilder getQueryBuilderForTranslationMode(int $page, int $column, int $language)
Definition: EditDocumentController.php:2024
‪TYPO3\CMS\Backend\Controller\EditDocumentController\registerSaveButtonToButtonBar
‪registerSaveButtonToButtonBar(ButtonBar $buttonBar, string $position, int $group)
Definition: EditDocumentController.php:1554
‪TYPO3\CMS\Backend\Controller\EditDocumentController\compileForm
‪string compileForm(string $editForm)
Definition: EditDocumentController.php:2061
‪TYPO3\CMS\Backend\Template\ModuleTemplate
Definition: ModuleTemplate.php:40
‪TYPO3\CMS\Backend\Template\Components\ButtonBar\makeInputButton
‪InputButton makeInputButton()
Definition: ButtonBar.php:100
‪TYPO3\CMS\Core\Type\Bitmask\Permission
Definition: Permission.php:23
‪TYPO3\CMS\Backend\Template\Components\ButtonBar\addButton
‪$this addButton(ButtonInterface $button, $buttonPosition=self::BUTTON_POSITION_LEFT, $buttonGroup=1)
Definition: ButtonBar.php:59
‪TYPO3\CMS\Backend\Controller\EditDocumentController\preInit
‪ResponseInterface null preInit(ServerRequestInterface $request=null)
Definition: EditDocumentController.php:503
‪TYPO3\CMS\Backend\Controller\EditDocumentController\registerHistoryButtonToButtonBar
‪registerHistoryButtonToButtonBar(ButtonBar $buttonBar, string $position, int $group)
Definition: EditDocumentController.php:1844
‪TYPO3\CMS\Backend\Controller\EditDocumentController\parseAdditionalGetParameters
‪parseAdditionalGetParameters(array &$parameters, array $typoScript)
Definition: EditDocumentController.php:1136
‪TYPO3\CMS\Backend\Form\Utility\FormEngineUtility
Definition: FormEngineUtility.php:38
‪TYPO3\CMS\Core\Database\Query\QueryBuilder
Definition: QueryBuilder.php:47
‪TYPO3\CMS\Backend\Utility\BackendUtility\isTableWorkspaceEnabled
‪static bool isTableWorkspaceEnabled($table)
Definition: BackendUtility.php:4493
‪TYPO3\CMS\Backend\Utility\BackendUtility\translationCount
‪static string translationCount($table, $ref, $msg='')
Definition: BackendUtility.php:3837
‪TYPO3\CMS\Core\Site\Entity\SiteLanguage
Definition: SiteLanguage.php:25
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$returnNewPageId
‪bool $returnNewPageId
Definition: EditDocumentController.php:225
‪TYPO3\CMS\Backend\Form\Utility\FormEngineUtility\updateInlineView
‪static updateInlineView(&$uc, $tce)
Definition: FormEngineUtility.php:145
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$viewId_addParams
‪string $viewId_addParams
Definition: EditDocumentController.php:401
‪TYPO3\CMS\Backend\Controller\EditDocumentController\registerViewButtonToButtonBar
‪registerViewButtonToButtonBar(ButtonBar $buttonBar, string $position, int $group)
Definition: EditDocumentController.php:1576
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$deprecatedPublicProperties
‪array $deprecatedPublicProperties
Definition: EditDocumentController.php:89
‪TYPO3\CMS\Core\Page\PageRenderer
Definition: PageRenderer.php:35
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$pageinfo
‪array $pageinfo
Definition: EditDocumentController.php:320
‪TYPO3\CMS\Core\Messaging\AbstractMessage\WARNING
‪const WARNING
Definition: AbstractMessage.php:28
‪TYPO3\CMS\Backend\Controller\EditDocumentController\registerCloseButtonToButtonBar
‪registerCloseButtonToButtonBar(ButtonBar $buttonBar, string $position, int $group)
Definition: EditDocumentController.php:1530
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$doc
‪TYPO3 CMS Backend Template DocumentTemplate $doc
Definition: EditDocumentController.php:282
‪TYPO3\CMS\Backend\Controller\EditDocumentController\compileStoreData
‪compileStoreData()
Definition: EditDocumentController.php:2580
‪TYPO3\CMS\Backend\Controller\EditDocumentController
Definition: EditDocumentController.php:64
‪TYPO3\CMS\Backend\Controller\EditDocumentController\resolvePreviewRecordId
‪int resolvePreviewRecordId(string $table, array $recordArray, array $previewConfiguration)
Definition: EditDocumentController.php:1045
‪TYPO3\CMS\Backend\Controller\EditDocumentController\generatePreviewCode
‪string generatePreviewCode()
Definition: EditDocumentController.php:942
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$noView
‪bool $noView
Definition: EditDocumentController.php:261
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$cacheCmd
‪string $cacheCmd
Definition: EditDocumentController.php:213
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$R_URL_getvars
‪array $R_URL_getvars
Definition: EditDocumentController.php:305
‪TYPO3\CMS\Frontend\Page\PageRepository\DOKTYPE_SYSFOLDER
‪const DOKTYPE_SYSFOLDER
Definition: PageRepository.php:174
‪TYPO3\CMS\Backend\Controller\EditDocumentController\setIsSavedRecord
‪setIsSavedRecord()
Definition: EditDocumentController.php:1452
‪TYPO3\CMS\Frontend\Page\PageRepository
Definition: PageRepository.php:53
‪TYPO3\CMS\Backend\Controller\EditDocumentController\localizationRedirect
‪ResponseInterface null localizationRedirect(ServerRequestInterface $request=null)
Definition: EditDocumentController.php:2339
‪TYPO3\CMS\Backend\Routing\UriBuilder
Definition: UriBuilder.php:35
‪TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\getModuleData
‪mixed getModuleData($module, $type='')
Definition: AbstractUserAuthentication.php:1233
‪TYPO3\CMS\Core\Utility\HttpUtility\buildQueryString
‪static string buildQueryString(array $parameters, string $prependCharacter='', bool $skipEmptyParameters=false)
Definition: HttpUtility.php:160
‪TYPO3\CMS\Backend\Utility\BackendUtility\getLiveVersionOfRecord
‪static array null getLiveVersionOfRecord($table, $uid, $fields=' *')
Definition: BackendUtility.php:4213
‪TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\pushModuleData
‪pushModuleData($module, $data, $noSave=0)
Definition: AbstractUserAuthentication.php:1213
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$redirect
‪string $redirect
Definition: EditDocumentController.php:218
‪TYPO3\CMS\Backend\Utility\BackendUtility\getRecordTitle
‪static string getRecordTitle($table, $row, $prep=false, $forceResult=true)
Definition: BackendUtility.php:1811
‪TYPO3\CMS\Backend\Controller\EditDocumentController\getBackendUser
‪TYPO3 CMS Core Authentication BackendUserAuthentication getBackendUser()
Definition: EditDocumentController.php:2757
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$content
‪$content
Definition: EditDocumentController.php:292
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$closeDoc
‪int $closeDoc
Definition: EditDocumentController.php:179
‪TYPO3\CMS\Backend\Controller\EditDocumentController\setIsPageInFreeTranslationMode
‪setIsPageInFreeTranslationMode($record, int $sysLanguageUid)
Definition: EditDocumentController.php:1482
‪TYPO3\CMS\Core\Type\Bitmask\Permission\PAGE_SHOW
‪const PAGE_SHOW
Definition: Permission.php:32
‪TYPO3\CMS\Extbase\SignalSlot\Dispatcher\dispatch
‪mixed dispatch($signalClassName, $signalName, array $signalArguments=[])
Definition: Dispatcher.php:115
‪TYPO3\CMS\Backend\Controller\EditDocumentController\closeDocument
‪ResponseInterface null closeDocument($mode=self::DOCUMENT_CLOSE_MODE_DEFAULT, ServerRequestInterface $request=null)
Definition: EditDocumentController.php:2634
‪TYPO3\CMS\Backend\Controller\EditDocumentController\openInNewWindowLink
‪openInNewWindowLink()
Definition: EditDocumentController.php:2118
‪TYPO3\CMS\Core\Compatibility\PublicMethodDeprecationTrait
Definition: PublicMethodDeprecationTrait.php:68
‪TYPO3\CMS\Backend\Utility\BackendUtility
Definition: BackendUtility.php:72
‪TYPO3\CMS\Backend\Utility\BackendUtility\getWorkspaceVersionOfRecord
‪static array bool getWorkspaceVersionOfRecord($workspace, $table, $uid, $fields=' *')
Definition: BackendUtility.php:4166
‪TYPO3\CMS\Backend\Template\Components\ButtonBar\makeLinkButton
‪LinkButton makeLinkButton()
Definition: ButtonBar.php:120
‪TYPO3\CMS\Backend\Utility\BackendUtility\getRecordWSOL
‪static array getRecordWSOL( $table, $uid, $fields=' *', $where='', $useDeleteClause=true, $unsetMovePointers=false)
Definition: BackendUtility.php:174
‪TYPO3\CMS\Backend\Template\Components\Buttons\InputButton\setForm
‪InputButton setForm($form)
Definition: InputButton.php:115
‪TYPO3\CMS\Backend\Controller\EditDocumentController\fixWSversioningInEditConf
‪fixWSversioningInEditConf($mapArray=false)
Definition: EditDocumentController.php:2481
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$cmd
‪array $cmd
Definition: EditDocumentController.php:202
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$storeUrl
‪string $storeUrl
Definition: EditDocumentController.php:340
‪TYPO3\CMS\Core\Utility\MathUtility\convertToPositiveInteger
‪static int convertToPositiveInteger($theInt)
Definition: MathUtility.php:55
‪TYPO3\CMS\Backend\Utility\BackendUtility\getRecord
‪static array null getRecord($table, $uid, $fields=' *', $where='', $useDeleteClause=true)
Definition: BackendUtility.php:130
‪TYPO3\CMS\Backend\Controller\EditDocumentController\getNewIconMode
‪string getNewIconMode($table, $key='saveDocNew')
Definition: EditDocumentController.php:2600
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$signalSlotDispatcher
‪TYPO3 CMS Extbase SignalSlot Dispatcher $signalSlotDispatcher
Definition: EditDocumentController.php:420
‪TYPO3\CMS\Core\Http\RedirectResponse
Definition: RedirectResponse.php:27
‪TYPO3\CMS\Backend\Controller\EditDocumentController\makeEditForm
‪string makeEditForm()
Definition: EditDocumentController.php:1211
‪TYPO3\CMS\Backend\Form\NodeFactory
Definition: NodeFactory.php:36
‪TYPO3\CMS\Core\Messaging\AbstractMessage\OK
‪const OK
Definition: AbstractMessage.php:27
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$defVals
‪array null $defVals
Definition: EditDocumentController.php:152
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$newC
‪int $newC
Definition: EditDocumentController.php:388
‪TYPO3\CMS\Backend\Form\Exception\DatabaseRecordException
Definition: DatabaseRecordException.php:23
‪TYPO3\CMS\Backend\Controller\EditDocumentController\compileStoreDat
‪compileStoreDat()
Definition: EditDocumentController.php:2570
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$formResultCompiler
‪FormResultCompiler $formResultCompiler
Definition: EditDocumentController.php:410
‪TYPO3\CMS\Backend\Utility\BackendUtility\viewOnClick
‪static string viewOnClick( $pageUid, $backPath='', $rootLine=null, $anchorSection='', $alternativeUrl='', $additionalGetVars='', $switchFocus=true)
Definition: BackendUtility.php:2616
‪TYPO3\CMS\Backend\Template\Components\ButtonBar\makeHelpButton
‪HelpButton makeHelpButton()
Definition: ButtonBar.php:150
‪TYPO3\CMS\Backend\Controller\EditDocumentController\registerDeleteButtonToButtonBar
‪registerDeleteButtonToButtonBar(ButtonBar $buttonBar, string $position, int $group)
Definition: EditDocumentController.php:1770
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$modTSconfig
‪$modTSconfig
Definition: EditDocumentController.php:406
‪TYPO3\CMS\Backend\Controller\EditDocumentController\shortCutLink
‪shortCutLink()
Definition: EditDocumentController.php:2094
‪TYPO3\CMS\Backend\Controller\EditDocumentController\getSignalSlotDispatcher
‪TYPO3 CMS Extbase SignalSlot Dispatcher getSignalSlotDispatcher()
Definition: EditDocumentController.php:2746
‪TYPO3\CMS\Core\Messaging\FlashMessage
Definition: FlashMessage.php:22
‪TYPO3\CMS\Core\Type\Bitmask\Permission\CONTENT_EDIT
‪const CONTENT_EDIT
Definition: Permission.php:52
‪TYPO3\CMS\Backend\Utility\BackendUtility\getPagesTSconfig
‪static array getPagesTSconfig($id, $rootLine=null, $returnPartArray=false)
Definition: BackendUtility.php:864
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$errorC
‪int $errorC
Definition: EditDocumentController.php:382
‪TYPO3\CMS\Backend\Controller\EditDocumentController\registerNewButtonToButtonBar
‪registerNewButtonToButtonBar(ButtonBar $buttonBar, string $position, int $group, int $sysLanguageUid, int $l18nParent)
Definition: EditDocumentController.php:1652
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$storeTitle
‪string $storeTitle
Definition: EditDocumentController.php:327
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Backend\Form\Exception\AccessDeniedException
Definition: AccessDeniedException.php:25
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$viewUrl
‪string $viewUrl
Definition: EditDocumentController.php:249
‪TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction
Definition: DeletedRestriction.php:26
‪TYPO3\CMS\Backend\Controller\EditDocumentController\emitFunctionAfterSignal
‪emitFunctionAfterSignal($signalName, ServerRequestInterface $request)
Definition: EditDocumentController.php:2736
‪TYPO3\CMS\Core\Type\Bitmask\Permission\PAGE_DELETE
‪const PAGE_DELETE
Definition: Permission.php:42
‪TYPO3\CMS\Backend\Controller\EditDocumentController\DOCUMENT_CLOSE_MODE_NO_REDIRECT
‪const DOCUMENT_CLOSE_MODE_NO_REDIRECT
Definition: EditDocumentController.php:72
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$uriBuilder
‪UriBuilder $uriBuilder
Definition: EditDocumentController.php:448
‪TYPO3\CMS\Frontend\Page\CacheHashCalculator
Definition: CacheHashCalculator.php:24
‪TYPO3\CMS\Backend\Controller\EditDocumentController\getButtons
‪getButtons(ServerRequestInterface $request)
Definition: EditDocumentController.php:1389
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$deprecatedPublicMethods
‪array $deprecatedPublicMethods
Definition: EditDocumentController.php:76
‪TYPO3\CMS\Core\Utility\MathUtility
Definition: MathUtility.php:21
‪TYPO3\CMS\Backend\Controller\EditDocumentController\__construct
‪__construct()
Definition: EditDocumentController.php:453
‪TYPO3\CMS\Frontend\Page\PageRepository\DOKTYPE_RECYCLER
‪const DOKTYPE_RECYCLER
Definition: PageRepository.php:175
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$R_URI
‪string $R_URI
Definition: EditDocumentController.php:311
‪TYPO3\CMS\Backend\Template\Components\Buttons\Action\HelpButton\setModuleName
‪HelpButton setModuleName($moduleName)
Definition: HelpButton.php:62
‪TYPO3\CMS\Backend\Controller\EditDocumentController\getPreviewUrlAnchorSection
‪string getPreviewUrlAnchorSection()
Definition: EditDocumentController.php:1067
‪TYPO3\CMS\Core\Utility\HttpUtility
Definition: HttpUtility.php:21
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$dontStoreDocumentRef
‪bool $dontStoreDocumentRef
Definition: EditDocumentController.php:416
‪TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait
Definition: PublicPropertyDeprecationTrait.php:66
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$doSave
‪bool $doSave
Definition: EditDocumentController.php:187
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$storeArray
‪array $storeArray
Definition: EditDocumentController.php:334
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:44
‪TYPO3\CMS\Backend\Controller\EditDocumentController\init
‪init(ServerRequestInterface $request=null)
Definition: EditDocumentController.php:874
‪TYPO3\CMS\Backend\Controller\EditDocumentController\registerDuplicationButtonToButtonBar
‪registerDuplicationButtonToButtonBar(ButtonBar $buttonBar, string $position, int $group, int $sysLanguageUid, int $l18nParent)
Definition: EditDocumentController.php:1712
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$overrideVals
‪array null $overrideVals
Definition: EditDocumentController.php:158
‪TYPO3\CMS\Backend\Controller\EditDocumentController\getFreeTranslationMode
‪bool getFreeTranslationMode(int $page, int $column, int $language)
Definition: EditDocumentController.php:1509
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\setTemporaryWorkspace
‪bool setTemporaryWorkspace($workspaceId)
Definition: BackendUserAuthentication.php:2276
‪TYPO3\CMS\Backend\Template\Components\AbstractControl\setTitle
‪$this setTitle($title)
Definition: AbstractControl.php:108
‪TYPO3\CMS\Backend\Form\FormDataCompiler
Definition: FormDataCompiler.php:24
‪TYPO3\CMS\Backend\Controller\EditDocumentController\registerColumnsOnlyButtonToButtonBar
‪registerColumnsOnlyButtonToButtonBar(ButtonBar $buttonBar, string $position, int $group)
Definition: EditDocumentController.php:1883
‪TYPO3\CMS\Backend\Form\FormDataGroup\TcaDatabaseRecord
Definition: TcaDatabaseRecord.php:24
‪TYPO3\CMS\Core\Utility\PathUtility\getAbsoluteWebPath
‪static string getAbsoluteWebPath($targetPath)
Definition: PathUtility.php:42
‪TYPO3\CMS\Backend\Template\Components\ButtonBar\BUTTON_POSITION_RIGHT
‪const BUTTON_POSITION_RIGHT
Definition: ButtonBar.php:40
‪TYPO3\CMS\Core\Utility\HttpUtility\redirect
‪static redirect($url, $httpStatus=self::HTTP_STATUS_303)
Definition: HttpUtility.php:103
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$viewId
‪int $viewId
Definition: EditDocumentController.php:395
‪TYPO3\CMS\Backend\Controller
Definition: AbstractFormEngineAjaxController.php:3
‪TYPO3\CMS\Backend\Controller\EditDocumentController\registerCshButtonToButtonBar
‪registerCshButtonToButtonBar(ButtonBar $buttonBar, string $position, int $group)
Definition: EditDocumentController.php:1963
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$returnEditConf
‪bool $returnEditConf
Definition: EditDocumentController.php:271
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$docDat
‪array $docDat
Definition: EditDocumentController.php:352
‪TYPO3\CMS\Core\Messaging\FlashMessageService
Definition: FlashMessageService.php:25
‪TYPO3\CMS\Core\Routing\SiteMatcher
Definition: SiteMatcher.php:53
‪TYPO3\CMS\Core\Http\HtmlResponse
Definition: HtmlResponse.php:25
‪TYPO3\CMS\Backend\Utility\BackendUtility\readPageAccess
‪static array bool readPageAccess($id, $perms_clause)
Definition: BackendUtility.php:635
‪TYPO3\CMS\Backend\Utility\BackendUtility\isRecordLocked
‪static array bool isRecordLocked($table, $uid)
Definition: BackendUtility.php:3397
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$MCONF
‪array $MCONF
Definition: EditDocumentController.php:316
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$popViewId
‪int $popViewId
Definition: EditDocumentController.php:238
‪TYPO3\CMS\Extbase\SignalSlot\Dispatcher
Definition: Dispatcher.php:28
‪TYPO3\CMS\Backend\Template\Components\Buttons\AbstractButton\setShowLabelText
‪$this setShowLabelText($showLabelText)
Definition: AbstractButton.php:60
‪TYPO3\CMS\Backend\Controller\EditDocumentController\getStandAloneContentElementTranslationsCount
‪int getStandAloneContentElementTranslationsCount(int $page, int $column, int $language)
Definition: EditDocumentController.php:2001
‪TYPO3\CMS\Backend\Controller\EditDocumentController\$retUrl
‪string $retUrl
Definition: EditDocumentController.php:173