‪TYPO3CMS  9.5
ImportExportController.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
17 use Psr\Http\Message\ResponseInterface;
18 use Psr\Http\Message\ServerRequestInterface;
51 
57 {
60 
65  'pageinfo' => 'Using ImportExportController::$pageinfo is deprecated and will not be possible anymore in TYPO3 v10.0.',
66  'id' => 'Using ImportExportController::$id is deprecated and will not be possible anymore in TYPO3 v10.0.',
67  'perms_clause' => 'Using ImportExportController::$perms_clause is deprecated and will not be possible anymore in TYPO3 v10.0.',
68  'extObj' => 'Using ImportExportController::$extObj is deprecated, the property will be removed in TYPO3 v10.0.',
69  'doc' => 'Using ImportExportController::$doc is deprecated, the property will be removed in TYPO3 v10.0.',
70  'content' => 'Using ImportExportController::$content is deprecated, the property will be removed in TYPO3 v10.0.',
71  'extClassConf' => 'Using ImportExportController::$extClassConf is deprecated, the property will be removed in TYPO3 v10.0.',
72  'modMenu_setDefaultList' => 'Using ImportExportController::$modMenu_setDefaultList is deprecated, the property will be removed in TYPO3 v10.0.',
73  'modMenu_dontValidateList' => 'Using ImportExportController::$modMenu_dontValidateList is deprecated, the property will be removed in TYPO3 v10.0.',
74  'modMenu_type' => 'Using ImportExportController::$modMenu_type is deprecated, the property will be removed in TYPO3 v10.0.',
75  'modTSconfig' => 'Using ImportExportController::$modTSconfig is deprecated, the property will be removed in TYPO3 v10.0.',
76  'MOD_SETTINGS' => 'Using ImportExportController::$MOD_SETTINGS is deprecated, the property will be removed in TYPO3 v10.0.',
77  'MOD_MENU' => 'Using ImportExportController::MOD_MENU is deprecated, the property will be removed in TYPO3 v10.0.',
78  'CMD' => 'Using ImportExportController::$CMD is deprecated, the property will be removed in TYPO3 v10.0.',
79  'MCONF' => 'Using ImportExportController::$MCONF is deprecated, the property will be removed in TYPO3 v10.0.',
80  ];
81 
85  private ‪$deprecatedPublicMethods = [
86  'init' => 'Using ImportExportController::init() is deprecated and will not be possible anymore in TYPO3 v10.0.',
87  'main' => 'Using ImportExportController::main() is deprecated and will not be possible anymore in TYPO3 v10.0.',
88  'exportData' => 'Using ImportExportController::exportData() is deprecated and will not be possible anymore in TYPO3 v10.0.',
89  'addRecordsForPid' => 'Using ImportExportController::addRecordsForPid() is deprecated and will not be possible anymore in TYPO3 v10.0.',
90  'exec_listQueryPid' => 'Using ImportExportController::exec_listQueryPid() is deprecated and will not be possible anymore in TYPO3 v10.0.',
91  'makeConfigurationForm' => 'Using ImportExportController::makeConfigurationForm() is deprecated and will not be possible anymore in TYPO3 v10.0.',
92  'makeAdvancedOptionsForm' => 'Using ImportExportController::makeAdvancedOptionsForm() is deprecated and will not be possible anymore in TYPO3 v10.0.',
93  'makeSaveForm' => 'Using ImportExportController::makeSaveForm() is deprecated and will not be possible anymore in TYPO3 v10.0.',
94  'importData' => 'Using ImportExportController::importData() is deprecated and will not be possible anymore in TYPO3 v10.0.',
95  'checkUpload' => 'Using ImportExportController::checkUpload() is deprecated and will not be possible anymore in TYPO3 v10.0.',
96  'getTableSelectOptions' => 'Using ImportExportController::getTableSelectOptions() is deprecated and will not be possible anymore in TYPO3 v10.0.',
97  'filterPageIds' => 'Using ImportExportController::filterPageIds() is deprecated and will not be possible anymore in TYPO3 v10.0.',
98  'getExtObjContent' => 'Using ImportExportController::getExtObjContent() is deprecated, the method will be removed in TYPO3 v10.0.',
99  'extObjContent' => 'Using ImportExportController::extObjContent() is deprecated, the method will be removed in TYPO3 v10.0.',
100  'extObjHeader' => 'Using ImportExportController::extObjHeader() is deprecated, the method will be removed in TYPO3 v10.0.',
101  'checkSubExtObj' => 'Using ImportExportController::checkSubExtObj() is deprecated, the method will be removed in TYPO3 v10.0.',
102  'checkExtObj' => 'Using ImportExportController::checkExtObj() is deprecated, the method will be removed in TYPO3 v10.0.',
103  'getExternalItemConfig' => 'Using ImportExportController::getExternalItemConfig() is deprecated, the method will be removed in TYPO3 v10.0.',
104  'handleExternalFunctionValue' => 'Using ImportExportController::handleExternalFunctionValue() is deprecated, the method will be removed in TYPO3 v10.0.',
105  'mergeExternalItems' => 'Using ImportExportController::mergeExternalItems() is deprecated, the method will be removed in TYPO3 v10.0.',
106  'menuConfig' => 'Using ImportExportController::menuConfig() is deprecated, the method will be removed in TYPO3 v10.0.',
107  ];
108 
112  protected ‪$uploadedFiles = [];
113 
119  protected ‪$id;
120 
126  protected ‪$pageinfo;
127 
133  protected ‪$perms_clause;
134 
138  protected ‪$export;
139 
143  protected ‪$import;
144 
148  protected ‪$fileProcessor;
149 
153  protected ‪$lang;
154 
158  protected ‪$treeHTML = '';
159 
163  protected ‪$iconFactory;
164 
170  protected ‪$moduleName = 'xMOD_tximpexp';
171 
178 
184  protected ‪$shortcutName;
185 
191  protected ‪$presetRepository;
192 
196  protected ‪$standaloneView;
197 
201  protected ‪$excludeDisabledRecords = false;
202 
208  protected ‪$returnUrl;
209 
217  protected ‪$MCONF = [];
218 
226  protected ‪$CMD;
227 
235  protected ‪$MOD_MENU = [
236  'function' => []
237  ];
238 
246  protected ‪$MOD_SETTINGS = [];
247 
255  protected ‪$modTSconfig;
256 
265  protected ‪$modMenu_type = '';
266 
275  protected ‪$modMenu_dontValidateList = '';
276 
285  protected ‪$modMenu_setDefaultList = '';
286 
294  protected ‪$extClassConf;
295 
302  protected ‪$content = '';
303 
308  protected ‪$doc;
309 
317  protected ‪$extObj;
318 
322  public function ‪__construct()
323  {
324  $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
325  $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
326  $this->presetRepository = GeneralUtility::makeInstance(PresetRepository::class);
327 
328  $templatePath = ‪ExtensionManagementUtility::extPath('impexp') . 'Resources/Private/';
329 
330  $this->standaloneView = GeneralUtility::makeInstance(StandaloneView::class);
331  $this->standaloneView->setTemplateRootPaths([$templatePath . 'Templates/ImportExport/']);
332  $this->standaloneView->setLayoutRootPaths([$templatePath . 'Layouts/']);
333  $this->standaloneView->setPartialRootPaths([$templatePath . 'Partials/']);
334  $this->standaloneView->getRequest()->setControllerExtensionName('impexp');
335  }
336 
340  protected function ‪init()
341  {
342  // @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
343  $this->MCONF['name'] = ‪$this->moduleName;
344  // @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
345  $this->CMD = GeneralUtility::_GP('CMD');
346 
347  $this->id = (int)GeneralUtility::_GP('id');
348  $this->perms_clause = $this->‪getBackendUser()->‪getPagePermsClause(‪Permission::PAGE_SHOW);
349  $this->returnUrl = GeneralUtility::sanitizeLocalUrl(GeneralUtility::_GP('returnUrl'));
350  $this->lang = $this->‪getLanguageService();
351  }
352 
360  protected function ‪main()
361  {
362  $this->lang->includeLLFile('EXT:impexp/Resources/Private/Language/locallang.xlf');
363 
364  // Start document template object
365  // @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0. Instantiation will be removed.
366  $this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
367  $this->doc->bodyTagId = 'imp-exp-mod';
368 
369  $this->pageinfo = ‪BackendUtility::readPageAccess($this->id, $this->perms_clause);
370  if (is_array($this->pageinfo)) {
371  $this->moduleTemplate->getDocHeaderComponent()->setMetaInformation($this->pageinfo);
372  }
373  // Setting up the context sensitive menu:
374  $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ContextMenu');
375  $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Impexp/ImportExport');
376  $this->moduleTemplate->addJavaScriptCode(
377  'ImpexpInLineJS',
378  'if (top.fsMod) top.fsMod.recentIds["web"] = ' . (int)$this->id . ';'
379  );
380 
381  // Input data grabbed:
382  $inData = GeneralUtility::_GP('tx_impexp');
383  if ($inData === null) {
384  // This happens if the post request was larger than allowed on the server
385  // We set the import action as default and output a user information
386  $inData = [
387  'action' => 'import',
388  ];
389  $flashMessage = GeneralUtility::makeInstance(
390  FlashMessage::class,
391  $this->lang->getLL('importdata_upload_nodata'),
392  $this->lang->getLL('importdata_upload_error'),
394  );
395  $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
396  $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
397  $defaultFlashMessageQueue->enqueue($flashMessage);
398  }
399  if (!array_key_exists('excludeDisabled', $inData)) {
400  // flag doesn't exist initially; state is on by default
401  $inData['excludeDisabled'] = 1;
402  }
403  $uriBuilder = GeneralUtility::makeInstance(\‪TYPO3\CMS\Backend\Routing\UriBuilder::class);
404  $this->standaloneView->assign('moduleUrl', (string)$uriBuilder->buildUriFromRoute('xMOD_tximpexp'));
405  $this->standaloneView->assign('id', $this->id);
406  $this->standaloneView->assign('inData', $inData);
407 
408  switch ((string)$inData['action']) {
409  case 'export':
410  $this->shortcutName = $this->lang->getLL('title_export');
411  // Call export interface
412  $this->‪exportData($inData);
413  $this->standaloneView->setTemplate('Export.html');
414  break;
415  case 'import':
416  $backendUser = $this->‪getBackendUser();
417  $isEnabledForNonAdmin = (bool)($backendUser->getTSConfig()['options.']['impexp.']['enableImportForNonAdminUser'] ?? false);
418  if (!$backendUser->isAdmin() && !$isEnabledForNonAdmin) {
419  throw new \RuntimeException(
420  'Import module is disabled for non admin users and '
421  . 'userTsConfig options.impexp.enableImportForNonAdminUser is not enabled.',
422  1464435459
423  );
424  }
425  $this->shortcutName = $this->lang->getLL('title_import');
426  if (GeneralUtility::_POST('_upload')) {
427  $this->‪checkUpload();
428  }
429  // Finally: If upload went well, set the new file as the import file:
430  if (!empty($this->uploadedFiles[0])) {
431  // Only allowed extensions....
432  $extension = $this->uploadedFiles[0]->getExtension();
433  if ($extension === 't3d' || $extension === 'xml') {
434  $inData['file'] = $this->uploadedFiles[0]->getCombinedIdentifier();
435  }
436  }
437  // Call import interface:
438  $this->‪importData($inData);
439  $this->standaloneView->setTemplate('Import.html');
440  break;
441  }
442 
443  // Setting up the buttons and markers for docheader
444  $this->‪getButtons();
445  }
446 
481  public function ‪mainAction(ServerRequestInterface $request): ResponseInterface
482  {
483  // @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0. Can be removed along with $this->doc.
484  ‪$GLOBALS['SOBE'] = $this;
485 
486  $this->‪init();
487  $this->‪main();
488  $this->moduleTemplate->setContent($this->standaloneView->render());
489  return new HtmlResponse($this->moduleTemplate->renderContent());
490  }
491 
495  protected function ‪getButtons()
496  {
497  $buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
498  if ($this->‪getBackendUser()->mayMakeShortcut()) {
499  $shortcutButton = $buttonBar->makeShortcutButton()
500  ->setGetVariables(['tx_impexp'])
501  ->setDisplayName($this->shortcutName)
502  ->setModuleName($this->moduleName);
503  $buttonBar->addButton($shortcutButton);
504  }
505  // back button
506  if ($this->returnUrl) {
507  $backButton = $buttonBar->makeLinkButton()
508  ->setHref($this->returnUrl)
509  ->setTitle($this->lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.goBack'))
510  ->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-view-go-back', ‪Icon::SIZE_SMALL));
511  $buttonBar->addButton($backButton);
512  }
513  // Input data grabbed:
514  $inData = GeneralUtility::_GP('tx_impexp');
515  if ((string)$inData['action'] === 'import') {
516  if ($this->id && is_array($this->pageinfo) || $this->‪getBackendUser()->isAdmin() && !$this->id) {
517  if (is_array($this->pageinfo) && $this->pageinfo['uid']) {
518  // View
520  $this->pageinfo['uid'],
521  '',
522  ‪BackendUtility::BEgetRootLine($this->pageinfo['uid'])
523  );
524  $viewButton = $buttonBar->makeLinkButton()
525  ->setTitle($this->lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.showPage'))
526  ->setHref('#')
527  ->setIcon($this->iconFactory->getIcon('actions-view-page', ‪Icon::SIZE_SMALL))
528  ->setOnClick($onClick);
529  $buttonBar->addButton($viewButton);
530  }
531  }
532  }
533  }
534 
535  /**************************
536  * EXPORT FUNCTIONS
537  **************************/
538 
547  protected function ‪exportData($inData)
548  {
549  // BUILDING EXPORT DATA:
550  // Processing of InData array values:
551  $inData['filename'] = trim(preg_replace('/[^[:alnum:]._-]*/', '', preg_replace('/\\.(t3d|xml)$/', '', $inData['filename'])));
552  if (strlen($inData['filename'])) {
553  $inData['filename'] .= $inData['filetype'] === 'xml' ? '.xml' : '.t3d';
554  }
555  // Set exclude fields in export object:
556  if (!is_array($inData['exclude'])) {
557  $inData['exclude'] = [];
558  }
559  // Saving/Loading/Deleting presets:
560  $this->presetRepository->processPresets($inData);
561  // Create export object and configure it:
562  $this->export = GeneralUtility::makeInstance(Export::class);
563  $this->export->init(0);
564  $this->export->excludeMap = (array)$inData['exclude'];
565  $this->export->softrefCfg = (array)$inData['softrefCfg'];
566  $this->export->extensionDependencies = ($inData['extension_dep'] === '') ? [] : (array)$inData['extension_dep'];
567  $this->export->showStaticRelations = $inData['showStaticRelations'];
568  $this->export->includeExtFileResources = !$inData['excludeHTMLfileResources'];
569  $this->excludeDisabledRecords = (bool)$inData['excludeDisabled'];
570  $this->export->setExcludeDisabledRecords($this->excludeDisabledRecords);
571 
572  // Static tables:
573  if (is_array($inData['external_static']['tables'])) {
574  $this->export->relStaticTables = $inData['external_static']['tables'];
575  }
576  // Configure which tables external relations are included for:
577  if (is_array($inData['external_ref']['tables'])) {
578  $this->export->relOnlyTables = $inData['external_ref']['tables'];
579  }
580  $saveFilesOutsideExportFile = false;
581  if (isset($inData['save_export']) && isset($inData['saveFilesOutsideExportFile']) && $inData['saveFilesOutsideExportFile'] === '1') {
582  $this->export->setSaveFilesOutsideExportFile(true);
583  $saveFilesOutsideExportFile = true;
584  }
585  $this->export->setHeaderBasics();
586  // Meta data setting:
587 
588  $beUser = $this->‪getBackendUser();
589  $this->export->setMetaData(
590  $inData['meta']['title'],
591  $inData['meta']['description'],
592  $inData['meta']['notes'],
593  $beUser->user['username'],
594  $beUser->user['realName'],
595  $beUser->user['email']
596  );
597  // Configure which records to export
598  if (is_array($inData['record'])) {
599  foreach ($inData['record'] as $ref) {
600  $rParts = explode(':', $ref);
601  $this->export->export_addRecord($rParts[0], ‪BackendUtility::getRecord($rParts[0], $rParts[1]));
602  }
603  }
604  // Configure which tables to export
605  if (is_array($inData['list'])) {
606  foreach ($inData['list'] as $ref) {
607  $rParts = explode(':', $ref);
608  if ($beUser->check('tables_select', $rParts[0])) {
609  $statement = $this->‪exec_listQueryPid($rParts[0], $rParts[1]);
610  while ($subTrow = $statement->fetch()) {
611  $this->export->export_addRecord($rParts[0], $subTrow);
612  }
613  }
614  }
615  }
616  // Pagetree
617  if (isset($inData['pagetree']['id'])) {
618  // Based on click-expandable tree
619  $idH = null;
620  if ($inData['pagetree']['levels'] == -1) {
621  $pagetree = GeneralUtility::makeInstance(ExportPageTreeView::class);
622  if ($this->excludeDisabledRecords) {
623  $pagetree->init(‪BackendUtility::BEenableFields('pages'));
624  }
625  $tree = $pagetree->ext_tree($inData['pagetree']['id'], $this->‪filterPageIds($this->export->excludeMap));
626  $this->treeHTML = $pagetree->printTree($tree);
627  $idH = $pagetree->buffer_idH;
628  } elseif ($inData['pagetree']['levels'] == -2) {
629  $this->‪addRecordsForPid($inData['pagetree']['id'], $inData['pagetree']['tables']);
630  } else {
631  // Based on depth
632  // Drawing tree:
633  // If the ID is zero, export root
634  if (!$inData['pagetree']['id'] && $beUser->isAdmin()) {
635  $sPage = [
636  'uid' => 0,
637  'title' => 'ROOT'
638  ];
639  } else {
640  $sPage = ‪BackendUtility::getRecordWSOL('pages', $inData['pagetree']['id'], '*', ' AND ' . $this->perms_clause);
641  }
642  if (is_array($sPage)) {
643  $pid = $inData['pagetree']['id'];
644  $tree = GeneralUtility::makeInstance(PageTreeView::class);
645  $initClause = 'AND ' . $this->perms_clause . $this->‪filterPageIds($this->export->excludeMap);
646  if ($this->excludeDisabledRecords) {
647  $initClause .= ‪BackendUtility::BEenableFields('pages');
648  }
649  $tree->init($initClause);
650  $HTML = $this->iconFactory->getIconForRecord('pages', $sPage, ‪Icon::SIZE_SMALL)->render();
651  $tree->tree[] = ['row' => $sPage, 'HTML' => $HTML];
652  $tree->buffer_idH = [];
653  if ($inData['pagetree']['levels'] > 0) {
654  $tree->getTree($pid, $inData['pagetree']['levels'], '');
655  }
656  $idH = [];
657  $idH[$pid]['uid'] = $pid;
658  if (!empty($tree->buffer_idH)) {
659  $idH[$pid]['subrow'] = $tree->buffer_idH;
660  }
661  $pagetree = GeneralUtility::makeInstance(ExportPageTreeView::class);
662  $this->treeHTML = $pagetree->printTree($tree->tree);
663  $this->shortcutName .= ' (' . $sPage['title'] . ')';
664  }
665  }
666  // In any case we should have a multi-level array, $idH, with the page structure
667  // here (and the HTML-code loaded into memory for nice display...)
668  if (is_array($idH)) {
669  // Sets the pagetree and gets a 1-dim array in return with the pages (in correct submission order BTW...)
670  $flatList = $this->export->setPageTree($idH);
671  foreach ($flatList as $k => $value) {
672  $this->export->export_addRecord('pages', ‪BackendUtility::getRecord('pages', $k));
673  $this->‪addRecordsForPid($k, $inData['pagetree']['tables']);
674  }
675  }
676  }
677  // After adding ALL records we set relations:
678  for ($a = 0; $a < 10; $a++) {
679  $addR = $this->export->export_addDBRelations($a);
680  if (empty($addR)) {
681  break;
682  }
683  }
684  // Finally files are added:
685  // MUST be after the DBrelations are set so that files from ALL added records are included!
686  $this->export->export_addFilesFromRelations();
687 
688  $this->export->export_addFilesFromSysFilesRecords();
689 
690  // If the download button is clicked, return file
691  if ($inData['download_export'] || $inData['save_export']) {
692  switch ((string)$inData['filetype']) {
693  case 'xml':
694  $out = $this->export->compileMemoryToFileContent('xml');
695  $fExt = '.xml';
696  break;
697  case 't3d':
698  $this->export->dontCompress = 1;
699  // intentional fall-through
700  // no break
701  default:
702  $out = $this->export->compileMemoryToFileContent();
703  $fExt = ($this->export->doOutputCompress() ? '-z' : '') . '.t3d';
704  }
705  // Filename:
706  $dlFile = $inData['filename'];
707  if (!$dlFile) {
708  $exportName = substr(preg_replace('/[^[:alnum:]_]/', '-', $inData['download_export_name']), 0, 20);
709  $dlFile = 'T3D_' . $exportName . '_' . date('Y-m-d_H-i') . $fExt;
710  }
711 
712  // Export for download:
713  if ($inData['download_export']) {
714  $mimeType = 'application/octet-stream';
715  header('Content-Type: ' . $mimeType);
716  header('Content-Length: ' . strlen($out));
717  header('Content-Disposition: attachment; filename=' . ‪PathUtility::basename($dlFile));
718  echo $out;
719  die;
720  }
721  // Export by saving:
722  if ($inData['save_export']) {
723  $saveFolder = $this->‪getDefaultImportExportFolder();
724  ‪$lang = $this->‪getLanguageService();
725  if ($saveFolder !== false && $saveFolder->checkActionPermission('write')) {
726  $temporaryFileName = GeneralUtility::tempnam('export');
727  GeneralUtility::writeFile($temporaryFileName, $out);
728  $file = $saveFolder->addFile($temporaryFileName, $dlFile, 'replace');
729  if ($saveFilesOutsideExportFile) {
730  $filesFolderName = $dlFile . '.files';
731  $filesFolder = $saveFolder->createFolder($filesFolderName);
732  $temporaryFilesForExport = GeneralUtility::getFilesInDir($this->export->getTemporaryFilesPathForExport(), '', true);
733  foreach ($temporaryFilesForExport as $temporaryFileForExport) {
734  $filesFolder->addFile($temporaryFileForExport);
735  GeneralUtility::unlink_tempfile($temporaryFileForExport);
736  }
737  GeneralUtility::rmdir($this->export->getTemporaryFilesPathForExport());
738  }
739 
741  $flashMessage = GeneralUtility::makeInstance(
742  FlashMessage::class,
743  sprintf(‪$lang->‪getLL('exportdata_savedInSBytes'), $file->getPublicUrl(), GeneralUtility::formatSize(strlen($out))),
744  ‪$lang->‪getLL('exportdata_savedFile'),
746  );
747  } else {
749  $flashMessage = GeneralUtility::makeInstance(
750  FlashMessage::class,
751  sprintf(‪$lang->‪getLL('exportdata_badPathS'), $saveFolder->getPublicUrl()),
752  ‪$lang->‪getLL('exportdata_problemsSavingFile'),
754  );
755  }
757  $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
759  $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
760  $defaultFlashMessageQueue->enqueue($flashMessage);
761  }
762  }
763 
764  $this->‪makeConfigurationForm($inData);
765 
766  $this->‪makeSaveForm($inData);
767 
768  $this->‪makeAdvancedOptionsForm($inData);
769 
770  $this->standaloneView->assign('errors', $this->export->errorLog);
771 
772  // Generate overview:
773  $this->standaloneView->assign(
774  'contentOverview',
775  $this->export->displayContentOverview()
776  );
777  }
778 
786  protected function ‪addRecordsForPid($k, $tables, $maxNumber = null)
787  {
788  if (!is_array($tables)) {
789  return;
790  }
791  foreach (‪$GLOBALS['TCA'] as $table => $value) {
792  if ($table !== 'pages' && (in_array($table, $tables) || in_array('_ALL', $tables))) {
793  if ($this->‪getBackendUser()->check('tables_select', $table) && !‪$GLOBALS['TCA'][$table]['ctrl']['is_static']) {
794  if ($maxNumber !== null) {
795  // @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0. Remove this if in TYPO3 v10.0
796  // and the 3rd method argument. trigger_error() is called by method exec_listQueryPid() below
797  $statement = $this->‪exec_listQueryPid($table, $k, ‪MathUtility::forceIntegerInRange($maxNumber, 1));
798  } else {
799  $statement = $this->‪exec_listQueryPid($table, $k);
800  }
801  while ($subTrow = $statement->fetch()) {
802  $this->export->export_addRecord($table, $subTrow);
803  }
804  }
805  }
806  }
807  }
808 
817  protected function ‪exec_listQueryPid($table, $pid, $limit = null)
818  {
819  // @deprecated In v10, remove this if and the method argument
820  if ($limit !== null) {
821  trigger_error(
822  'The third argument of addRecordsForPid() and exec_listQueryPid() has been'
823  . ' deprecated, do not limit exports anymore. The parameter will be removed in TYPO3 v10.0.',
824  E_USER_DEPRECATED
825  );
826  }
827 
828  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table);
829 
830  $orderBy = ‪$GLOBALS['TCA'][$table]['ctrl']['sortby'] ?: ‪$GLOBALS['TCA'][$table]['ctrl']['default_sortby'];
831  $queryBuilder->getRestrictions()->add(GeneralUtility::makeInstance(BackendWorkspaceRestriction::class));
832 
833  if ($this->excludeDisabledRecords === false) {
834  $queryBuilder->getRestrictions()
835  ->removeAll()
836  ->add(GeneralUtility::makeInstance(DeletedRestriction::class))
837  ->add(GeneralUtility::makeInstance(BackendWorkspaceRestriction::class));
838  }
839 
840  $queryBuilder->select('*')
841  ->from($table)
842  ->where(
843  $queryBuilder->expr()->eq(
844  'pid',
845  $queryBuilder->createNamedParameter($pid, \PDO::PARAM_INT)
846  )
847  );
848 
849  // @deprecated In v10, remove this if
850  if ($limit !== null) {
851  $queryBuilder->setMaxResults($limit);
852  }
853 
854  foreach (‪QueryHelper::parseOrderBy((string)$orderBy) as $orderPair) {
855  list($fieldName, $order) = $orderPair;
856  $queryBuilder->addOrderBy($fieldName, $order);
857  }
858 
859  $statement = $queryBuilder->execute();
860 
861  // @deprecated In v10, remove this if, and the two getLL locallang target keys
862  if ($limit !== null && $statement->rowCount() == $limit) {
863  $limitWarning = sprintf($this->lang->getLL('makeconfig_anSqlQueryReturned'), $limit);
865  $flashMessage = GeneralUtility::makeInstance(
866  FlashMessage::class,
867  $this->lang->getLL('execlistqu_maxNumberLimit'),
868  $limitWarning,
870  );
872  $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
874  $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
875  $defaultFlashMessageQueue->enqueue($flashMessage);
876  }
877 
878  return $statement;
879  }
880 
886  protected function ‪makeConfigurationForm($inData)
887  {
888  $nameSuggestion = '';
889  // Page tree export options:
890  if (isset($inData['pagetree']['id'])) {
891  $this->standaloneView->assign('treeHTML', $this->treeHTML);
892 
893  $opt = [
894  '-2' => $this->lang->getLL('makeconfig_tablesOnThisPage'),
895  '-1' => $this->lang->getLL('makeconfig_expandedTree'),
896  '0' => $this->lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.depth_0'),
897  '1' => $this->lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.depth_1'),
898  '2' => $this->lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.depth_2'),
899  '3' => $this->lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.depth_3'),
900  '4' => $this->lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.depth_4'),
901  '999' => $this->lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.depth_infi'),
902  ];
903  $this->standaloneView->assign('levelSelectOptions', $opt);
904  $this->standaloneView->assign('tableSelectOptions', $this->‪getTableSelectOptions('pages'));
905  $nameSuggestion .= 'tree_PID' . $inData['pagetree']['id'] . '_L' . $inData['pagetree']['levels'];
906  }
907  // Single record export:
908  if (is_array($inData['record'])) {
909  $records = [];
910  foreach ($inData['record'] as $ref) {
911  $rParts = explode(':', $ref);
912  $tName = $rParts[0];
913  $rUid = $rParts[1];
914  $nameSuggestion .= $tName . '_' . $rUid;
915  $rec = ‪BackendUtility::getRecordWSOL($tName, $rUid);
916  if (!empty($rec)) {
917  $records[] = [
918  'icon' => $this->iconFactory->getIconForRecord($tName, $rec, ‪Icon::SIZE_SMALL)->render(),
919  'title' => ‪BackendUtility::getRecordTitle($tName, $rec, true),
920  'tableName' => $tName,
921  'recordUid' => $rUid
922  ];
923  }
924  }
925  $this->standaloneView->assign('records', $records);
926  }
927  // Single tables/pids:
928  if (is_array($inData['list'])) {
929 
930  // Display information about pages from which the export takes place
931  $tableList = [];
932  foreach ($inData['list'] as $reference) {
933  $referenceParts = explode(':', $reference);
934  $tableName = $referenceParts[0];
935  if ($this->‪getBackendUser()->check('tables_select', $tableName)) {
936  // If the page is actually the root, handle it differently
937  // NOTE: we don't compare integers, because the number actually comes from the split string above
938  if ($referenceParts[1] === '0') {
939  $iconAndTitle = $this->iconFactory->getIcon('apps-pagetree-root', ‪Icon::SIZE_SMALL)->render() . ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
940  } else {
941  $record = ‪BackendUtility::getRecordWSOL('pages', $referenceParts[1]);
942  $iconAndTitle = $this->iconFactory->getIconForRecord('pages', $record, ‪Icon::SIZE_SMALL)->render()
943  . ‪BackendUtility::getRecordTitle('pages', $record, true);
944  }
945 
946  $tableList[] = [
947  'iconAndTitle' => sprintf($this->lang->getLL('makeconfig_tableListEntry'), $tableName, $iconAndTitle),
948  'reference' => $reference
949  ];
950  }
951  }
952  $this->standaloneView->assign('tableList', $tableList);
953  }
954 
955  $this->standaloneView->assign('externalReferenceTableSelectOptions', $this->‪getTableSelectOptions());
956  $this->standaloneView->assign('externalStaticTableSelectOptions', $this->‪getTableSelectOptions());
957  $this->standaloneView->assign('nameSuggestion', $nameSuggestion);
958  }
959 
965  protected function ‪makeAdvancedOptionsForm($inData)
966  {
968  $loadedExtensions = array_combine($loadedExtensions, $loadedExtensions);
969  $this->standaloneView->assign('extensions', $loadedExtensions);
970  $this->standaloneView->assign('inData', $inData);
971  }
972 
978  protected function ‪makeSaveForm($inData)
979  {
980  $opt = $this->presetRepository->getPresets((int)$inData['pagetree']['id']);
981 
982  $this->standaloneView->assign('presetSelectOptions', $opt);
983 
984  $saveFolder = $this->‪getDefaultImportExportFolder();
985  if ($saveFolder) {
986  $this->standaloneView->assign('saveFolder', $saveFolder->getCombinedIdentifier());
987  }
988 
989  // Add file options:
990  $opt = [];
991  $opt['xml'] = $this->lang->getLL('makesavefo_xml');
992  if ($this->export->compress) {
993  $opt['t3d_compressed'] = $this->lang->getLL('makesavefo_t3dFileCompressed');
994  }
995  $opt['t3d'] = $this->lang->getLL('makesavefo_t3dFile');
996 
997  $this->standaloneView->assign('filetypeSelectOptions', $opt);
998 
999  $fileName = '';
1000  if ($saveFolder) {
1001  $this->standaloneView->assign('saveFolder', $saveFolder->getPublicUrl());
1002  $this->standaloneView->assign('hasSaveFolder', true);
1003  }
1004  $this->standaloneView->assign('fileName', $fileName);
1005  }
1006 
1007  /**************************
1008  * IMPORT FUNCTIONS
1009  **************************/
1010 
1019  protected function ‪importData($inData)
1020  {
1021  $access = is_array($this->pageinfo);
1022  $beUser = $this->‪getBackendUser();
1023  if ($this->id && $access || $beUser->isAdmin() && !$this->id) {
1024  if ($beUser->isAdmin() && !$this->id) {
1025  $this->pageinfo = ['title' => '[root-level]', 'uid' => 0, 'pid' => 0];
1026  }
1027  if ($inData['new_import']) {
1028  unset($inData['import_mode']);
1029  }
1031  ‪$import = GeneralUtility::makeInstance(Import::class);
1032  ‪$import->‪init();
1033  ‪$import->update = $inData['do_update'];
1034  ‪$import->import_mode = $inData['import_mode'];
1035  ‪$import->enableLogging = $inData['enableLogging'];
1036  ‪$import->global_ignore_pid = $inData['global_ignore_pid'];
1037  ‪$import->force_all_UIDS = $inData['force_all_UIDS'];
1038  ‪$import->showDiff = !$inData['notShowDiff'];
1039  ‪$import->allowPHPScripts = $inData['allowPHPScripts'];
1040  ‪$import->softrefInputValues = $inData['softrefInputValues'];
1041 
1042  // OUTPUT creation:
1043 
1044  // Make input selector:
1045  // must have trailing slash.
1046  $path = $this->‪getDefaultImportExportFolder();
1047  $exportFiles = $this->‪getExportFiles();
1048 
1049  $this->shortcutName .= ' (' . $this->pageinfo['title'] . ')';
1050 
1051  // Configuration
1052  $selectOptions = [''];
1053  foreach ($exportFiles as $file) {
1054  $selectOptions[$file->getCombinedIdentifier()] = $file->getPublicUrl();
1055  }
1056 
1057  $this->standaloneView->assign('import', ‪$import);
1058  $this->standaloneView->assign('inData', $inData);
1059  $this->standaloneView->assign('fileSelectOptions', $selectOptions);
1060 
1061  if ($path) {
1062  $this->standaloneView->assign('importPath', sprintf($this->lang->getLL('importdata_fromPathS'), $path->getCombinedIdentifier()));
1063  } else {
1064  $this->standaloneView->assign('importPath', $this->lang->getLL('importdata_no_default_upload_folder'));
1065  }
1066  $this->standaloneView->assign('isAdmin', $beUser->isAdmin());
1067 
1068  // Upload file:
1069  $tempFolder = $this->‪getDefaultImportExportFolder();
1070  if ($tempFolder) {
1071  $this->standaloneView->assign('tempFolder', $tempFolder->getCombinedIdentifier());
1072  $this->standaloneView->assign('hasTempUploadFolder', true);
1073  if (GeneralUtility::_POST('_upload')) {
1074  $this->standaloneView->assign('submitted', GeneralUtility::_POST('_upload'));
1075  $this->standaloneView->assign('noFileUploaded', $this->fileProcessor->internalUploadMap[1]);
1076  if ($this->uploadedFiles[0]) {
1077  $this->standaloneView->assign('uploadedFile', $this->uploadedFiles[0]->getName());
1078  }
1079  }
1080  }
1081 
1082  // Perform import or preview depending:
1083  $inFile = $this->‪getFile($inData['file']);
1084  if ($inFile !== null && $inFile->exists()) {
1085  $this->standaloneView->assign('metaDataInFileExists', true);
1086  $importInhibitedMessages = [];
1087  if (‪$import->‪loadFile($inFile->getForLocalProcessing(false), 1)) {
1088  $importInhibitedMessages = ‪$import->‪checkImportPrerequisites();
1089  if ($inData['import_file']) {
1090  if (empty($importInhibitedMessages)) {
1091  ‪$import->‪importData($this->id);
1092  ‪BackendUtility::setUpdateSignal('updatePageTree');
1093  }
1094  }
1095  ‪$import->display_import_pid_record = ‪$this->pageinfo;
1096  $this->standaloneView->assign('contentOverview', ‪$import->‪displayContentOverview());
1097  }
1098  // Compile messages which are inhibiting a proper import and add them to output.
1099  if (!empty($importInhibitedMessages)) {
1100  $flashMessageQueue = GeneralUtility::makeInstance(FlashMessageService::class)->getMessageQueueByIdentifier('impexp.errors');
1101  foreach ($importInhibitedMessages as $message) {
1102  $flashMessageQueue->addMessage(GeneralUtility::makeInstance(
1103  FlashMessage::class,
1104  $message,
1105  '',
1107  ));
1108  }
1109  }
1110  }
1111 
1112  $this->standaloneView->assign('errors', ‪$import->errorLog);
1113  }
1114  }
1115 
1116  /****************************
1117  * Helper functions
1118  ****************************/
1119 
1127  protected function ‪getDefaultImportExportFolder()
1128  {
1129  $defaultImportExportFolder = null;
1130 
1131  $defaultTemporaryFolder = $this->‪getBackendUser()->‪getDefaultUploadTemporaryFolder();
1132  if ($defaultTemporaryFolder !== null) {
1133  $importExportFolderName = 'importexport';
1134  $createFolder = !$defaultTemporaryFolder->hasFolder($importExportFolderName);
1135  if ($createFolder === true) {
1136  try {
1137  $defaultImportExportFolder = $defaultTemporaryFolder->createFolder($importExportFolderName);
1138  } catch (Exception $folderAccessException) {
1139  }
1140  } else {
1141  $defaultImportExportFolder = $defaultTemporaryFolder->getSubfolder($importExportFolderName);
1142  }
1143  }
1145  return $defaultImportExportFolder;
1146  }
1147 
1154  protected function ‪checkUpload()
1155  {
1156  $file = GeneralUtility::_GP('file');
1157  // Initializing:
1158  $this->fileProcessor = GeneralUtility::makeInstance(ExtendedFileUtility::class);
1159  $this->fileProcessor->setActionPermissions();
1160  $conflictMode = empty(GeneralUtility::_GP('overwriteExistingFiles')) ? ‪DuplicationBehavior::__default : ‪DuplicationBehavior::REPLACE;
1161  $this->fileProcessor->setExistingFilesConflictMode(‪DuplicationBehavior::cast($conflictMode));
1162  $this->fileProcessor->start($file);
1163  $result = $this->fileProcessor->processData();
1164  if (!empty($result['upload'])) {
1165  foreach ($result['upload'] as ‪$uploadedFiles) {
1166  $this->uploadedFiles += ‪$uploadedFiles;
1167  }
1168  }
1169  }
1170 
1177  protected function ‪getTableSelectOptions($excludeList = '')
1178  {
1179  $optValues = [];
1180  if (!GeneralUtility::inList($excludeList, '_ALL')) {
1181  $optValues['_ALL'] = '[' . $this->lang->getLL('ALL_tables') . ']';
1182  }
1183  foreach (‪$GLOBALS['TCA'] as $table => $_) {
1184  if ($this->‪getBackendUser()->check('tables_select', $table) && !GeneralUtility::inList($excludeList, $table)) {
1185  $optValues[$table] = $table;
1186  }
1187  }
1188  return $optValues;
1189  }
1190 
1198  protected function ‪filterPageIds($exclude)
1199  {
1200  // Get keys:
1201  $exclude = array_keys($exclude);
1202  // Traverse
1203  $pageIds = [];
1204  foreach ($exclude as $element) {
1205  list($table, $uid) = explode(':', $element);
1206  if ($table === 'pages') {
1207  $pageIds[] = (int)$uid;
1208  }
1209  }
1210  // Add to clause:
1211  if (!empty($pageIds)) {
1212  return ' AND uid NOT IN (' . implode(',', $pageIds) . ')';
1213  }
1214  return '';
1215  }
1216 
1220  protected function ‪getBackendUser(): BackendUserAuthentication
1221  {
1222  return ‪$GLOBALS['BE_USER'];
1223  }
1224 
1228  protected function ‪getLanguageService(): LanguageService
1229  {
1230  return ‪$GLOBALS['LANG'];
1231  }
1232 
1239  protected function ‪getExportFiles()
1240  {
1241  $exportFiles = [];
1242 
1243  $folder = $this->‪getDefaultImportExportFolder();
1244  if ($folder !== null) {
1245 
1247  $filter = GeneralUtility::makeInstance(FileExtensionFilter::class);
1248  $filter->setAllowedFileExtensions(['t3d', 'xml']);
1249  $folder->getStorage()->addFileAndFolderNameFilter([$filter, 'filterFileList']);
1250 
1251  $exportFiles = $folder->getFiles();
1252  }
1253 
1254  return $exportFiles;
1255  }
1256 
1263  protected function ‪getFile($combinedIdentifier)
1264  {
1265  try {
1267  } catch (\Exception $exception) {
1268  $file = null;
1269  }
1270 
1271  return $file;
1272  }
1273 
1282  protected function ‪menuConfig()
1283  {
1284  // Page / user TSconfig settings and blinding of menu-items
1285  $this->modTSconfig['properties'] = ‪BackendUtility::getPagesTSconfig($this->id)['mod.'][$this->MCONF['name'] . '.'] ?? [];
1286  $this->MOD_MENU['function'] = $this->‪mergeExternalItems($this->MCONF['name'], 'function', $this->MOD_MENU['function']);
1287  $blindActions = $this->modTSconfig['properties']['menu.']['function.'] ?? [];
1288  foreach ($blindActions as $key => $value) {
1289  if (!$value && array_key_exists($key, $this->MOD_MENU['function'])) {
1290  unset($this->MOD_MENU['function'][$key]);
1291  }
1292  }
1293  $this->MOD_SETTINGS = ‪BackendUtility::getModuleData($this->MOD_MENU, GeneralUtility::_GP('SET'), $this->MCONF['name'], $this->modMenu_type, $this->modMenu_dontValidateList, $this->modMenu_setDefaultList);
1294  }
1307  protected function ‪mergeExternalItems($modName, $menuKey, $menuArr)
1308  {
1309  $mergeArray = ‪$GLOBALS['TBE_MODULES_EXT'][$modName]['MOD_MENU'][$menuKey];
1310  if (is_array($mergeArray)) {
1311  foreach ($mergeArray as $k => $v) {
1312  if (((string)$v['ws'] === '' || $this->‪getBackendUser()->workspace === 0 && GeneralUtility::inList($v['ws'], 'online')) || $this->‪getBackendUser()->workspace === -1 && GeneralUtility::inList($v['ws'], 'offline') || $this->‪getBackendUser()->workspace > 0 && GeneralUtility::inList($v['ws'], 'custom')) {
1313  $menuArr[$k] = $this->‪getLanguageService()->‪sL($v['title']);
1314  }
1315  }
1316  }
1317  return $menuArr;
1318  }
1319 
1328  protected function ‪handleExternalFunctionValue($MM_key = 'function', $MS_value = null)
1329  {
1330  if ($MS_value === null) {
1331  $MS_value = $this->MOD_SETTINGS[$MM_key];
1332  }
1333  $this->extClassConf = $this->‪getExternalItemConfig($this->MCONF['name'], $MM_key, $MS_value);
1334  }
1335 
1347  protected function ‪getExternalItemConfig($modName, $menuKey, $value = '')
1348  {
1349  if (isset(‪$GLOBALS['TBE_MODULES_EXT'][$modName])) {
1350  return (string)$value !== '' ? ‪$GLOBALS['TBE_MODULES_EXT'][$modName]['MOD_MENU'][$menuKey][$value] : ‪$GLOBALS['TBE_MODULES_EXT'][$modName]['MOD_MENU'][$menuKey];
1351  }
1352  return null;
1353  }
1354 
1364  protected function ‪checkExtObj()
1365  {
1366  if (is_array($this->extClassConf) && $this->extClassConf['name']) {
1367  $this->extObj = GeneralUtility::makeInstance($this->extClassConf['name']);
1368  $this->extObj->init($this, $this->extClassConf);
1369  // Re-write:
1370  $this->MOD_SETTINGS = ‪BackendUtility::getModuleData($this->MOD_MENU, GeneralUtility::_GP('SET'), $this->MCONF['name'], $this->modMenu_type, $this->modMenu_dontValidateList, $this->modMenu_setDefaultList);
1371  }
1372  }
1373 
1379  protected function ‪checkSubExtObj()
1380  {
1381  if (is_object($this->extObj)) {
1382  $this->extObj->checkExtObj();
1383  }
1384  }
1385 
1393  protected function ‪extObjHeader()
1394  {
1395  if (is_callable([$this->extObj, 'head'])) {
1396  $this->extObj->head();
1397  }
1398  }
1405  protected function ‪extObjContent()
1406  {
1407  if ($this->extObj === null) {
1408  $flashMessage = GeneralUtility::makeInstance(
1409  FlashMessage::class,
1410  $this->‪getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang.xlf:no_modules_registered'),
1411  $this->‪getLanguageService()->getLL('title'),
1413  );
1414  $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
1416  $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
1417  $defaultFlashMessageQueue->enqueue($flashMessage);
1418  } else {
1419  $this->extObj->pObj = $this;
1420  if (is_callable([$this->extObj, 'main'])) {
1421  $this->content .= $this->extObj->main();
1422  }
1423  }
1424  }
1425 
1432  protected function ‪getExtObjContent()
1433  {
1434  $savedContent = ‪$this->content;
1435  $this->content = '';
1436  $this->‪extObjContent();
1437  $newContent = ‪$this->content;
1438  $this->content = $savedContent;
1439  return $newContent;
1440  }
1441 }
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$treeHTML
‪string $treeHTML
Definition: ImportExportController.php:145
‪TYPO3\CMS\Impexp\Controller\ImportExportController\mainAction
‪ResponseInterface mainAction(ServerRequestInterface $request)
Definition: ImportExportController.php:448
‪TYPO3\CMS\Impexp\Controller\ImportExportController\exportData
‪exportData($inData)
Definition: ImportExportController.php:514
‪TYPO3\CMS\Impexp\Controller\ImportExportController\mergeExternalItems
‪array mergeExternalItems($modName, $menuKey, $menuArr)
Definition: ImportExportController.php:1274
‪TYPO3\CMS\Core\Imaging\Icon\SIZE_SMALL
‪const SIZE_SMALL
Definition: Icon.php:29
‪TYPO3\CMS\Core\Database\Query\QueryHelper\parseOrderBy
‪static array array[] parseOrderBy(string $input)
Definition: QueryHelper.php:42
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$modMenu_setDefaultList
‪string $modMenu_setDefaultList
Definition: ImportExportController.php:256
‪TYPO3\CMS\Impexp\Controller\ImportExportController\addRecordsForPid
‪addRecordsForPid($k, $tables, $maxNumber=null)
Definition: ImportExportController.php:753
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$id
‪int $id
Definition: ImportExportController.php:113
‪TYPO3\CMS\Core\Utility\PathUtility
Definition: PathUtility.php:23
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$modMenu_dontValidateList
‪string $modMenu_dontValidateList
Definition: ImportExportController.php:247
‪TYPO3\CMS\Core\Resource\DuplicationBehavior
Definition: DuplicationBehavior.php:23
‪TYPO3\CMS\Impexp\Controller
Definition: ImportExportController.php:2
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\getPagePermsClause
‪string getPagePermsClause($perms)
Definition: BackendUserAuthentication.php:523
‪TYPO3\CMS\Impexp\Import\checkImportPrerequisites
‪array checkImportPrerequisites()
Definition: Import.php:265
‪TYPO3\CMS\Core\Imaging\Icon
Definition: Icon.php:25
‪TYPO3\CMS\Backend\Utility\BackendUtility\setUpdateSignal
‪static setUpdateSignal($set='', $params='')
Definition: BackendUtility.php:3164
‪TYPO3
‪TYPO3\CMS\Impexp\Controller\ImportExportController\checkUpload
‪checkUpload()
Definition: ImportExportController.php:1121
‪TYPO3\CMS\Impexp\View\ExportPageTreeView
Definition: ExportPageTreeView.php:29
‪TYPO3\CMS\Impexp\Domain\Repository\PresetRepository
Definition: PresetRepository.php:29
‪TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange
‪static int forceIntegerInRange($theInt, $min, $max=2000000000, $defaultValue=0)
Definition: MathUtility.php:31
‪TYPO3\CMS\Impexp\Controller\ImportExportController\getDefaultImportExportFolder
‪TYPO3 CMS Core Resource Folder null getDefaultImportExportFolder()
Definition: ImportExportController.php:1094
‪TYPO3\CMS\Impexp\Controller\ImportExportController\importData
‪importData($inData)
Definition: ImportExportController.php:986
‪TYPO3\CMS\Core\Resource\ResourceFactory\getInstance
‪static ResourceFactory getInstance()
Definition: ResourceFactory.php:39
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$doc
‪TYPO3 CMS Backend Template DocumentTemplate $doc
Definition: ImportExportController.php:276
‪TYPO3\CMS\Core\Database\Query\Restriction\BackendWorkspaceRestriction
Definition: BackendWorkspaceRestriction.php:28
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\getDefaultUploadTemporaryFolder
‪TYPO3 CMS Core Resource Folder null getDefaultUploadTemporaryFolder()
Definition: BackendUserAuthentication.php:2063
‪TYPO3\CMS\Core\Imaging\IconFactory
Definition: IconFactory.php:31
‪TYPO3\CMS\Core\Localization\LanguageService\sL
‪string sL($input)
Definition: LanguageService.php:158
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$presetRepository
‪PresetRepository $presetRepository
Definition: ImportExportController.php:173
‪TYPO3\CMS\Impexp\Controller\ImportExportController\main
‪main()
Definition: ImportExportController.php:327
‪TYPO3\CMS\Backend\Utility\BackendUtility\BEgetRootLine
‪static array BEgetRootLine($uid, $clause='', $workspaceOL=false, array $additionalFields=[])
Definition: BackendUtility.php:374
‪TYPO3\CMS\Backend\Tree\View\PageTreeView
Definition: PageTreeView.php:23
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$uploadedFiles
‪array TYPO3 CMS Core Resource File[] $uploadedFiles
Definition: ImportExportController.php:107
‪TYPO3\CMS\Impexp\Controller\ImportExportController\filterPageIds
‪string filterPageIds($exclude)
Definition: ImportExportController.php:1165
‪TYPO3\CMS\Impexp\Import\init
‪init()
Definition: Import.php:107
‪TYPO3\CMS\Backend\Template\ModuleTemplate
Definition: ModuleTemplate.php:40
‪TYPO3\CMS\Core\Utility\PathUtility\basename
‪static string basename($path)
Definition: PathUtility.php:164
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$pageinfo
‪array $pageinfo
Definition: ImportExportController.php:119
‪TYPO3\CMS\Core\Type\Bitmask\Permission
Definition: Permission.php:23
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$modMenu_type
‪string $modMenu_type
Definition: ImportExportController.php:238
‪TYPO3\CMS\Impexp\ImportExport\displayContentOverview
‪array displayContentOverview()
Definition: ImportExport.php:269
‪TYPO3\CMS\Impexp\Controller\ImportExportController\menuConfig
‪menuConfig()
Definition: ImportExportController.php:1249
‪TYPO3\CMS\Impexp\Import\loadFile
‪bool loadFile($filename, $all=false)
Definition: Import.php:1651
‪TYPO3\CMS\Impexp\Controller\ImportExportController\checkSubExtObj
‪checkSubExtObj()
Definition: ImportExportController.php:1346
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility
Definition: ExtensionManagementUtility.php:36
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$modTSconfig
‪array $modTSconfig
Definition: ImportExportController.php:229
‪TYPO3\CMS\Impexp\Controller\ImportExportController\handleExternalFunctionValue
‪handleExternalFunctionValue($MM_key='function', $MS_value=null)
Definition: ImportExportController.php:1295
‪TYPO3\CMS\Core\Type\Enumeration\cast
‪static static cast($value)
Definition: Enumeration.php:182
‪TYPO3\CMS\Core\Utility\File\ExtendedFileUtility
Definition: ExtendedFileUtility.php:63
‪TYPO3\CMS\Core\Messaging\AbstractMessage\WARNING
‪const WARNING
Definition: AbstractMessage.php:28
‪TYPO3\CMS\Impexp\Controller\ImportExportController\makeSaveForm
‪makeSaveForm($inData)
Definition: ImportExportController.php:945
‪TYPO3\CMS\Impexp\Controller\ImportExportController
Definition: ImportExportController.php:57
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$deprecatedPublicProperties
‪array $deprecatedPublicProperties
Definition: ImportExportController.php:61
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$MOD_MENU
‪array $MOD_MENU
Definition: ImportExportController.php:211
‪TYPO3\CMS\Impexp\Controller\ImportExportController\extObjHeader
‪extObjHeader()
Definition: ImportExportController.php:1360
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$standaloneView
‪StandaloneView $standaloneView
Definition: ImportExportController.php:177
‪TYPO3\CMS\Impexp\Import
Definition: Import.php:40
‪TYPO3\CMS\Core\Database\Query\QueryHelper
Definition: QueryHelper.php:30
‪TYPO3\CMS\Backend\Template\DocumentTemplate
Definition: DocumentTemplate.php:48
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$moduleTemplate
‪ModuleTemplate $moduleTemplate
Definition: ImportExportController.php:161
‪TYPO3\CMS\Impexp\Controller\ImportExportController\makeConfigurationForm
‪makeConfigurationForm($inData)
Definition: ImportExportController.php:853
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$import
‪Import $import
Definition: ImportExportController.php:133
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$excludeDisabledRecords
‪bool $excludeDisabledRecords
Definition: ImportExportController.php:181
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$lang
‪LanguageService $lang
Definition: ImportExportController.php:141
‪TYPO3\CMS\Core\Resource\ResourceFactory
Definition: ResourceFactory.php:33
‪TYPO3\CMS\Core\Resource\DuplicationBehavior\__default
‪const __default
Definition: DuplicationBehavior.php:24
‪TYPO3\CMS\Impexp\Controller\ImportExportController\getButtons
‪getButtons()
Definition: ImportExportController.php:462
‪TYPO3\CMS\Core\Resource\File
Definition: File.php:23
‪TYPO3\CMS\Backend\Utility\BackendUtility\getRecordTitle
‪static string getRecordTitle($table, $row, $prep=false, $forceResult=true)
Definition: BackendUtility.php:1811
‪TYPO3\CMS\Backend\Utility\BackendUtility\getModuleData
‪static array getModuleData( $MOD_MENU, $CHANGED_SETTINGS, $modName, $type='', $dontValidateList='', $setDefaultList='')
Definition: BackendUtility.php:3259
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$shortcutName
‪string $shortcutName
Definition: ImportExportController.php:167
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$deprecatedPublicMethods
‪array $deprecatedPublicMethods
Definition: ImportExportController.php:81
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$returnUrl
‪string $returnUrl
Definition: ImportExportController.php:187
‪TYPO3\CMS\Core\Resource\Filter\FileExtensionFilter
Definition: FileExtensionFilter.php:28
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:45
‪TYPO3\CMS\Core\Type\Bitmask\Permission\PAGE_SHOW
‪const PAGE_SHOW
Definition: Permission.php:32
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$perms_clause
‪string $perms_clause
Definition: ImportExportController.php:125
‪TYPO3\CMS\Impexp\Controller\ImportExportController\getLanguageService
‪LanguageService getLanguageService()
Definition: ImportExportController.php:1195
‪TYPO3\CMS\Core\Resource\ResourceFactory\getFileObjectFromCombinedIdentifier
‪File ProcessedFile null getFileObjectFromCombinedIdentifier($identifier)
Definition: ResourceFactory.php:424
‪TYPO3\CMS\Backend\Utility\BackendUtility\BEenableFields
‪static string BEenableFields($table, $inv=false)
Definition: BackendUtility.php:256
‪TYPO3\CMS\Core\Compatibility\PublicMethodDeprecationTrait
Definition: PublicMethodDeprecationTrait.php:68
‪TYPO3\CMS\Backend\Utility\BackendUtility
Definition: BackendUtility.php:72
‪TYPO3\CMS\Impexp\Controller\ImportExportController\getExternalItemConfig
‪mixed getExternalItemConfig($modName, $menuKey, $value='')
Definition: ImportExportController.php:1314
‪TYPO3\CMS\Backend\Utility\BackendUtility\getRecordWSOL
‪static array getRecordWSOL( $table, $uid, $fields=' *', $where='', $useDeleteClause=true, $unsetMovePointers=false)
Definition: BackendUtility.php:174
‪TYPO3\CMS\Backend\Utility\BackendUtility\getRecord
‪static array null getRecord($table, $uid, $fields=' *', $where='', $useDeleteClause=true)
Definition: BackendUtility.php:130
‪TYPO3\CMS\Core\Messaging\AbstractMessage\OK
‪const OK
Definition: AbstractMessage.php:27
‪TYPO3\CMS\Impexp\Controller\ImportExportController\__construct
‪__construct()
Definition: ImportExportController.php:289
‪TYPO3\CMS\Core\Resource\Exception
Definition: Exception.php:21
‪TYPO3\CMS\Impexp\Controller\ImportExportController\getExportFiles
‪array TYPO3 CMS Core Resource File[] getExportFiles()
Definition: ImportExportController.php:1206
‪TYPO3\CMS\Backend\Utility\BackendUtility\viewOnClick
‪static string viewOnClick( $pageUid, $backPath='', $rootLine=null, $anchorSection='', $alternativeUrl='', $additionalGetVars='', $switchFocus=true)
Definition: BackendUtility.php:2616
‪TYPO3\CMS\Impexp\Controller\ImportExportController\init
‪init()
Definition: ImportExportController.php:307
‪TYPO3\CMS\Core\Messaging\FlashMessage
Definition: FlashMessage.php:22
‪TYPO3\CMS\Fluid\View\StandaloneView
Definition: StandaloneView.php:32
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$CMD
‪mixed $CMD
Definition: ImportExportController.php:203
‪TYPO3\CMS\Impexp\Import\importData
‪importData($pid)
Definition: Import.php:152
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$moduleName
‪string $moduleName
Definition: ImportExportController.php:155
‪TYPO3\CMS\Backend\Utility\BackendUtility\getPagesTSconfig
‪static array getPagesTSconfig($id, $rootLine=null, $returnPartArray=false)
Definition: BackendUtility.php:864
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$fileProcessor
‪ExtendedFileUtility $fileProcessor
Definition: ImportExportController.php:137
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction
Definition: DeletedRestriction.php:26
‪TYPO3\CMS\Impexp\Export
Definition: Export.php:62
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$extObj
‪object $extObj
Definition: ImportExportController.php:284
‪TYPO3\CMS\Core\Utility\MathUtility
Definition: MathUtility.php:21
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility\extPath
‪static string extPath($key, $script='')
Definition: ExtensionManagementUtility.php:149
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility\getLoadedExtensionListArray
‪static array getLoadedExtensionListArray()
Definition: ExtensionManagementUtility.php:1909
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$content
‪string $content
Definition: ImportExportController.php:271
‪TYPO3\CMS\Core\Resource\DuplicationBehavior\REPLACE
‪const REPLACE
Definition: DuplicationBehavior.php:38
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:29
‪TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait
Definition: PublicPropertyDeprecationTrait.php:66
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:44
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$MOD_SETTINGS
‪array $MOD_SETTINGS
Definition: ImportExportController.php:221
‪TYPO3\CMS\Core\Localization\LanguageService\getLL
‪string getLL($index)
Definition: LanguageService.php:118
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Impexp\Controller\ImportExportController\getExtObjContent
‪string getExtObjContent()
Definition: ImportExportController.php:1399
‪TYPO3\CMS\Impexp\Controller\ImportExportController\makeAdvancedOptionsForm
‪makeAdvancedOptionsForm($inData)
Definition: ImportExportController.php:932
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$extClassConf
‪array $extClassConf
Definition: ImportExportController.php:264
‪TYPO3\CMS\Impexp\Controller\ImportExportController\getBackendUser
‪BackendUserAuthentication getBackendUser()
Definition: ImportExportController.php:1187
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$MCONF
‪array $MCONF
Definition: ImportExportController.php:195
‪TYPO3\CMS\Impexp\Controller\ImportExportController\checkExtObj
‪checkExtObj()
Definition: ImportExportController.php:1331
‪TYPO3\CMS\Core\Resource\Exception
Definition: AbstractFileOperationException.php:2
‪TYPO3\CMS\Core\Messaging\FlashMessageService
Definition: FlashMessageService.php:25
‪TYPO3\CMS\Impexp\Controller\ImportExportController\getTableSelectOptions
‪array getTableSelectOptions($excludeList='')
Definition: ImportExportController.php:1144
‪TYPO3\CMS\Impexp\Controller\ImportExportController\getFile
‪TYPO3 CMS Core Resource File null getFile($combinedIdentifier)
Definition: ImportExportController.php:1230
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$export
‪Export $export
Definition: ImportExportController.php:129
‪TYPO3\CMS\Core\Messaging\AbstractMessage\ERROR
‪const ERROR
Definition: AbstractMessage.php:29
‪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\Impexp\Controller\ImportExportController\extObjContent
‪extObjContent()
Definition: ImportExportController.php:1372
‪TYPO3\CMS\Impexp\Controller\ImportExportController\exec_listQueryPid
‪Doctrine DBAL Driver Statement exec_listQueryPid($table, $pid, $limit=null)
Definition: ImportExportController.php:784
‪TYPO3\CMS\Impexp\Controller\ImportExportController\$iconFactory
‪IconFactory $iconFactory
Definition: ImportExportController.php:149