/** * constructor */ public function __construct() { $this->backendUserAuthentication = $GLOBALS['BE_USER']; $this->languageService = $GLOBALS['LANG']; $this->languageService->includeLLFile('EXT:lang/Resources/Private/Language/locallang_t3lib_fullsearch.xlf'); $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class); }
/** * Constructor */ public function __construct() { $this->languageService = $GLOBALS['LANG']; $this->languageService->includeLLFile('EXT:lang/locallang_mod_web_info.xlf'); $this->backendUser = $GLOBALS['BE_USER']; $this->MCONF = array('name' => $this->moduleName); }
/** * Constructor */ public function __construct() { $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class); $this->languageService = $GLOBALS['LANG']; $this->languageService->includeLLFile('EXT:lang/locallang_mod_web_info.xlf'); $this->backendUser = $GLOBALS['BE_USER']; $this->MCONF = array('name' => $this->moduleName); }
/** * Default constructor */ public function __construct() { $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class); $this->repositoryRepository = $this->objectManager->get(\TYPO3\CMS\Extensionmanager\Domain\Repository\RepositoryRepository::class); $this->listUtility = $this->objectManager->get(\TYPO3\CMS\Extensionmanager\Utility\ListUtility::class); $this->languageService = $this->objectManager->get(\TYPO3\CMS\Lang\LanguageService::class); $this->languageService->includeLLFile('EXT:extensionmanager/Resources/Private/Language/locallang.xlf'); }
/** * Renders a FlexForm configuration form. * * @return void */ public function main() { $this->languageService->includeLLFile('EXT:image_autoresize/mod1/locallang.xlf'); $this->processData(); $formTag = '<form action="" method="post" name="editform">'; if (version_compare(TYPO3_version, '7.5.99', '>')) { $this->moduleTemplate->setForm($formTag); $this->content .= sprintf('<h3>%s</h3>', $this->languageService->getLL('title', true)); $this->addStatisticsAndSocialLink(); } else { if (version_compare(TYPO3_version, '7.4.99', '<=')) { $this->initTCEForms(); } $this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate'); $this->doc->setModuleTemplate(ExtensionManagementUtility::extPath($this->extKey) . 'mod1/mod_template.html'); $this->doc->backPath = $GLOBALS['BACK_PATH']; $this->doc->form = $formTag; $this->content .= $this->doc->header($this->languageService->getLL('title')); $this->addStatisticsAndSocialLink(); $this->content .= $this->doc->spacer(5); } $row = $this->config; if (version_compare(TYPO3_version, '7.5.0', '>=')) { $this->fixRecordForFormEngine($row, array('file_types', 'usergroup')); $this->moduleContent($row); } else { if ($row['rulesets']) { /** @var $flexObj \TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools */ $flexObj = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Configuration\\FlexForm\\FlexFormTools'); $row['rulesets'] = $flexObj->flexArray2Xml($row['rulesets'], true); } $this->moduleContentLegacy($row); } // Compile document if (version_compare(TYPO3_version, '7.5.99', '>')) { $this->addToolbarButtons(); $this->moduleTemplate->setContent($this->content); $content = $this->moduleTemplate->renderContent(); } else { $markers = array('FUNC_MENU' => '', 'CONTENT' => $this->content); // Build the <body> for the module $docHeaderButtons = $this->getButtons(); $content = $this->doc->startPage($this->languageService->getLL('title')); $content .= $this->doc->moduleBody(array(), $docHeaderButtons, $markers); $content .= $this->doc->endPage(); // Wrap result appropriately $content = $this->doc->insertStylesAndJS($content); } // Replace module content with everything needed $this->content = $content; }
/** * Main module function * * @return void * @todo Define visibility */ public function main() { $this->lang->includeLLFile('EXT:impexp/app/locallang.xlf'); // Start document template object: $this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate'); $this->doc->backPath = $GLOBALS['BACK_PATH']; $this->doc->bodyTagId = 'imp-exp-mod'; $this->doc->setModuleTemplate(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('impexp') . '/app/template.html'); $this->pageinfo = BackendUtility::readPageAccess($this->id, $this->perms_clause); // Setting up the context sensitive menu: $this->doc->getContextMenuCode(); $this->doc->postCode = $this->doc->wrapScriptTags('if (top.fsMod) top.fsMod.recentIds["web"] = ' . (int) $this->id . ';'); $this->doc->form = '<form action="' . htmlspecialchars($GLOBALS['MCONF']['_']) . '" method="post" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '"><input type="hidden" name="id" value="' . $this->id . '" />'; $this->content .= $this->doc->header($this->lang->getLL('title')); $this->content .= $this->doc->spacer(5); // Input data grabbed: $inData = GeneralUtility::_GP('tx_impexp'); $this->checkUpload(); switch ((string) $inData['action']) { case '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': // 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 $docHeaderButtons = $this->getButtons(); $markers['CONTENT'] = $this->content; // Build the <body> for the module $this->content = $this->doc->startPage($this->lang->getLL('title')); $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers); $this->content .= $this->doc->endPage(); $this->content = $this->doc->insertStylesAndJS($this->content); }
/** * 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); if (is_array($this->pageinfo)) { $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 . ';'); // Input data grabbed: $inData = GeneralUtility::_GP('tx_impexp'); if (!array_key_exists('excludeDisabled', $inData)) { // flag doesn't exist initially; state is on by default $inData['excludeDisabled'] = 1; } $this->standaloneView->assign('moduleUrl', BackendUtility::getModuleUrl('xMOD_tximpexp')); $this->standaloneView->assign('id', $this->id); $this->standaloneView->assign('inData', $inData); switch ((string) $inData['action']) { case 'export': $this->shortcutName = $this->lang->getLL('title_export'); // Call export interface $this->exportData($inData); $this->standaloneView->setTemplate('Export.html'); break; case 'import': $this->shortcutName = $this->lang->getLL('title_import'); if (GeneralUtility::_POST('_upload')) { $this->checkUpload(); } // Finally: If upload went well, set the new file as the import file: if (!empty($this->uploadedFiles[0])) { // Only allowed extensions.... $extension = $this->uploadedFiles[0]->getExtension(); if ($extension === 't3d' || $extension === 'xml') { $inData['file'] = $this->uploadedFiles[0]->getCombinedIdentifier(); } } // Call import interface: $this->importData($inData); $this->standaloneView->setTemplate('Import.html'); break; } // Setting up the buttons and markers for docheader $this->getButtons(); }
/** * 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->content = '<form action="' . htmlspecialchars(BackendUtility::getModuleUrl('xMOD_tximpexp')) . '" method="post" id="ImportExportController" enctype="multipart/form-data">' . '<input type="hidden" name="id" value="' . $this->id . '" />'; // Input data grabbed: $inData = GeneralUtility::_GP('tx_impexp'); $this->content .= '<h3>' . $this->lang->getLL('title_' . (string) $inData['action'], true) . '</h3>'; $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.... $extension = $this->uploadedFiles[0]->getExtension(); if ($extension === 't3d' || $extension === 'xml') { $inData['file'] = $this->uploadedFiles[0]->getCombinedIdentifier(); } } // Call import interface: $this->importData($inData); break; } // Setting up the buttons and markers for docheader $this->getButtons(); $this->content .= '</form>'; }
/** * Constructor. * * @return self */ public function __construct() { $this->language = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Lang\\LanguageService'); if (is_object($this->getBackendUser())) { $languageKey = $this->getBackendUser()->uc['lang']; } else { $languageKey = $this->getFrontendController()->config['config']['language']; } $this->language->init($languageKey); $this->language->includeLLFile('EXT:commerce/Resources/Private/Language/locallang_ccsv.xml'); }
/** * Initialize method - loads language file * * @return void */ public function initializeObject() { $this->languageService->includeLLFile('EXT:extensionmanager/Resources/Private/Language/locallang.xlf'); }