2 namespace TYPO3\CMS\Impexp\Task;
37 $GLOBALS[
'LANG']->includeLLFile(
'EXT:impexp/Resources/Private/Language/locallang_csh.xlf');
72 $url = BackendUtility::getModuleUrl(
75 'tx_impexp[action]' =>
'export',
77 'preset[select]' => $id)
79 return $this->taskObject->urlInIframe(
$url, 1);
82 $content .= $this->taskObject->description(
$GLOBALS[
'LANG']->getLL(
'.alttitle'),
$GLOBALS[
'LANG']->getLL(
'.description'));
83 $thumbnails = ($lines = array());
87 $thumbnails = \TYPO3\CMS\Core\Utility\GeneralUtility::getFilesInDir($tempDir,
'png,gif,jpg', 1);
89 $clause =
$GLOBALS[
'BE_USER']->getPagePermsClause(1);
90 $usernames = \TYPO3\CMS\Backend\Utility\BackendUtility::getUserNames();
94 if (is_array($presets)) {
95 foreach ($presets as $key => $presetCfg) {
96 $configuration = unserialize($presetCfg[
'preset_data']);
97 $thumbnailFile = $thumbnails[$configuration[
'meta'][
'thumbnail']];
98 $title = strlen($presetCfg[
'title']) ? $presetCfg[
'title'] :
'[' . $presetCfg[
'uid'] .
']';
99 $icon =
'EXT:impexp/Resources/Public/Images/export.gif';
100 $description = array();
102 if ($presetCfg[
'public']) {
103 $description[] =
$GLOBALS[
'LANG']->getLL(
'task.public') .
': ' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_common.xlf:yes');
106 $description[] =
$GLOBALS[
'LANG']->getLL(
'task.owner') .
': ' . ($presetCfg[
'user_uid'] ===
$GLOBALS[
'BE_USER']->user[
'uid'] ?
$GLOBALS[
'LANG']->getLL(
'task.own') :
'[' . htmlspecialchars($usernames[$presetCfg[
'user_uid']][
'username']) .
']');
108 if ($configuration[
'pagetree'][
'id']) {
109 $description[] =
$GLOBALS[
'LANG']->getLL(
'task.page') .
': ' . $configuration[
'pagetree'][
'id'];
110 $description[] =
$GLOBALS[
'LANG']->getLL(
'task.path') .
': ' . htmlspecialchars(\TYPO3\CMS\Backend\Utility\
BackendUtility::getRecordPath($configuration[
'pagetree'][
'id'], $clause, 20));
112 $description[] =
$GLOBALS[
'LANG']->getLL(
'single-record');
115 if ($configuration[
'meta'][
'title'] || $configuration[
'meta'][
'description'] || $configuration[
'meta'][
'notes']) {
116 $metaInformation =
'';
117 if ($configuration[
'meta'][
'title']) {
118 $metaInformation .=
'<strong>' . htmlspecialchars($configuration[
'meta'][
'title']) .
'</strong><br />';
120 if ($configuration[
'meta'][
'description']) {
121 $metaInformation .= htmlspecialchars($configuration[
'meta'][
'description']);
123 if ($configuration[
'meta'][
'notes']) {
124 $metaInformation .=
'<br /><br />
125 <strong>' .
$GLOBALS[
'LANG']->getLL(
'notes') .
': </strong>
126 <em>' . htmlspecialchars($configuration[
'meta'][
'notes']) .
'</em>';
128 $description[] =
'<br />' . $metaInformation;
131 $lines[$key] = array(
134 'descriptionHtml' => implode(
'<br />', $description),
135 'link' => BackendUtility::getModuleUrl(
'user_task') .
'&SET[function]=impexp.TYPO3\\CMS\\Impexp\\Task\\ImportExportTask&display=' . $presetCfg[
'uid']
139 $content .= $this->taskObject->renderListMenu($lines);
142 $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
143 \TYPO3\CMS\Core\Messaging\FlashMessage::class,
144 $GLOBALS[
'LANG']->getLL(
'no-presets'),
146 \TYPO3\CMS\Core\Messaging\FlashMessage::NOTICE
148 $content .= $flashMessage->render();
161 $presets =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetRows(
164 '(public > 0 OR user_uid=' .
$GLOBALS[
'BE_USER']->user[
'uid'] .
')',
166 'item_uid DESC, title'
180 $defaultImportExportFolder = null;
182 $defaultTemporaryFolder = $this->
getBackendUser()->getDefaultUploadTemporaryFolder();
183 if ($defaultTemporaryFolder !== null) {
184 $importExportFolderName =
'importexport';
185 $createFolder = !$defaultTemporaryFolder->hasFolder($importExportFolderName);
186 if ($createFolder ===
true) {
188 $defaultImportExportFolder = $defaultTemporaryFolder->createFolder($importExportFolderName);
189 }
catch (\TYPO3\CMS\Core\Resource\
Exception $folderAccessException) {
192 $defaultImportExportFolder = $defaultTemporaryFolder->getSubfolder($importExportFolderName);
196 return $defaultImportExportFolder;