/** * Main module function * * @throws \BadFunctionCallException * @throws \InvalidArgumentException * @return void */ public function main() { $this->lang->includeLLFile('EXT:impexp/Resources/Private/Language/locallang.xlf'); // Start document template object: // We keep this here, in case somebody relies on the old doc being here $this->doc = GeneralUtility::makeInstance(DocumentTemplate::class); $this->doc->bodyTagId = 'imp-exp-mod'; $this->pageinfo = BackendUtility::readPageAccess($this->id, $this->perms_clause); $this->moduleTemplate->getDocHeaderComponent()->setMetaInformation($this->pageinfo); // Setting up the context sensitive menu: $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ClickMenu'); $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Impexp/ImportExport'); $this->moduleTemplate->addJavaScriptCode('ImpexpInLineJS', 'if (top.fsMod) top.fsMod.recentIds["web"] = ' . (int) $this->id . ';'); $this->moduleTemplate->setForm('<form action="' . htmlspecialchars(BackendUtility::getModuleUrl('xMOD_tximpexp')) . '" method="post" enctype="multipart/form-data">' . '<input type="hidden" name="id" value="' . $this->id . '" />'); // Input data grabbed: $inData = GeneralUtility::_GP('tx_impexp'); $this->content .= $this->moduleTemplate->sectionHeader($this->lang->getLL('title_' . (string) $inData['action'])); $this->content .= '<div style="padding-top: 5px;"></div>'; $this->checkUpload(); switch ((string) $inData['action']) { case 'export': $this->shortcutName = $this->lang->getLL('title_export'); // Finally: If upload went well, set the new file as the thumbnail in the $inData array: if (!empty($this->uploadedFiles[0])) { $inData['meta']['thumbnail'] = $this->uploadedFiles[0]->getCombinedIdentifier(); } // Call export interface $this->exportData($inData); break; case 'import': $this->shortcutName = $this->lang->getLL('title_import'); // Finally: If upload went well, set the new file as the import file: if (!empty($this->uploadedFiles[0])) { // Only allowed extensions.... if (GeneralUtility::inList('t3d,xml', $this->uploadedFiles[0]->getExtension())) { $inData['file'] = $this->uploadedFiles[0]->getCombinedIdentifier(); } } // Call import interface: $this->importData($inData); break; } // Setting up the buttons and markers for docheader $this->getButtons(); }