90 $this->lang->includeLLFile(
'EXT:impexp/app/locallang.xlf');
93 $this->doc->backPath =
$GLOBALS[
'BACK_PATH'];
94 $this->doc->bodyTagId =
'imp-exp-mod';
95 $this->doc->setModuleTemplate(\
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath(
'impexp') .
'/app/template.html');
98 $this->doc->getContextMenuCode();
99 $this->doc->postCode = $this->doc->wrapScriptTags(
'if (top.fsMod) top.fsMod.recentIds["web"] = ' . (
int)$this->
id .
';');
100 $this->doc->form =
'<form action="' . htmlspecialchars(
$GLOBALS[
'MCONF'][
'_']) .
'" method="post" enctype="' 101 .
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'form_enctype'] .
'"><input type="hidden" name="id" value="' . $this->
id .
'" />';
102 $this->content .= $this->doc->header($this->lang->getLL(
'title'));
103 $this->content .= $this->doc->spacer(5);
107 switch ((
string) $inData[
'action']) {
110 if (!empty($this->uploadedFiles[0])) {
111 $inData[
'meta'][
'thumbnail'] = $this->uploadedFiles[0]->getCombinedIdentifier();
118 $isEnabledForNonAdmin = $backendUser->getTSConfig(
'options.impexp.enableImportForNonAdminUser');
119 if (!$backendUser->isAdmin() && empty($isEnabledForNonAdmin[
'value'])) {
120 throw new \RuntimeException(
121 'Import module is disabled for non admin users and ' 122 .
'userTsConfig options.impexp.enableImportForNonAdminUser is not enabled.',
127 if (!empty($this->uploadedFiles[0])) {
130 $inData[
'file'] = $this->uploadedFiles[0]->getCombinedIdentifier();
134 $this->importData($inData);
141 $this->content = $this->doc->startPage($this->lang->getLL(
'title'));
142 $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
143 $this->content .= $this->doc->endPage();
144 $this->content = $this->doc->insertStylesAndJS($this->content);
168 $buttons[
'shortcut'] = $this->doc->makeShortcutIcon(
'tx_impexp',
'', $this->MCONF[
'name']);
172 if ((
string) $inData[
'action'] ==
'import') {
173 if ($this->
id && is_array($this->pageinfo) || $this->
getBackendUser()->user[
'admin'] && !$this->
id) {
174 if (is_array($this->pageinfo) && $this->pageinfo[
'uid']) {
177 $this->pageinfo[
'uid'],
178 $this->doc->backPath,
181 $title = $this->lang->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.showPage', TRUE);
182 $buttons[
'view'] =
'<a href="#" onclick="' . htmlspecialchars($onClick) .
'" title="' . $title .
'">' 207 $inData[
'filename'] = trim(preg_replace(
'/[^[:alnum:]._-]*/',
'', preg_replace(
'/\\.(t3d|xml)$/',
'', $inData[
'filename'])));
208 if (strlen($inData[
'filename'])) {
209 $inData[
'filename'] .= $inData[
'filetype'] ==
'xml' ?
'.xml' :
'.t3d';
212 if (!is_array($inData[
'exclude'])) {
213 $inData[
'exclude'] = array();
219 $this->export->init(0,
'export');
220 $this->export->setCharset($this->lang->charSet);
221 $this->export->maxFileSize = $inData[
'maxFileSize'] * 1024;
222 $this->export->excludeMap = (array) $inData[
'exclude'];
223 $this->export->softrefCfg = (array) $inData[
'softrefCfg'];
224 $this->export->extensionDependencies = (array) $inData[
'extension_dep'];
225 $this->export->showStaticRelations = $inData[
'showStaticRelations'];
226 $this->export->includeExtFileResources = !$inData[
'excludeHTMLfileResources'];
228 if (is_array($inData[
'external_static'][
'tables'])) {
229 $this->export->relStaticTables = $inData[
'external_static'][
'tables'];
232 if (is_array($inData[
'external_ref'][
'tables'])) {
233 $this->export->relOnlyTables = $inData[
'external_ref'][
'tables'];
235 $this->export->setHeaderBasics();
239 $this->export->setMetaData(
240 $inData[
'meta'][
'title'],
241 $inData[
'meta'][
'description'],
242 $inData[
'meta'][
'notes'],
243 $beUser->user[
'username'],
244 $beUser->user[
'realName'],
245 $beUser->user[
'email']
247 if ($inData[
'meta'][
'thumbnail']) {
248 $theThumb = $this->
getFile($inData[
'meta'][
'thumbnail']);
249 if ($theThumb !== NULL && $theThumb->exists()) {
250 $this->export->addThumbnail($theThumb->getForLocalProcessing(FALSE));
254 if (is_array($inData[
'record'])) {
255 foreach ($inData[
'record'] as $ref) {
256 $rParts = explode(
':', $ref);
257 $this->export->export_addRecord($rParts[0], BackendUtility::getRecord($rParts[0], $rParts[1]));
261 if (is_array($inData[
'list'])) {
263 foreach ($inData[
'list'] as $ref) {
264 $rParts = explode(
':', $ref);
265 if ($beUser->check(
'tables_select', $rParts[0])) {
267 while ($subTrow = $db->sql_fetch_assoc($res)) {
268 $this->export->export_addRecord($rParts[0], $subTrow);
270 $db->sql_free_result($res);
275 if (isset($inData[
'pagetree'][
'id'])) {
278 if ($inData[
'pagetree'][
'levels'] == -1) {
280 $tree = $pagetree->ext_tree($inData[
'pagetree'][
'id'], $this->
filterPageIds($this->export->excludeMap));
281 $this->treeHTML = $pagetree->printTree($tree);
282 $idH = $pagetree->buffer_idH;
283 } elseif ($inData[
'pagetree'][
'levels'] == -2) {
284 $this->
addRecordsForPid($inData[
'pagetree'][
'id'], $inData[
'pagetree'][
'tables'], $inData[
'pagetree'][
'maxNumber']);
289 if (!$inData[
'pagetree'][
'id'] && $beUser->isAdmin()) {
297 if (is_array($sPage)) {
298 $pid = $inData[
'pagetree'][
'id'];
300 $tree->init(
'AND ' . $this->perms_clause . $this->
filterPageIds($this->export->excludeMap));
302 $tree->tree[] = array(
'row' => $sPage,
'HTML' => $HTML);
303 $tree->buffer_idH = array();
304 if ($inData[
'pagetree'][
'levels'] > 0) {
305 $tree->getTree($pid, $inData[
'pagetree'][
'levels'],
'');
308 $idH[$pid][
'uid'] = $pid;
309 if (count($tree->buffer_idH)) {
310 $idH[$pid][
'subrow'] = $tree->buffer_idH;
313 $this->treeHTML = $pagetree->printTree($tree->tree);
318 if (is_array($idH)) {
320 $flatList = $this->export->setPageTree($idH);
321 foreach ($flatList as $k => $value) {
322 $this->export->export_addRecord(
'pages', BackendUtility::getRecord(
'pages', $k));
323 $this->
addRecordsForPid($k, $inData[
'pagetree'][
'tables'], $inData[
'pagetree'][
'maxNumber']);
328 for ($a = 0; $a < 10; $a++) {
329 $addR = $this->export->export_addDBRelations($a);
336 $this->export->export_addFilesFromRelations();
338 $this->export->export_addFilesFromSysFilesRecords();
341 if ($inData[
'download_export'] || $inData[
'save_export']) {
342 switch ((
string) $inData[
'filetype']) {
344 $out = $this->export->compileMemoryToFileContent(
'xml');
348 $this->export->dontCompress = 1;
351 $out = $this->export->compileMemoryToFileContent();
352 $fExt = ($this->export->doOutputCompress() ?
'-z' :
'') .
'.t3d';
355 $dlFile = $inData[
'filename'];
357 $exportName = substr(preg_replace(
'/[^[:alnum:]_]/',
'-', $inData[
'download_export_name']), 0, 20);
358 $dlFile =
'T3D_' . $exportName .
'_' . date(
'Y-m-d_H-i') . $fExt;
362 if ($inData[
'download_export']) {
363 $mimeType =
'application/octet-stream';
364 Header(
'Content-Type: ' . $mimeType);
365 Header(
'Content-Length: ' . strlen($out));
366 Header(
'Content-Disposition: attachment; filename=' . basename($dlFile));
371 if ($inData[
'save_export']) {
373 if ($saveFolder !== FALSE && $saveFolder->checkActionPermission(
'write')) {
375 file_put_contents($temporaryFileName, $out);
376 $file = $saveFolder->addFile($temporaryFileName, $dlFile,
'replace');
378 $this->content .= $this->doc->section(
$GLOBALS[
'LANG']->getLL(
'exportdata_savedFile'), sprintf(
$GLOBALS[
'LANG']->getLL(
'exportdata_savedInSBytes', TRUE), $file->getPublicUrl(),
GeneralUtility::formatSize(strlen($out))), 0, 1);
380 $this->content .= $this->doc->section(
$GLOBALS[
'LANG']->getLL(
'exportdata_problemsSavingFile'), sprintf(
$GLOBALS[
'LANG']->getLL(
'exportdata_badPathS', TRUE), $this->getTemporaryFolderPath()), 0, 1, 2);
386 $menuItems = array();
390 $menuItems[] = array(
391 'label' => $this->lang->getLL(
'tableselec_configuration'),
393 <table border="0" cellpadding="1" cellspacing="1"> 402 $menuItems[] = array(
403 'label' => $this->lang->getLL(
'exportdata_filePreset'),
405 <table border="0" cellpadding="1" cellspacing="1"> 414 $menuItems[] = array(
415 'label' => $this->lang->getLL(
'exportdata_advancedOptions'),
417 <table border="0" cellpadding="1" cellspacing="1"> 424 $overViewContent = $this->export->displayContentOverview();
426 $errors = $this->export->printErrorLog();
427 $menuItems[] = array(
428 'label' => $this->lang->getLL(
'exportdata_messages'),
429 'content' => $errors,
430 'stateIcon' => $errors ? 2 : 0
433 $content = $this->doc->getDynTabMenu($menuItems,
'tx_impexp_export', -1);
434 $content .=
'<input type="hidden" name="tx_impexp[action]" value="export" />';
435 $this->content .= $this->doc->section(
'', $content, 0, 1);
437 $this->content .= $this->doc->section($this->lang->getLL(
'execlistqu_structureToBeExported'), $overViewContent, 0, 1);
450 if (!is_array($tables)) {
454 foreach (
$GLOBALS[
'TCA'] as $table => $value) {
455 if ($table !=
'pages' && (in_array($table, $tables) || in_array(
'_ALL', $tables))) {
456 if ($this->
getBackendUser()->check(
'tables_select', $table) && !
$GLOBALS[
'TCA'][$table][
'ctrl'][
'is_static']) {
458 while ($subTrow = $db->sql_fetch_assoc($res)) {
459 $this->export->export_addRecord($table, $subTrow);
461 $db->sql_free_result($res);
478 $orderBy =
$GLOBALS[
'TCA'][$table][
'ctrl'][
'sortby']
479 ?
'ORDER BY ' .
$GLOBALS[
'TCA'][$table][
'ctrl'][
'sortby']
480 :
$GLOBALS[
'TCA'][$table][
'ctrl'][
'default_sortby'];
481 $res = $db->exec_SELECTquery(
486 $db->stripOrderBy($orderBy),
490 if ($db->sql_num_rows($res) == $limit) {
491 $limitWarning = sprintf($this->lang->getLL(
'makeconfig_anSqlQueryReturned', TRUE), $limit);
492 $this->content .= $this->doc->section($this->lang->getLL(
'execlistqu_maxNumberLimit'), $limitWarning, 0, 1, 2);
506 $nameSuggestion =
'';
508 if (isset($inData[
'pagetree'][
'id'])) {
509 $nameSuggestion .=
'tree_PID' . $inData[
'pagetree'][
'id'] .
'_L' . $inData[
'pagetree'][
'levels'];
511 <tr class="tableheader bgColor5"> 512 <td colspan="2">' . $this->lang->getLL(
'makeconfig_exportPagetreeConfiguration', TRUE)
516 <tr class="bgColor4"> 517 <td><strong>' . $this->lang->getLL(
'makeconfig_pageId', TRUE) .
'</strong></td> 518 <td>' . htmlspecialchars($inData[
'pagetree'][
'id']) .
'<input type="hidden" value="' 519 . htmlspecialchars($inData[
'pagetree'][
'id']) .
'" name="tx_impexp[pagetree][id]" /></td> 522 <tr class="bgColor4"> 523 <td><strong>' . $this->lang->getLL(
'makeconfig_tree', TRUE) .
'</strong>' 525 <td>' . ($this->treeHTML ?: $this->lang->getLL(
'makeconfig_noTreeExportedOnly', TRUE)) .
'</td> 528 '-2' => $this->lang->getLL(
'makeconfig_tablesOnThisPage'),
529 '-1' => $this->lang->getLL(
'makeconfig_expandedTree'),
530 '0' => $this->lang->getLL(
'makeconfig_onlyThisPage'),
531 '1' => $this->lang->getLL(
'makeconfig_1Level'),
532 '2' => $this->lang->getLL(
'makeconfig_2Levels'),
533 '3' => $this->lang->getLL(
'makeconfig_3Levels'),
534 '4' => $this->lang->getLL(
'makeconfig_4Levels'),
535 '999' => $this->lang->getLL(
'makeconfig_infinite')
538 <tr class="bgColor4"> 539 <td><strong>' . $this->lang->getLL(
'makeconfig_levels', TRUE) .
'</strong>' 541 <td>' . $this->
renderSelectBox(
'tx_impexp[pagetree][levels]', $inData[
'pagetree'][
'levels'], $opt) .
'</td> 544 <tr class="bgColor4"> 545 <td><strong>' . $this->lang->getLL(
'makeconfig_includeTables', TRUE) .
'</strong>' 547 <td>' . $this->
tableSelector(
'tx_impexp[pagetree][tables]', $inData[
'pagetree'][
'tables'],
'pages') .
'<br/> 548 ' . $this->lang->getLL(
'makeconfig_maxNumberOfRecords', TRUE) .
'<br/> 549 <input type="text" name="tx_impexp[pagetree][maxNumber]" value="' 550 . htmlspecialchars($inData[
'pagetree'][
'maxNumber']) .
'"' . $this->doc->formWidth(10) .
' /><br/> 555 if (is_array($inData[
'record'])) {
557 <tr class="tableheader bgColor5"> 558 <td colspan="2">' . $this->lang->getLL(
'makeconfig_exportSingleRecord', TRUE)
561 foreach ($inData[
'record'] as $ref) {
562 $rParts = explode(
':', $ref);
565 $nameSuggestion .= $tName .
'_' . $rUid;
569 <tr class="bgColor4"> 570 <td><strong>' . $this->lang->getLL(
'makeconfig_record', TRUE) .
'</strong></td> 572 .
'<input type="hidden" name="tx_impexp[record][]" value="' . htmlspecialchars(($tName .
':' . $rUid)) .
'" /></td> 578 if (is_array($inData[
'list'])) {
580 <tr class="tableheader bgColor5"> 581 <td colspan="2">' . $this->lang->getLL(
'makeconfig_exportTablesFromPages', TRUE) .
'</td> 585 foreach ($inData[
'list'] as $reference) {
586 $referenceParts = explode(
':', $reference);
587 $tableName = $referenceParts[0];
588 if ($this->
getBackendUser()->check(
'tables_select', $tableName)) {
591 if ($referenceParts[1] ===
'0') {
598 $tblList .=
'Table "' . $tableName .
'" from ' . $iconAndTitle
599 .
'<input type="hidden" name="tx_impexp[list][]" value="' . htmlspecialchars($reference) .
'" /><br/>';
603 <tr class="bgColor4"> 604 <td><strong>' . $this->lang->getLL(
'makeconfig_tablePids', TRUE) .
'</strong>' 606 <td>' . $tblList .
'</td> 609 <tr class="bgColor4"> 610 <td><strong>' . $this->lang->getLL(
'makeconfig_maxNumberOfRecords', TRUE)
613 <input type="text" name="tx_impexp[listCfg][maxNumber]" value="' 614 . htmlspecialchars($inData[
'listCfg'][
'maxNumber']) .
'"' . $this->doc->formWidth(10) .
' /><br/> 619 <tr class="tableheader bgColor5"> 620 <td colspan="2">' . $this->lang->getLL(
'makeconfig_relationsAndExclusions', TRUE) .
'</td> 624 <tr class="bgColor4"> 625 <td><strong>' . $this->lang->getLL(
'makeconfig_includeRelationsToTables', TRUE) .
'</strong>' 627 <td>' . $this->
tableSelector(
'tx_impexp[external_ref][tables]', $inData[
'external_ref'][
'tables']) .
'</td> 631 <tr class="bgColor4"> 632 <td><strong>' . $this->lang->getLL(
'makeconfig_useStaticRelationsFor', TRUE) .
'</strong>' 634 <td>' . $this->
tableSelector(
'tx_impexp[external_static][tables]', $inData[
'external_static'][
'tables']) .
'<br/> 635 <label for="checkShowStaticRelations">' . $this->lang->getLL(
'makeconfig_showStaticRelations', TRUE)
636 .
'</label> <input type="checkbox" name="tx_impexp[showStaticRelations]" id="checkShowStaticRelations" value="1"' 637 . ($inData[
'showStaticRelations'] ?
' checked="checked"' :
'') .
' /> 641 $excludeHiddenFields =
'';
642 if (is_array($inData[
'exclude'])) {
643 foreach ($inData[
'exclude'] as $key => $value) {
644 $excludeHiddenFields .=
'<input type="hidden" name="tx_impexp[exclude][' . $key .
']" value="1" />';
647 if (count($inData[
'exclude'])) {
648 $excludedElements =
'<em>' . implode(
', ', array_keys($inData[
'exclude'])).
'</em><hr/><label for="checkExclude">' 649 . $this->lang->getLL(
'makeconfig_clearAllExclusions', TRUE)
650 .
'</label> <input type="checkbox" name="tx_impexp[exclude]" id="checkExclude" value="1" />';
652 $excludedElements = $this->lang->getLL(
'makeconfig_noExcludedElementsYet', TRUE);
655 <tr class="bgColor4"> 656 <td><strong>' . $this->lang->getLL(
'makeconfig_excludeElements', TRUE) .
'</strong>' 658 <td>' . $excludeHiddenFields .
' 659 ' . $excludedElements .
' 664 <tr class="bgColor4"> 667 <input type="submit" value="' . $this->lang->getLL(
'makeadvanc_update', TRUE) .
'" /> 668 <input type="hidden" name="tx_impexp[download_export_name]" value="' . substr($nameSuggestion, 0, 30) .
'" /> 684 <tr class="tableheader bgColor5"> 685 <td colspan="2">' . $this->lang->getLL(
'makeadvanc_softReferences', TRUE) .
'</td> 688 <tr class="bgColor4"> 689 <td><label for="checkExcludeHTMLfileResources"><strong>' 690 . $this->lang->getLL(
'makeadvanc_excludeHtmlCssFile', TRUE) .
'</strong></label>' 692 <td><input type="checkbox" name="tx_impexp[excludeHTMLfileResources]" id="checkExcludeHTMLfileResources" value="1"' 693 . ($inData[
'excludeHTMLfileResources'] ?
' checked="checked"' :
'') .
' /></td> 697 <tr class="tableheader bgColor5"> 698 <td colspan="2">' . $this->lang->getLL(
'makeadvanc_extensionDependencies', TRUE) .
'</td> 701 <tr class="bgColor4"> 702 <td><strong>' . $this->lang->getLL(
'makeadvanc_selectExtensionsThatThe', TRUE) .
'</strong>' 704 <td>' . $this->
extensionSelector(
'tx_impexp[extension_dep]', $inData[
'extension_dep']) .
'</td> 708 <tr class="bgColor4"> 711 <input type="submit" value="' . $this->lang->getLL(
'makesavefo_update', TRUE) .
'" /> 712 <input type="hidden" name="tx_impexp[download_export_name]" value="" /> 728 <tr class="tableheader bgColor5"> 729 <td colspan="2">' . $this->lang->getLL(
'makesavefo_presets', TRUE) .
'</td> 732 $where =
'(public>0 OR user_uid=' . (int)$this->
getBackendUser()->user[
'uid'] .
')' 733 . ($inData[
'pagetree'][
'id'] ?
' AND (item_uid=' . (int)$inData[
'pagetree'][
'id'] .
' OR item_uid=0)' :
'');
735 if (is_array($presets)) {
736 foreach ($presets as $presetCfg) {
737 $opt[$presetCfg[
'uid']] = $presetCfg[
'title'] .
' [' . $presetCfg[
'uid'] .
']' 738 . ($presetCfg[
'public'] ?
' [Public]' :
'')
739 . ($presetCfg[
'user_uid'] === $this->
getBackendUser()->user[
'uid'] ?
' [Own]' :
'');
743 <tr class="bgColor4"> 744 <td><strong>' . $this->lang->getLL(
'makesavefo_presets', TRUE) .
'</strong>' 747 ' . $this->lang->getLL(
'makesavefo_selectPreset', TRUE) .
'<br/> 750 <input type="submit" value="' . $this->lang->getLL(
'makesavefo_load', TRUE) .
'" name="preset[load]" /> 751 <input type="submit" value="' . $this->lang->getLL(
'makesavefo_save', TRUE) .
'" name="preset[save]" onclick="return confirm(\'' . $this->lang->getLL(
'makesavefo_areYouSure', TRUE) .
'\');
" /> 752 <input type="submit
" value="' . $this->lang->getLL('makesavefo_delete
', TRUE) . '" name="preset[
delete]
" onclick="return confirm(\
'' . $this->lang->getLL(
'makesavefo_areYouSure', TRUE) .
'\');
" /> 753 <input type="submit
" value="' . $this->lang->getLL('makesavefo_merge
', TRUE) . '" name="preset[merge]
" onclick="return confirm(\
'' . $this->lang->getLL(
'makesavefo_areYouSure', TRUE) .
'\');
" /> 755 ' . $this->lang->getLL('makesavefo_titleOfNewPreset', TRUE) . ' 756 <input type="text
" name="tx_impexp[preset][title]
" value="' 757 . htmlspecialchars($inData['preset
']['title
']) . '"' . $this->doc->formWidth(30) . ' /><br/> 758 <label for="checkPresetPublic
">' . $this->lang->getLL('makesavefo_public', TRUE) . '</label> 759 <input type="checkbox
" name="tx_impexp[preset][
public]
" id="checkPresetPublic
" value="1
"' 760 . ($inData['preset']['public'] ? ' checked="checked
"' : '') . ' /><br/> 765 <tr class="tableheader bgColor5
"> 766 <td colspan="2
">' . $this->lang->getLL('makesavefo_outputOptions', TRUE) . '</td> 769 $thumbnailFiles = array(); 770 foreach ($this->getThumbnailFiles() as $thumbnailFile) { 771 $thumbnailFiles[$thumbnailFile->getCombinedIdentifier()] = $thumbnailFile->getName(); 773 if (!empty($thumbnailFiles)) { 774 array_unshift($thumbnailFiles, ''); 777 if (!empty($inData['meta']['thumbnail'])) { 778 $thumbnail = $this->getFile($inData['meta']['thumbnail']); 780 $saveFolder = $this->getDefaultImportExportFolder(); 783 <tr class="bgColor4
"> 784 <td><strong>' . $this->lang->getLL('makesavefo_metaData', TRUE) . '</strong>' 785 . BackendUtility::cshItem('xMOD_tx_impexp', 'metadata', $GLOBALS['BACK_PATH'], '') . '</td> 787 ' . $this->lang->getLL('makesavefo_title', TRUE) . ' <br/> 788 <input type="text
" name="tx_impexp[meta][title]
" value="' . htmlspecialchars($inData['meta
']['title
']) . '"' . $this->doc->formWidth(30) . ' /><br/> 789 ' . $this->lang->getLL('makesavefo_description', TRUE) . ' <br/> 790 <input type="text
" name="tx_impexp[meta][description]
" value="' . htmlspecialchars($inData['meta
']['description
']) . '"' . $this->doc->formWidth(30) . ' /><br/> 791 ' . $this->lang->getLL('makesavefo_notes', TRUE) . ' <br/> 792 <textarea name="tx_impexp[meta][notes]
"' . $this->doc->formWidth(30, 1) . '>' . GeneralUtility::formatForTextarea($inData['meta']['notes']) . '</textarea><br/> 793 ' . (!empty($thumbnailFiles) ? ' 794 ' . $this->lang->getLL('makesavefo_thumbnail', TRUE) . '<br/> 795 ' . $this->renderSelectBox('tx_impexp[meta][thumbnail]', $inData['meta']['thumbnail'], $thumbnailFiles) : '') . '<br/> 796 ' . ($thumbnail ? '<img src="' . htmlspecialchars($thumbnail->getPublicUrl(TRUE)) . '" vspace="5
" style="border: solid black 1px;
" alt="" /><br/>' : '') . ' 797 ' . $this->lang->getLL('makesavefo_uploadThumbnail', TRUE) . '<br/> 798 ' . ($saveFolder ? '<input type="file
" name="upload_1
" ' . $this->doc->formWidth(30) . ' size="30
" /><br/> 799 <input type="hidden
" name="file[upload][1][target]
" value="' . htmlspecialchars($saveFolder->getCombinedIdentifier()) . '" /> 800 <input type="hidden
" name="file[upload][1][data]
" value="1
" /><br />' : '') . ' 805 if ($this->export->compress) { 806 $opt['t3d_compressed'] = $this->lang->getLL('makesavefo_t3dFileCompressed'); 808 $opt['t3d'] = $this->lang->getLL('makesavefo_t3dFile'); 809 $opt['xml'] = $this->lang->getLL('makesavefo_xml'); 812 $fileName = sprintf($this->lang->getLL('makesavefo_filenameSavedInS', TRUE), $saveFolder->getCombinedIdentifier()) 814 <input type="text
" name="tx_impexp[filename]
" value="' 815 . htmlspecialchars($inData['filename
']) . '"' . $this->doc->formWidth(30) . ' /><br/>'; 818 <tr class="bgColor4
"> 819 <td><strong>' . $this->lang->getLL('makesavefo_fileFormat', TRUE) . '</strong>' 820 . BackendUtility::cshItem('xMOD_tx_impexp', 'fileFormat', $GLOBALS['BACK_PATH'], '') . '</td> 821 <td>' . $this->renderSelectBox('tx_impexp[filetype]', $inData['filetype'], $opt) . '<br/> 822 ' . $this->lang->getLL('makesavefo_maxSizeOfFiles', TRUE) . '<br/> 823 <input type="text
" name="tx_impexp[maxFileSize]
" value="' 824 . htmlspecialchars($inData['maxFileSize
']) . '"' . $this->doc->formWidth(10) . ' /><br/> 830 <tr class="bgColor4
"> 832 <td><input type="submit
" value="' . $this->lang->getLL('makesavefo_update
', TRUE) 833 . '" /> - <input type="submit
" value="' . $this->lang->getLL('makesavefo_downloadExport
', TRUE) 834 . '" name="tx_impexp[download_export]
" />' . ($saveFolder ? ' - <input type="submit
" value="' 835 . $this->lang->getLL('importdata_saveToFilename
', TRUE) . '" name="tx_impexp[save_export]
" />' : '') . '</td> 839 /************************** 841 **************************/ 850 public function importData($inData) { 851 $access = is_array($this->pageinfo) ? 1 : 0; 852 $beUser = $this->getBackendUser(); 853 if ($this->id && $access || $beUser->user['admin'] && !$this->id) { 854 if ($beUser->user['admin'] && !$this->id) { 855 $this->pageinfo = array('title' => '[root-level]', 'uid' => 0, 'pid' => 0); 857 if ($inData['new_import']) { 858 unset($inData['import_mode']); 861 $import = GeneralUtility::makeInstance('TYPO3\\CMS\\Impexp\\ImportExport'); 862 $import->init(0, 'import'); 863 $import->update = $inData['do_update']; 864 $import->import_mode = $inData['import_mode']; 865 $import->enableLogging = $inData['enableLogging']; 866 $import->global_ignore_pid = $inData['global_ignore_pid']; 867 $import->force_all_UIDS = $inData['force_all_UIDS']; 868 $import->showDiff = !$inData['notShowDiff']; 869 $import->allowPHPScripts = $inData['allowPHPScripts']; 870 $import->softrefInputValues = $inData['softrefInputValues']; 872 $menuItems = array(); 873 // Make input selector: 874 // must have trailing slash. 875 $path = $this->getDefaultImportExportFolder(); 876 $exportFiles = $this->getExportFiles(); 879 $selectOptions = array(''); 880 foreach ($exportFiles as $file) { 881 $selectOptions[$file->getCombinedIdentifier()] = $file->getPublicUrl(); 883 $row[] = '<tr class="bgColor5
"> 884 <td colspan="2
"><strong>' . $this->lang->getLL('importdata_selectFileToImport', TRUE) . '</strong></td> 886 $noCompressorAvailable = !$import->compress 887 ? '<br /><span class="typo3-red
">' . $this->lang->getLL('importdata_noteNoDecompressorAvailable', TRUE) . '</span>' 889 $row[] = '<tr class="bgColor4
"> 890 <td><strong>' . $this->lang->getLL('importdata_file', TRUE) . '</strong>' 891 . BackendUtility::cshItem('xMOD_tx_impexp', 'importFile', $GLOBALS['BACK_PATH'], '') . '</td> 892 <td>' . $this->renderSelectBox('tx_impexp[file]', $inData['file'], $selectOptions) . '<br />' 893 . sprintf($this->lang->getLL('importdata_fromPathS', TRUE), $path ? $path->getCombinedIdentifier() : $this->lang->getLL('importdata_no_accessible_file_mount', TRUE)) . 894 $noCompressorAvailable . '</td> 896 $row[] = '<tr class="bgColor5
"> 897 <td colspan="2
"><strong>' . $this->lang->getLL('importdata_importOptions', TRUE) . '</strong></td> 899 $row[] = '<tr class="bgColor4
"> 900 <td><strong>' . $this->lang->getLL('importdata_update', TRUE) . '</strong>' 901 . BackendUtility::cshItem('xMOD_tx_impexp', 'update', $GLOBALS['BACK_PATH'], '') . '</td> 903 <input type="checkbox
" name="tx_impexp[do_update]
" id="checkDo_update
" value="1
"' 904 . ($inData['do_update'] ? ' checked="checked
"' : '') . ' /> 905 <label for="checkDo_update
">' . $this->lang->getLL('importdata_updateRecords', TRUE) . '</label><br/> 906 <em>(' . $this->lang->getLL('importdata_thisOptionRequiresThat', TRUE) . ')</em>' . ($inData['do_update'] ? ' <hr/> 907 <input type="checkbox
" name="tx_impexp[global_ignore_pid]
" id="checkGlobal_ignore_pid
" value="1
"' 908 . ($inData['global_ignore_pid'] ? ' checked="checked
"' : '') . ' /> 909 <label for="checkGlobal_ignore_pid
">' . $this->lang->getLL('importdata_ignorePidDifferencesGlobally', TRUE) . '</label><br/> 910 <em>(' . $this->lang->getLL('importdata_ifYouSetThis', TRUE) . ')</em> 913 $allowPhpScripts = $beUser->isAdmin() 915 <input type="checkbox
" name="tx_impexp[allowPHPScripts]
" id="checkAllowPHPScripts
" value="1
"' 916 . ($inData['allowPHPScripts'] ? ' checked="checked
"' : '') . ' /> 917 <label for="checkAllowPHPScripts
">' . $this->lang->getLL('importdata_allowToWriteBanned', TRUE) . '</label><br/>' 919 $doUpdate = !$inData['do_update'] && $beUser->isAdmin() 922 <input type="checkbox
" name="tx_impexp[force_all_UIDS]
" id="checkForce_all_UIDS
" value="1
"' 923 . ($inData['force_all_UIDS'] ? ' checked="checked
"' : '') . ' /> 924 <label for="checkForce_all_UIDS
"><span class="typo3-red
">' 925 . $this->lang->getLL('importdata_force_all_UIDS', TRUE) . '</span></label><br/> 926 <em>(' . $this->lang->getLL('importdata_force_all_UIDS_descr', TRUE) . ')</em>' 928 $row[] = '<tr class="bgColor4
"> 929 <td><strong>' . $this->lang->getLL('importdata_options', TRUE) . '</strong>' 930 . BackendUtility::cshItem('xMOD_tx_impexp', 'options', $GLOBALS['BACK_PATH'], '') . '</td> 932 <input type="checkbox
" name="tx_impexp[notShowDiff]
" id="checkNotShowDiff
" value="1
"' 933 . ($inData['notShowDiff'] ? ' checked="checked
"' : '') . ' /> 934 <label for="checkNotShowDiff
">' . $this->lang->getLL('importdata_doNotShowDifferences', TRUE) . '</label><br/> 935 <em>(' . $this->lang->getLL('importdata_greenValuesAreFrom', TRUE) . ')</em> 938 ' . $allowPhpScripts . $doUpdate . ' 941 $newImport = !$inData['import_file'] 942 ? '<input type="submit
" value="' . $this->lang->getLL('importdata_preview
', TRUE) . '" />' . ($inData['file'] 943 ? ' - <input type="submit
" value="' . ($inData['do_update
'] 944 ? $this->lang->getLL('importdata_update_299e
', TRUE) 945 : $this->lang->getLL('importdata_import
', TRUE)) . '" name="tx_impexp[import_file]
" onclick="return confirm(\
'' 946 . $this->lang->getLL(
'importdata_areYouSure', TRUE) .
'\');
" />' 948 : '<input type="submit
" name="tx_impexp[new_import]
" value="' . $this->lang->getLL('importdata_newImport
', TRUE) . '" />'; 949 $row[] = '<tr class="bgColor4
"> 950 <td><strong>' . $this->lang->getLL('importdata_action', TRUE) . '</strong>' 951 . BackendUtility::cshItem('xMOD_tx_impexp', 'action', $GLOBALS['BACK_PATH'], '') . '</td> 952 <td>' . $newImport . ' 953 <input type="hidden
" name="tx_impexp[action]
" value="import" /></td> 955 $row[] = '<tr class="bgColor4
"> 956 <td><strong>' . $this->lang->getLL('importdata_enableLogging', TRUE) . '</strong>' 957 . BackendUtility::cshItem('xMOD_tx_impexp', 'enableLogging', $GLOBALS['BACK_PATH'], '') . '</td> 959 <input type="checkbox
" name="tx_impexp[enableLogging]
" id="checkEnableLogging
" value="1
"' 960 . ($inData['enableLogging'] ? ' checked="checked
"' : '') . ' /> 961 <label for="checkEnableLogging
">' . $this->lang->getLL('importdata_writeIndividualDbActions', TRUE) . '</label><br/> 962 <em>(' . $this->lang->getLL('importdata_thisIsDisabledBy', TRUE) . ')</em> 965 $menuItems[] = array( 966 'label' => $this->lang->getLL('importdata_import', TRUE), 968 <table border="0
" cellpadding="1
" cellspacing="1
"> 975 $tempFolder = $this->getDefaultImportExportFolder(); 978 $row[] = '<tr class="bgColor5
"> 979 <td colspan="2
"><strong>' . $this->lang->getLL('importdata_uploadFileFromLocal', TRUE) . '</strong></td> 981 $row[] = '<tr class="bgColor4
"> 982 <td>' . $this->lang->getLL('importdata_browse', TRUE) 983 . BackendUtility::cshItem('xMOD_tx_impexp', 'upload', $GLOBALS['BACK_PATH'], '') . '</td> 986 <input type="file
" name="upload_1
"' . $this->doc->formWidth(35) . ' size="40
" /> 987 <input type="hidden
" name="file[upload][1][target]
" value="' . htmlspecialchars($tempFolder->getCombinedIdentifier()) . '" /> 988 <input type="hidden
" name="file[upload][1][data]
" value="1
" /><br /> 990 <input type="submit
" name="_upload
" value="' . $this->lang->sL('LLL:EXT:lang/locallang_core.xlf:file_upload.php.submit
', TRUE) . '" /> 991 <input type="checkbox
" name="overwriteExistingFiles
" id="checkOverwriteExistingFiles
" value="1
" checked="checked
" /> <label for="checkOverwriteExistingFiles
">' 992 . $this->lang->sL('LLL:EXT:lang/locallang_misc.xlf:overwriteExistingFiles', TRUE) . '</label> 995 if (GeneralUtility::_POST('_upload')) { 996 $noFileUploaded = $this->fileProcessor->internalUploadMap[1] 997 ? $this->lang->getLL('importdata_success', TRUE) . ' ' . $this->uploadedFiles[0]->getName() 998 : '<span class="typo3-red
">' . $this->lang->getLL('importdata_failureNoFileUploaded', TRUE) . '</span>'; 999 $row[] = '<tr class="bgColor4
"> 1000 <td>' . $this->lang->getLL('importdata_uploadStatus', TRUE) . '</td> 1001 <td>' . $noFileUploaded . '</td> 1004 $menuItems[] = array( 1005 'label' => $this->lang->getLL('importdata_upload'), 1007 <table border="0
" cellpadding="1
" cellspacing="1
"> 1014 // Perform import or preview depending: 1015 $overviewContent = ''; 1016 $extensionInstallationMessage = ''; 1017 $inFile = $this->getFile($inData['file']); 1018 if ($inFile !== NULL && $inFile->exists()) { 1020 if ($import->loadFile($inFile->getForLocalProcessing(FALSE), 1)) { 1021 // Check extension dependencies: 1022 $extKeysToInstall = array(); 1023 if (is_array($import->dat['header']['extensionDependencies'])) { 1024 foreach ($import->dat['header']['extensionDependencies'] as $extKey) { 1025 if (!empty($extKey) && !\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($extKey)) { 1026 $extKeysToInstall[] = $extKey; 1030 if (count($extKeysToInstall)) { 1031 $extensionInstallationMessage = 'Before you can install this T3D file you need to install the extensions "' 1032 . implode('", "', $extKeysToInstall) . '".'; 1034 if ($inData['import_file']) { 1035 if (!count($extKeysToInstall)) { 1036 $import->importData($this->id); 1037 BackendUtility::setUpdateSignal('updatePageTree'); 1040 $import->display_import_pid_record = $this->pageinfo; 1041 $overviewContent = $import->displayContentOverview(); 1043 // Meta data output: 1044 $trow[] = '<tr class="bgColor5
"> 1045 <td colspan="2
"><strong>' . $this->lang->getLL('importdata_metaData', TRUE) . '</strong></td> 1047 $trow[] = '<tr class="bgColor4
"> 1048 <td><strong>' . $this->lang->getLL('importdata_title', TRUE) . '</strong></td> 1049 <td width="95%
">' . nl2br(htmlspecialchars($import->dat['header']['meta']['title'])) . '</td> 1051 $trow[] = '<tr class="bgColor4
"> 1052 <td><strong>' . $this->lang->getLL('importdata_description', TRUE) . '</strong></td> 1053 <td width="95%
">' . nl2br(htmlspecialchars($import->dat['header']['meta']['description'])) . '</td> 1055 $trow[] = '<tr class="bgColor4
"> 1056 <td><strong>' . $this->lang->getLL('importdata_notes', TRUE) . '</strong></td> 1057 <td width="95%
">' . nl2br(htmlspecialchars($import->dat['header']['meta']['notes'])) . '</td> 1059 $trow[] = '<tr class="bgColor4
"> 1060 <td><strong>' . $this->lang->getLL('importdata_packager', TRUE) . '</strong></td> 1061 <td width="95%
">' . nl2br(htmlspecialchars(($import->dat['header']['meta']['packager_name'] 1062 . ' (' . $import->dat['header']['meta']['packager_username'] . ')'))) . '<br/> 1063 ' . $this->lang->getLL('importdata_email', TRUE) . ' ' 1064 . $import->dat['header']['meta']['packager_email'] . '</td> 1067 if (is_array($import->dat['header']['thumbnail'])) { 1068 $pI = pathinfo($import->dat['header']['thumbnail']['filename']); 1069 if (GeneralUtility::inList('gif,jpg,png,jpeg', strtolower($pI['extension']))) { 1070 // Construct filename and write it: 1071 $fileName = PATH_site . 'typo3temp/importthumb.' . $pI['extension']; 1072 GeneralUtility::writeFile($fileName, $import->dat['header']['thumbnail']['content']); 1073 // Check that the image really is an image and not a malicious PHP script... 1074 if (getimagesize($fileName)) { 1076 $iconTag = '<img src="' . $this->doc->backPath . '../
' . PathUtility::stripPathSitePrefix($fileName) 1077 . '" ' . $import->dat['header']['thumbnail']['imgInfo'][3] 1078 . ' vspace="5
" style="border: solid black 1px;
" alt="" />'; 1079 $trow[] = '<tr class="bgColor4
"> 1080 <td><strong>' . $this->lang->getLL('importdata_icon', TRUE) . '</strong></td> 1081 <td>' . $iconTag . '</td> 1084 GeneralUtility::unlink_tempfile($fileName); 1088 $menuItems[] = array( 1089 'label' => $this->lang->getLL('importdata_metaData_1387'), 1091 <table border="0
" cellpadding="1
" cellspacing="1
"> 1098 // Print errors that might be: 1099 $errors = $import->printErrorLog(); 1100 $menuItems[] = array( 1101 'label' => $this->lang->getLL('importdata_messages'), 1102 'content' => $errors, 1103 'stateIcon' => $errors ? 2 : 0 1106 $content = $this->doc->getDynTabMenu($menuItems, 'tx_impexp_import', -1); 1107 if ($extensionInstallationMessage) { 1108 $content = '<div style="border: 1px black solid; margin: 10px 10px 10px 10px; padding: 10px 10px 10px 10px;
">' 1109 . $this->doc->icons(1) . htmlspecialchars($extensionInstallationMessage) . '</div>' . $content; 1111 $this->content .= $this->doc->section('', $content, 0, 1); 1113 if ($overviewContent) { 1114 $this->content .= $this->doc->section($inData['import_file'] 1115 ? $this->lang->getLL('importdata_structureHasBeenImported', TRUE) 1116 : $this->lang->getLL('filterpage_structureToBeImported', TRUE), $overviewContent, 0, 1); 1121 /**************************** 1123 ****************************/ 1132 public function processPresets(&$inData) { 1133 $presetData = GeneralUtility::_GP('preset'); 1137 $beUser = $this->getBackendUser(); 1138 // cast public checkbox to int, since this is a int field and NULL is not allowed 1139 $inData['preset']['public'] = (int)$inData['preset']['public']; 1140 if (isset($presetData['save'])) { 1141 $preset = $this->getPreset($presetData['select']); 1143 if (is_array($preset)) { 1144 if ($beUser->isAdmin() || $preset['user_uid'] === $beUser->user['uid']) { 1145 $fields_values = array( 1146 'public' => $inData['preset']['public'], 1147 'title' => $inData['preset']['title'], 1148 'item_uid' => $inData['pagetree']['id'], 1149 'preset_data' => serialize($inData) 1151 $this->getDatabaseConnection()->exec_UPDATEquery('tx_impexp_presets', 'uid=' . (int)$preset['uid'], $fields_values); 1152 $msg = 'Preset #' . $preset['uid'] . ' saved!'; 1154 $msg = 'ERROR: The preset was not saved because you were not the owner of it!'; 1159 $fields_values = array( 1160 'user_uid' => $beUser->user['uid'], 1161 'public' => $inData['preset']['public'], 1162 'title' => $inData['preset']['title'], 1163 'item_uid' => $inData['pagetree']['id'], 1164 'preset_data' => serialize($inData) 1166 $this->getDatabaseConnection()->exec_INSERTquery('tx_impexp_presets', $fields_values); 1167 $msg = 'New preset "' . htmlspecialchars($inData['preset
']['title
']) . '" is created'; 1171 if (isset($presetData['delete'])) { 1172 $preset = $this->getPreset($presetData['select']); 1173 if (is_array($preset)) { 1175 if ($beUser->isAdmin() || $preset['user_uid'] === $beUser->user['uid']) { 1176 $this->getDatabaseConnection()->exec_DELETEquery('tx_impexp_presets', 'uid=' . (int)$preset['uid']); 1177 $msg = 'Preset #' . $preset['uid'] . ' deleted!'; 1179 $msg = 'ERROR: You were not the owner of the preset so you could not delete it.'; 1183 $msg = 'ERROR: No preset selected for deletion.'; 1188 if (isset($presetData['load']) || isset($presetData['merge'])) { 1189 $preset = $this->getPreset($presetData['select']); 1190 if (is_array($preset)) { 1192 $inData_temp = unserialize($preset['preset_data']); 1193 if (is_array($inData_temp)) { 1194 if (isset($presetData['merge'])) { 1195 // Merge records in: 1196 if (is_array($inData_temp['record'])) { 1197 $inData['record'] = array_merge((array) $inData['record'], $inData_temp['record']); 1200 if (is_array($inData_temp['list'])) { 1201 $inData['list'] = array_merge((array) $inData['list'], $inData_temp['list']); 1204 $msg = 'Preset #' . $preset['uid'] . ' loaded!'; 1205 $inData = $inData_temp; 1208 $msg = 'ERROR: No configuratio data found in preset record!'; 1212 $msg = 'ERROR: No preset selected for loading.'; 1218 $this->content .= $this->doc->section('Presets', $msg, 0, 1, $err ? 3 : 1); 1229 public function getPreset($uid) { 1230 return $this->getDatabaseConnection()->exec_SELECTgetSingleRow('*', 'tx_impexp_presets', 'uid=' . (int)$uid); 1233 /**************************** 1235 ****************************/ 1244 public function userTempFolder() { 1245 GeneralUtility::logDeprecatedFunction(); 1246 return $this->getDefaultImportExportFolder()->getPublicUrl(); 1256 public function userSaveFolder() { 1257 GeneralUtility::logDeprecatedFunction(); 1258 return $this->getDefaultImportExportFolder()->getPublicUrl(); 1267 protected function getDefaultImportExportFolder() { 1268 $defaultImportExportFolder = NULL; 1270 $defaultTemporaryFolder = $this->getBackendUser()->getDefaultUploadTemporaryFolder(); 1271 if ($defaultTemporaryFolder !== NULL) { 1273 $importExportFolderName = 'importexport'; 1274 $createFolder = !$defaultTemporaryFolder->hasFolder($importExportFolderName); 1275 if ($createFolder === TRUE) { 1277 $defaultImportExportFolder = $defaultTemporaryFolder->createFolder($importExportFolderName); 1278 } catch (\TYPO3\CMS\Core\Resource\Exception $folderAccessException) {} 1280 $defaultImportExportFolder = $defaultTemporaryFolder->getSubfolder($importExportFolderName); 1284 return $defaultImportExportFolder; 1295 public function checkUpload() { 1296 $file = GeneralUtility::_GP('file'); 1298 $this->fileProcessor = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Utility\\File\\ExtendedFileUtility'); 1299 $this->fileProcessor->init(array(), $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']); 1300 $this->fileProcessor->setActionPermissions(); 1301 $this->fileProcessor->dontCheckForUnique = GeneralUtility::_GP('overwriteExistingFiles') ? 1 : 0; 1302 // Checking referer / executing: 1303 $refInfo = parse_url(GeneralUtility::getIndpEnv('HTTP_REFERER')); 1304 $httpHost = GeneralUtility::getIndpEnv('TYPO3_HOST_ONLY'); 1306 $httpHost != $refInfo['host'] 1307 && !$GLOBALS['$TYPO3_CONF_VARS']['SYS']['doNotCheckReferer'] 1308 && $this->vC != $this->getBackendUser()->veriCode() 1310 $this->fileProcessor->writeLog(0, 2, 1, 'Referer host "%s
" and server host "%s
" did not match!', array($refInfo['host'], $httpHost)); 1312 $this->fileProcessor->start($file); 1313 $result = $this->fileProcessor->processData(); 1314 if (!empty($result['upload'])) { 1315 foreach ($result['upload'] as $uploadedFiles) { 1316 $this->uploadedFiles += $uploadedFiles; 1331 public function renderSelectBox($prefix, $value, $optValues) { 1334 foreach ($optValues as $k => $v) { 1335 $sel = (string)$k === (string)$value ? ' selected="selected
"' : ''; 1339 $opt[] = '<option value="' . htmlspecialchars($k) . '"' . $sel . '>' . htmlspecialchars($v) . '</option>'; 1341 if (!$isSelFlag && (string)$value !== '') { 1342 $opt[] = '<option value="' . htmlspecialchars($value) . '" selected="selected
">' 1343 . htmlspecialchars(('[\'' . $value . '\']')) . '</option>'; 1345 return '<select name="' . $prefix . '">' . implode('', $opt) . '</select>'; 1357 public function tableSelector($prefix, $value, $excludeList = '') { 1358 $optValues = array(); 1359 if (!GeneralUtility::inList($excludeList, '_ALL')) { 1360 $optValues['_ALL'] = '[' . $this->lang->getLL('ALL_tables') . ']'; 1362 foreach ($GLOBALS['TCA'] as $table => $_) { 1363 if ($this->getBackendUser()->check('tables_select', $table) && !GeneralUtility::inList($excludeList, $table)) { 1364 $optValues[$table] = $table; 1369 $opt[] = '<option value=""></option>'; 1371 foreach ($optValues as $k => $v) { 1372 if (is_array($value)) { 1373 $sel = in_array($k, $value) ? ' selected="selected
"' : ''; 1375 $opt[] = '<option value="' . htmlspecialchars($k) . '"' . $sel . '>' . htmlspecialchars($v) . '</option>'; 1377 return '<select name="' . $prefix . '[]
" multiple="multiple
" size="' 1378 . MathUtility::forceIntegerInRange(count($opt), 5, 10) . '">' . implode('', $opt) . '</select>'; 1389 public function extensionSelector($prefix, $value) { 1390 $loadedExtensions = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getLoadedExtensionListArray(); 1394 $opt[] = '<option value=""></option>'; 1395 foreach ($loadedExtensions as $extensionKey) { 1397 if (is_array($value)) { 1398 $sel = in_array($extensionKey, $value) ? ' selected="selected
"' : ''; 1400 $opt[] = '<option value="' . htmlspecialchars($extensionKey) . '"' . $sel . '>' 1401 . htmlspecialchars($extensionKey) . '</option>'; 1403 return '<select name="' . $prefix . '[]
" multiple="multiple
" size="' 1404 . MathUtility::forceIntegerInRange(count($opt), 5, 10) . '">' . implode('', $opt) . '</select>'; 1415 public function filterPageIds($exclude) { 1417 $exclude = array_keys($exclude); 1420 foreach ($exclude as $element) { 1421 list($table, $uid) = explode(':', $element); 1422 if ($table === 'pages') { 1423 $pageIds[] = (int)$uid; 1427 if (count($pageIds)) { 1428 return ' AND uid NOT IN (' . implode(',', $pageIds) . ')'; 1436 protected function getBackendUser() { 1437 return $GLOBALS['BE_USER']; 1443 protected function getDatabaseConnection() { 1444 return $GLOBALS['TYPO3_DB']; 1450 protected function getLanguageService() { 1451 return $GLOBALS['LANG']; 1459 protected function getThumbnailFiles() { 1460 $thumbnailFiles = array(); 1461 $defaultTemporaryFolder = $this->getDefaultImportExportFolder(); 1463 if ($defaultTemporaryFolder === NULL) { 1464 return $thumbnailFiles; 1468 $filter = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\Filter\\FileExtensionFilter'); 1469 $filter->setAllowedFileExtensions(array('png', 'gif', 'jpg')); 1470 $defaultTemporaryFolder->getStorage()->addFileAndFolderNameFilter(array($filter, 'filterFileList')); 1471 $thumbnailFiles = $defaultTemporaryFolder->getFiles(); 1473 return $thumbnailFiles; 1481 protected function getExportFiles() { 1482 $exportFiles = array(); 1484 $folder = $this->getDefaultImportExportFolder(); 1485 if ($folder !== NULL) { 1488 $filter = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\Filter\\FileExtensionFilter'); 1489 $filter->setAllowedFileExtensions(array('t3d', 'xml')); 1490 $folder->getStorage()->addFileAndFolderNameFilter(array($filter, 'filterFileList')); 1492 $exportFiles = $folder->getFiles(); 1495 return $exportFiles; 1504 protected function getFile($combinedIdentifier) { 1506 $file = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->getFileObjectFromCombinedIdentifier($combinedIdentifier); 1507 } catch (\Exception $exception) { 1520 protected function getIndexerService() { 1521 return GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\Service\\IndexerService'); renderSelectBox($prefix, $value, $optValues)
static getRecordWSOL($table, $uid, $fields=' *', $where='', $useDeleteClause=TRUE, $unsetMovePointers=FALSE)
static readPageAccess($id, $perms_clause)
tableSelector($prefix, $value, $excludeList='')
addRecordsForPid($k, $tables, $maxNumber)
static BEgetRootLine($uid, $clause='', $workspaceOL=FALSE)
exec_listQueryPid($table, $pid, $limit)
static forceIntegerInRange($theInt, $min, $max=2000000000, $defaultValue=0)
static cshItem($table, $field, $BACK_PATH, $wrap='', $onlyIconMode=FALSE, $styleAttrib='')
makeAdvancedOptionsForm($inData, &$row)
extensionSelector($prefix, $value)
getDefaultImportExportFolder()
static makeInstance($className)
static viewOnClick($pageUid, $backPath='', $rootLine='', $anchorSection='', $alternativeUrl='', $additionalGetVars='', $switchFocus=TRUE)
static getRecordTitle($table, $row, $prep=FALSE, $forceResult=TRUE)
static getSpriteIconForRecord($table, array $row, array $options=array())
static versioningPlaceholderClause($table)
static tempnam($filePrefix, $fileSuffix='')
getFile($combinedIdentifier)
static getSpriteIcon($iconName, array $options=array(), array $overlays=array())
static formatSize($sizeInBytes, $labels='')
makeConfigurationForm($inData, &$row)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
static inList($list, $item)
makeSaveForm($inData, &$row)
static deleteClause($table, $tableAlias='')