From d91329222357b50fdca3b69640f9b3e5afd70a7e Mon Sep 17 00:00:00 2001 From: Benjamin Kott Date: Wed, 12 Apr 2023 18:02:13 +0200 Subject: [PATCH] [TASK] Cleanup impexp templates - Migrate checkboxes to form-check - Rebuild indention of rows - Add icons to buttons - Add sections to tabs - Add missing input classes Resolves: #100561 Releases: main Change-Id: If1c7fbb62b9541404090ad5cf849e3eba9da9643 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/78596 Tested-by: Christian Kuhn Tested-by: Benni Mack Reviewed-by: Benni Mack Reviewed-by: Christian Kuhn Tested-by: core-ci --- Build/Sources/Sass/backend.scss | 1 + Build/Sources/Sass/component/_indent.scss | 18 + Build/Sources/Sass/component/_modal.scss | 4 - Build/Sources/Sass/component/_panel.scss | 4 - Build/Sources/Sass/component/_treelist.scss | 6 +- Build/phpstan/phpstan-baseline.neon | 5 - .../backend/Resources/Public/Css/backend.css | 8 +- .../Application/Impexp/ExportCest.php | 22 +- .../Application/Impexp/ImportCest.php | 5 +- typo3/sysext/impexp/Classes/ImportExport.php | 146 ++++---- .../Resources/Private/Language/locallang.xlf | 5 +- .../Partials/Export/AdvancedOptions.html | 134 ++++--- .../Partials/Export/Configuration.html | 336 +++++++++-------- .../Private/Partials/Export/Save.html | 351 ++++++++++-------- .../Private/Partials/Import/Import.html | 335 +++++++++-------- .../Private/Partials/Import/MetaData.html | 90 ++--- .../Private/Partials/Import/Upload.html | 99 +++-- .../Resources/Private/Partials/Preview.html | 101 ++--- .../Resources/Private/Templates/Export.html | 35 +- .../Resources/Private/Templates/Import.html | 36 +- .../impexp/Tests/Functional/ExportTest.php | 4 +- .../RenderPreviewExportPageAndRecords.php | 160 ++++---- ...reviewExportPageAndRecordsWithSoftRefs.php | 108 +++--- .../RenderPreviewExportRecords.php | 40 +- .../RenderPreviewExportTable.php | 60 ++- .../RenderPreviewImportPageAndRecords.php | 52 +-- ...derPreviewImportPageAndRecordsByUpdate.php | 44 +-- ...ewImportPageAndRecordsByUpdateWithDiff.php | 130 +++---- ...derPreviewImportPageAndRecordsWithDiff.php | 112 +++--- ...reviewImportPageAndRecordsWithSoftRefs.php | 36 +- .../impexp/Tests/Functional/ImportTest.php | 4 +- 31 files changed, 1247 insertions(+), 1244 deletions(-) create mode 100644 Build/Sources/Sass/component/_indent.scss diff --git a/Build/Sources/Sass/backend.scss b/Build/Sources/Sass/backend.scss index 1b52c79f683e..4063bf780da1 100644 --- a/Build/Sources/Sass/backend.scss +++ b/Build/Sources/Sass/backend.scss @@ -58,6 +58,7 @@ @import "component/resources"; @import "component/recordsearchbox"; @import "component/treelist"; +@import "component/indent"; // // Elements diff --git a/Build/Sources/Sass/component/_indent.scss b/Build/Sources/Sass/component/_indent.scss new file mode 100644 index 000000000000..2f05e7776ed7 --- /dev/null +++ b/Build/Sources/Sass/component/_indent.scss @@ -0,0 +1,18 @@ +// +// indent +// +// Examples +// ------------- +// +// +// +// +.indent { + --indent-base: 16px; + --indent-level: 0; + margin-left: calc(var(--indent-base) * var(--indent-level)); +} + +.indent-inline-block { + display: inline-block; +} diff --git a/Build/Sources/Sass/component/_modal.scss b/Build/Sources/Sass/component/_modal.scss index 96bc22f9a6f3..b560af4c2fce 100644 --- a/Build/Sources/Sass/component/_modal.scss +++ b/Build/Sources/Sass/component/_modal.scss @@ -181,10 +181,6 @@ $modal-sidebar-button-space: $padding-small-vertical; .panel-body { border-left: 2px solid $color-orange; - - label { - margin-bottom: $modal-sidebar-button-space; - } } } diff --git a/Build/Sources/Sass/component/_panel.scss b/Build/Sources/Sass/component/_panel.scss index b71fd3fde41a..fb761c9e2136 100644 --- a/Build/Sources/Sass/component/_panel.scss +++ b/Build/Sources/Sass/component/_panel.scss @@ -356,8 +356,4 @@ $panel-heading-bg-scale: -85%; margin-left: -1px; } } - - label { - margin-bottom: 0; - } } diff --git a/Build/Sources/Sass/component/_treelist.scss b/Build/Sources/Sass/component/_treelist.scss index 213dca1be649..d986bcb2bdd5 100644 --- a/Build/Sources/Sass/component/_treelist.scss +++ b/Build/Sources/Sass/component/_treelist.scss @@ -159,7 +159,7 @@ } .treelist-icon { - top: -2px; + top: -1px; } .treelist-show { @@ -250,6 +250,6 @@ // // Tree Variations // -.panel-tab { - --treelist-bg: #{$nav-tabs-active-link-bg}; +.form-section { + --treelist-bg: #fafafa; } diff --git a/Build/phpstan/phpstan-baseline.neon b/Build/phpstan/phpstan-baseline.neon index 8876db6699d2..26cc9d004d57 100644 --- a/Build/phpstan/phpstan-baseline.neon +++ b/Build/phpstan/phpstan-baseline.neon @@ -2880,11 +2880,6 @@ parameters: count: 2 path: ../../typo3/sysext/impexp/Classes/ImportExport.php - - - message: "#^Offset 'updatePath' does not exist on array\\{msg\\: string, ref\\: 'FILE', type\\: 'file', preCode\\: non\\-falsy\\-string, title\\: string, showDiffContent\\: string\\}\\.$#" - count: 1 - path: ../../typo3/sysext/impexp/Classes/ImportExport.php - - message: "#^Unreachable statement \\- code above always terminates\\.$#" count: 1 diff --git a/typo3/sysext/backend/Resources/Public/Css/backend.css b/typo3/sysext/backend/Resources/Public/Css/backend.css index e44c6e5554f1..a671cc66a2f7 100644 --- a/typo3/sysext/backend/Resources/Public/Css/backend.css +++ b/typo3/sysext/backend/Resources/Public/Css/backend.css @@ -2872,7 +2872,6 @@ a.dropdown-toggle{text-decoration:none} .panel-collapse>.form-section,.panel-collapse>.tab-content>.form-section,.panel-collapse>.tab-content>.tab-pane>.form-section,.panel-collapse>[role=tabpanel]>.tab-content>.form-section,.panel-collapse>[role=tabpanel]>.tab-content>.tab-pane>.form-section,.panel>.form-section,.panel>.tab-content>.form-section,.panel>.tab-content>.tab-pane>.form-section,.panel>[role=tabpanel]>.tab-content>.form-section,.panel>[role=tabpanel]>.tab-content>.tab-pane>.form-section{border-left:0;border-right:0;border-bottom:0} .panel-collapse>.nav-tabs,.panel-collapse>[role=tabpanel]>.nav-tabs,.panel>.nav-tabs,.panel>[role=tabpanel]>.nav-tabs{border-top:1px solid #ccc;padding-top:8px} .panel-collapse>.nav-tabs>li,.panel-collapse>[role=tabpanel]>.nav-tabs>li,.panel>.nav-tabs>li,.panel>[role=tabpanel]>.nav-tabs>li{margin-left:-1px} -.panel label,.panel-collapse label{margin-bottom:0} .form-check .form-check-label{margin-bottom:0} .form-check-input:not(:disabled),.form-check-input:not(:disabled)~.form-check-label{cursor:pointer} .form-check.form-check-type-labeled-toggle{display:flex;align-items:center;padding-left:0;gap:.5em} @@ -3352,7 +3351,6 @@ to{opacity:1;transform:translate3d(0,0,0)} .modal-image-manipulation .panel-heading .is-active{pointer-events:none} .modal-image-manipulation .panel{margin-bottom:0} .modal-image-manipulation .panel-body{border-left:2px solid #ff8700} -.modal-image-manipulation .panel-body label{margin-bottom:4px} .modal-type-iframe{padding:0} .modal-type-iframe .modal-body{padding:0} .modal-iframe{display:block;border:0;height:100%;width:100%;position:absolute;top:0;left:0} @@ -3565,7 +3563,7 @@ typo3-backend-live-search-result-item-action>* .livesearch-result-item-title .sm .treelist-group-monospace{font-family:var(--typo3-font-family-monospace)} .treelist-operator{opacity:.5} .treelist-value{font-weight:700} -.treelist-icon{top:-2px} +.treelist-icon{top:-1px} .treelist-show{position:relative;display:inline-block;width:var(--treelist-control-size);text-align:center;margin-left:-2px} .treelist-control{position:absolute;top:calc(var(--treelist-item-line-height)/ 2);transform:translate(-50%,-50%);left:0;display:block;text-align:center;line-height:var(--treelist-control-size);width:var(--treelist-control-size);height:var(--treelist-control-size);-webkit-user-select:none;-moz-user-select:none;user-select:none} .treelist-control:before,.treelist-control:target:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--treelist-control-size);height:var(--treelist-control-size);background-color:var(--treelist-bg)} @@ -3580,7 +3578,9 @@ typo3-backend-live-search-result-item-action>* .livesearch-result-item-title .sm .treelist-root>li>.treelist-group>.treelist-control{margin-left:calc(var(--treelist-control-size) * -1)} .treelist-root>li>.treelist-group>.treelist-control:before{background-color:transparent} .treelist-root-clean>li{padding-left:0} -.panel-tab{--treelist-bg:#fafafa} +.form-section{--treelist-bg:#fafafa} +.indent{--indent-base:16px;--indent-level:0;margin-left:calc(var(--indent-base) * var(--indent-level))} +.indent-inline-block{display:inline-block} typo3-backend-editable-page-title{display:block;white-space:nowrap;text-overflow:ellipsis} typo3-backend-new-content-element-wizard{--typo3-component-color:var(--typo3-light-color);--typo3-component-bg:var(--typo3-light-bg);--typo3-component-border-color:var(--typo3-light-border-color);--typo3-component-link-color:var(--typo3-light-link-color);--typo3-component-link-hover-color:var(--typo3-light-link-hover-color);--typo3-component-hover-color:var(--typo3-light-hover-color);--typo3-component-hover-bg:var(--typo3-light-hover-bg);--typo3-component-hover-border-color:var(--typo3-light-hover-border-color);--typo3-component-focus-color:var(--typo3-light-focus-color);--typo3-component-focus-bg:var(--typo3-light-focus-bg);--typo3-component-focus-border-color:var(--typo3-light-focus-border-color);--typo3-component-active-color:var(--typo3-light-active-color);--typo3-component-active-bg:var(--typo3-light-active-bg);--typo3-component-active-border-color:var(--typo3-light-active-border-color);--typo3-component-disabled-color:var(--typo3-light-disabled-color);--typo3-component-disabled-bg:var(--typo3-light-disabled-bg);--typo3-component-disabled-border-color:var(--typo3-light-disabled-border-color)} .collapse-horizontal{height:auto;width:0;vertical-align:middle;overflow:hidden} diff --git a/typo3/sysext/core/Tests/Acceptance/Application/Impexp/ExportCest.php b/typo3/sysext/core/Tests/Acceptance/Application/Impexp/ExportCest.php index 620c53d563ba..ca4d56a1b899 100644 --- a/typo3/sysext/core/Tests/Acceptance/Application/Impexp/ExportCest.php +++ b/typo3/sysext/core/Tests/Acceptance/Application/Impexp/ExportCest.php @@ -32,7 +32,6 @@ final class ExportCest extends AbstractCest private string $inModuleHeader = '.module-docheader'; private string $inModuleTabs = '#ImportExportController .nav-tabs'; private string $inModuleTabsBody = '#ImportExportController .tab-content'; - private string $inModulePreview = '#ImportExportController > div:last-child'; private string $inTabConfiguration = '#export-configuration'; private string $inFlashMessages = '.typo3-messages'; @@ -50,7 +49,6 @@ public function exportPageAndRecordsDisplaysTitleOfSelectedPageInModuleHeader(Ap $selectedPageTitle = 'elements t3editor'; $selectedPageIcon = '//*[text()=\'' . $selectedPageTitle . '\']/../*[contains(@class, \'node-icon-container\')]'; - $buttonUpdate = '.btn[value=Update]'; $I->click($selectedPageIcon); $this->selectInContextMenu($I, [$this->contextMenuMore, $this->contextMenuExport]); @@ -59,7 +57,7 @@ public function exportPageAndRecordsDisplaysTitleOfSelectedPageInModuleHeader(Ap $I->waitForElementNotVisible('#nprogress'); $I->see($selectedPageTitle, $this->inModuleHeader); - $I->click($buttonUpdate, $this->inTabConfiguration); + $I->click('Update', $this->inTabConfiguration); $this->timeoutForAjaxRequest($I); $I->see($selectedPageTitle, $this->inModuleHeader); } @@ -71,7 +69,6 @@ public function exportTableDisplaysTitleOfRootPageInModuleHeader(ApplicationTest $tableTitle = 'Form engine elements - t3editor'; $listModuleHeader = '.module-docheader'; $listModuleBtnExport = 'a[title="Export"]'; - $buttonUpdate = '.btn[value=Update]'; $pageTree->openPath(['styleguide TCA demo']); $I->waitForElement($this->inPageTree . ' .node', 5); @@ -89,7 +86,7 @@ public function exportTableDisplaysTitleOfRootPageInModuleHeader(ApplicationTest $I->see($rootPageTitle, $this->inModuleHeader); $I->dontSee($tablePageTitle, $this->inModuleHeader); - $I->click($buttonUpdate, $this->inTabConfiguration); + $I->click('Update', $this->inTabConfiguration); $this->timeoutForAjaxRequest($I); $I->see($rootPageTitle, $this->inModuleHeader); $I->dontSee($tablePageTitle, $this->inModuleHeader); @@ -101,7 +98,6 @@ public function exportRecordDisplaysTitleOfRootPageInModuleHeader(ApplicationTes $recordPageTitle = 'elements t3editor'; $recordTable = '#recordlist-tx_styleguide_elements_t3editor'; $recordIcon = 'tr:first-child a[data-contextmenu-trigger]'; - $buttonUpdate = '.btn[value=Update]'; $pageTree->openPath(['styleguide TCA demo']); $I->waitForElement($this->inPageTree . ' .node', 5); @@ -117,7 +113,7 @@ public function exportRecordDisplaysTitleOfRootPageInModuleHeader(ApplicationTes $I->see($rootPageTitle, $this->inModuleHeader); $I->dontSee($recordPageTitle, $this->inModuleHeader); - $I->click($buttonUpdate, $this->inTabConfiguration); + $I->click('Update', $this->inTabConfiguration); $this->timeoutForAjaxRequest($I); $I->see($rootPageTitle, $this->inModuleHeader); $I->dontSee($recordPageTitle, $this->inModuleHeader); @@ -196,8 +192,8 @@ public function exportPageAndRecordsFromPageTree(ApplicationTester $I, PageTree $I->waitForElementNotVisible('#nprogress'); $I->cantSee('No tree exported - only tables on the page.', $this->inModuleTabsBody); - $I->see('Inside pagetree', $this->inModulePreview); - $I->dontSee('Outside pagetree', $this->inModulePreview); + $I->see('Inside pagetree'); + $I->dontSee('Outside pagetree'); $I->click($tabExport, $this->inModuleTabs); $I->waitForElementVisible($contentExport, 5); $I->click($buttonSaveToFile, $this->inModuleTabsBody); @@ -232,8 +228,8 @@ public function exportTable(ApplicationTester $I): void $I->waitForElementVisible($tabExport, 5); $I->canSee('No tree exported - only tables on the page.', $this->inModuleTabsBody); $I->canSee('Export tables from pages', $this->inModuleTabsBody); - $I->dontSee('Inside pagetree', $this->inModulePreview); - $I->see('Outside pagetree', $this->inModulePreview); + $I->dontSee('Inside pagetree'); + $I->see('Outside pagetree'); $I->click($tabExport, $this->inModuleTabs); $I->waitForElementVisible($contentExport, 5); $I->click($buttonSaveToFile, $this->inModuleTabsBody); @@ -266,8 +262,8 @@ public function exportRecord(ApplicationTester $I): void $I->waitForElementVisible($tabExport, 5); $I->canSee('No tree exported - only tables on the page.', $this->inModuleTabsBody); $I->canSee('Export single record', $this->inModuleTabsBody); - $I->dontSee('Inside pagetree', $this->inModulePreview); - $I->see('Outside pagetree', $this->inModulePreview); + $I->dontSee('Inside pagetree'); + $I->see('Outside pagetree'); $I->click($tabExport, $this->inModuleTabs); $I->waitForElementVisible($contentExport, 5); $I->click($buttonSaveToFile, $this->inModuleTabsBody); diff --git a/typo3/sysext/core/Tests/Acceptance/Application/Impexp/ImportCest.php b/typo3/sysext/core/Tests/Acceptance/Application/Impexp/ImportCest.php index 5fe28145ec25..3daaf18ed928 100644 --- a/typo3/sysext/core/Tests/Acceptance/Application/Impexp/ImportCest.php +++ b/typo3/sysext/core/Tests/Acceptance/Application/Impexp/ImportCest.php @@ -42,9 +42,8 @@ final class ImportCest extends AbstractCest private string $inputUploadFile = 'input[type=file]'; private string $checkboxOverwriteFile = 'input#checkOverwriteExistingFiles'; private string $buttonUploadFile = '_upload'; - private string $buttonPreview = '.btn[value=Preview]'; private string $buttonImport = 'button[name="tx_impexp[import_file]"]'; - private string $buttonNewImport = 'input[name="tx_impexp[new_import]"]'; + private string $buttonNewImport = 'button[name="tx_impexp[new_import]"]'; public function _before(ApplicationTester $I, PageTree $pageTree): void { @@ -76,7 +75,7 @@ public function importDisplaysTitleOfSelectedPageInModuleHeader(ApplicationTeste $I->switchToContentFrame(); $I->see($pageInPageTreeTitle, $this->inModuleHeader); - $I->click($this->buttonPreview, $this->inTabImport); + $I->click('Preview', $this->inTabImport); $this->timeoutForAjaxRequest($I); $I->see($pageInPageTreeTitle, $this->inModuleHeader); } diff --git a/typo3/sysext/impexp/Classes/ImportExport.php b/typo3/sysext/impexp/Classes/ImportExport.php index 72450c1bdc6a..9ed06571c778 100644 --- a/typo3/sysext/impexp/Classes/ImportExport.php +++ b/typo3/sysext/impexp/Classes/ImportExport.php @@ -376,7 +376,7 @@ protected function traversePageTree(array $pageTree, array &$lines, int $indent $table = (string)$table; if ($table !== 'pages') { foreach (array_keys($records) as $uid) { - $this->addRecord($table, (int)$uid, $lines, $indent + 2); + $this->addRecord($table, (int)$uid, $lines, $indent + 1); } } } @@ -385,7 +385,7 @@ protected function traversePageTree(array $pageTree, array &$lines, int $indent // Add subtree if (is_array($page['subrow'] ?? null)) { - $this->traversePageTree($page['subrow'], $lines, $indent + 2); + $this->traversePageTree($page['subrow'], $lines, $indent + 1); } } } @@ -527,17 +527,16 @@ protected function addRecord(string $table, int $uid, array &$lines, int $indent $line['msg'] = 'UNKNOWN TABLE "' . $line['ref'] . '"'; } else { $pidRecord = $this->getPidRecord(); - $icon = $this->iconFactory->getIconForRecord( - $table, - (array)($this->dat['records'][$table . ':' . $uid]['data'] ?? []), - Icon::SIZE_SMALL - )->render(); - $line['preCode'] = sprintf( - '%s%s', - $this->renderIndent($indent), - htmlspecialchars($line['ref']), - $icon - ); + $line['preCode'] = '' + . $this->renderIndent($indent) + . $this->iconFactory + ->getIconForRecord( + $table, + (array)($this->dat['records'][$table . ':' . $uid]['data'] ?? []), + Icon::SIZE_SMALL + ) + ->setTitle($line['ref']) + ->render(); $line['title'] = htmlspecialchars($record['title'] ?? ''); // Link to page view if ($table === 'pages') { @@ -647,7 +646,6 @@ protected function addRelations(array $relations, array &$lines, int $indent, ar continue; } $iconName = 'status-status-checked'; - $iconClass = ''; $staticFixed = false; $record = null; if ($uid > 0) { @@ -656,7 +654,6 @@ protected function addRelations(array $relations, array &$lines, int $indent, ar if ($this->isTableStatic($table) || $this->isRecordExcluded($table, (int)$uid) || ($relation['tokenID'] ?? '') && !$this->isSoftRefIncluded($relation['tokenID'] ?? '')) { $line['title'] = htmlspecialchars('STATIC: ' . $line['ref']); - $iconClass = 'text-info'; $staticFixed = true; } else { $databaseRecord = $this->getRecordFromDatabase($table, (int)$uid); @@ -667,7 +664,6 @@ protected function addRelations(array $relations, array &$lines, int $indent, ar htmlspecialchars($line['ref']) ); $line['msg'] = 'LOST RELATION' . ($databaseRecord === null ? ' (Record not found!)' : ' (Path: ' . $recordPath . ')'); - $iconClass = 'text-danger'; $iconName = 'status-dialog-warning'; } } else { @@ -686,14 +682,12 @@ protected function addRelations(array $relations, array &$lines, int $indent, ar $staticFixed = true; } - $icon = $this->iconFactory->getIcon($iconName, Icon::SIZE_SMALL)->render(); - $line['preCode'] = sprintf( - '%s%s', - $this->renderIndent($indent + 2), - $iconClass, - htmlspecialchars($line['ref']), - $icon - ); + $line['preCode'] = '' + . $this->renderIndent($indent + 1) + . $this->iconFactory + ->getIcon($iconName, Icon::SIZE_SMALL) + ->setTitle($line['ref']) + ->render(); if (!$staticFixed || $this->showStaticRelations) { $lines[] = $line; if (is_array($record) && is_array($record['rels'] ?? null)) { @@ -731,12 +725,12 @@ public function addFiles(array $relations, array &$lines, int $indent, string $t } $line['ref'] = 'FILE'; $line['type'] = 'file'; - $line['preCode'] = sprintf( - '%s%s', - $this->renderIndent($indent + 2), - htmlspecialchars($line['ref']), - $this->iconFactory->getIcon('status-reference-hard', Icon::SIZE_SMALL)->render() - ); + $line['preCode'] = '' + . $this->renderIndent($indent + 1) + . $this->iconFactory + ->getIcon('status-reference-hard', Icon::SIZE_SMALL) + ->setTitle($line['ref']) + ->render(); $line['title'] = htmlspecialchars($fileInfo['filename']); $line['showDiffContent'] = PathUtility::stripPathSitePrefix((string)($this->fileIdMap[$ID] ?? '')); // If import mode and there is a non-RTE soft reference, check the destination directory. @@ -748,7 +742,7 @@ public function addFiles(array $relations, array &$lines, int $indent, string $t $origDirPrefix = PathUtility::dirname($fileInfo['relFileName']) . '/'; $dirPrefix = $this->resolveStoragePath($origDirPrefix); if ($dirPrefix === null) { - $line['msg'] = 'ERROR: There are no available file mounts to write file in! '; + $line['msg'] = 'ERROR: There are no available file mounts to write file in!'; } elseif ($origDirPrefix !== $dirPrefix) { $line['msg'] = 'File will be attempted written to "' . $dirPrefix . '". '; } @@ -756,7 +750,7 @@ public function addFiles(array $relations, array &$lines, int $indent, string $t // Check file existence if (file_exists(Environment::getPublicPath() . '/' . $fileInfo['relFileName'])) { if ($this->update) { - $line['updatePath'] .= 'File exists.'; + $line['updatePath'] = 'File exists.'; } else { $line['msg'] .= 'File already exists! '; } @@ -786,12 +780,12 @@ public function addFiles(array $relations, array &$lines, int $indent, string $t } $line['ref'] = 'FILE'; $line['type'] = 'file'; - $line['preCode'] = sprintf( - '%s%s', - $this->renderIndent($indent + 4), - htmlspecialchars($line['ref']), - $this->iconFactory->getIcon('status-reference-hard', Icon::SIZE_SMALL)->render() - ); + $line['preCode'] = '' + . $this->renderIndent($indent + 1) + . $this->iconFactory + ->getIcon('status-reference-hard', Icon::SIZE_SMALL) + ->setTitle($line['ref']) + ->render(); $line['title'] = htmlspecialchars($fileInfo['filename']) . ' (Original)'; $line['showDiffContent'] = PathUtility::stripPathSitePrefix($this->fileIdMap[$ID]); $lines[] = $line; @@ -811,12 +805,12 @@ public function addFiles(array $relations, array &$lines, int $indent, string $t } $line['ref'] = 'FILE'; $line['type'] = 'file'; - $line['preCode'] = sprintf( - '%s%s', - $this->renderIndent($indent + 4), - htmlspecialchars($line['ref']), - $this->iconFactory->getIcon('actions-insert-reference', Icon::SIZE_SMALL)->render() - ); + $line['preCode'] = '' + . $this->renderIndent($indent + 1) + . $this->iconFactory + ->getIcon('actions-insert-reference', Icon::SIZE_SMALL) + ->setTitle($line['ref']) + ->render(); $line['title'] = htmlspecialchars($fileInfo['filename']) . ' (Resource)'; $line['showDiffContent'] = PathUtility::stripPathSitePrefix($this->fileIdMap[$extID]); $lines[] = $line; @@ -842,14 +836,14 @@ protected function addSoftRefs(array $softrefs, array &$lines, int $indent): voi $line['ref'] = 'SOFTREF'; $line['type'] = 'softref'; $line['msg'] = ''; - $line['preCode'] = sprintf( - '%s%s', - $this->renderIndent($indent + 2), - htmlspecialchars($line['ref']), - $this->iconFactory->getIcon('status-reference-soft', Icon::SIZE_SMALL)->render() - ); + $line['preCode'] = '' + . $this->renderIndent($indent) + . $this->iconFactory + ->getIcon('status-reference-soft', Icon::SIZE_SMALL) + ->setTitle($line['ref']) + ->render(); $line['title'] = sprintf( - '%s, "%s" : %s', + '%s, "%s": %s', $softref['field'], $softref['spKey'], htmlspecialchars($softref['matchString'] ?? ''), @@ -858,38 +852,38 @@ protected function addSoftRefs(array $softrefs, array &$lines, int $indent): voi if ($softref['subst']['type'] ?? false) { if ($softref['subst']['title'] ?? false) { $line['title'] .= sprintf( - '
%s%s %s', - $this->renderIndent($indent + 4), + '
%s %s %s', + $this->renderIndent($indent + 1), htmlspecialchars($this->lang->getLL('impexpcore_singlereco_title')), htmlspecialchars(GeneralUtility::fixed_lgd_cs($softref['subst']['title'], 60)) ); } if ($softref['subst']['description'] ?? false) { $line['title'] .= sprintf( - '
%s%s %s', - $this->renderIndent($indent + 4), + '
%s %s %s', + $this->renderIndent($indent + 1), htmlspecialchars($this->lang->getLL('impexpcore_singlereco_descr')), htmlspecialchars(GeneralUtility::fixed_lgd_cs($softref['subst']['description'], 60)) ); } if ($softref['subst']['type'] === 'db') { $line['title'] .= sprintf( - '
%s%s %s', - $this->renderIndent($indent + 4), + '
%s %s %s', + $this->renderIndent($indent + 1), htmlspecialchars($this->lang->getLL('impexpcore_softrefsel_record')), $softref['subst']['recordRef'] ); } elseif ($softref['subst']['type'] === 'file') { $line['title'] .= sprintf( - '
%s%s %s', - $this->renderIndent($indent + 4), + '
%s %s %s', + $this->renderIndent($indent + 1), htmlspecialchars($this->lang->getLL('impexpcore_singlereco_filename')), $softref['subst']['relFileName'] ); } elseif ($softref['subst']['type'] === 'string') { $line['title'] .= sprintf( - '
%s%s %s', - $this->renderIndent($indent + 4), + '
%s %s %s', + $this->renderIndent($indent + 1), htmlspecialchars($this->lang->getLL('impexpcore_singlereco_value')), $softref['subst']['tokenValue'] ); @@ -906,19 +900,19 @@ protected function addSoftRefs(array $softrefs, array &$lines, int $indent): voi if (($softref['subst']['type'] ?? '') === 'db') { [$referencedTable, $referencedUid] = explode(':', $softref['subst']['recordRef']); $relations = [['table' => $referencedTable, 'id' => $referencedUid, 'tokenID' => $softref['subst']['tokenID']]]; - $this->addRelations($relations, $lines, $indent + 4); + $this->addRelations($relations, $lines, $indent + 1); } // Add files relations if (($softref['subst']['type'] ?? '') === 'file') { $relations = [$softref['file_ID']]; - $this->addFiles($relations, $lines, $indent + 4, $softref['subst']['tokenID']); + $this->addFiles($relations, $lines, $indent + 1, $softref['subst']['tokenID']); } } } protected function renderIndent(int $indent): string { - return str_repeat('  ', $indent); + return $indent > 0 ? '' : ''; } /** @@ -964,13 +958,11 @@ protected function renderControls(array $line): string */ protected function renderRecordExcludeCheckbox(string $recordRef): string { - return sprintf( - ' - - ', - $recordRef, - htmlspecialchars($this->lang->getLL('impexpcore_singlereco_exclude')) - ); + return '' + . '
' + . '' + . '' + . '
'; } /** @@ -987,9 +979,9 @@ protected function renderSoftRefImportTextField(array $softref): string if (($cfg['mode'] ?? '') === Import::SOFTREF_IMPORT_MODE_EDITABLE) { $html = ''; if ($cfg['title'] ?? false) { - $html .= '' . htmlspecialchars((string)$cfg['title']) . '
'; + $html .= '' . htmlspecialchars((string)$cfg['title']) . '
'; } - $html .= htmlspecialchars((string)$cfg['description']) . '
'; + $html .= htmlspecialchars((string)$cfg['description']) . '
'; $html .= sprintf( '', $tokenID, @@ -1023,14 +1015,14 @@ protected function renderSoftRefExportSelector(array $softref): string 'tx_impexp[softrefCfg][' . $softref['subst']['tokenID'] . '][mode]', $value, $options - ) . '
'; + ); $textFieldHtml = ''; if ($value === Import::SOFTREF_IMPORT_MODE_EDITABLE) { if ($softref['subst']['title'] ?? false) { $textFieldHtml .= sprintf( ' - %2$s
', + %2$s
', $softref['subst']['tokenID'], htmlspecialchars($softref['subst']['title']) ); @@ -1038,7 +1030,7 @@ protected function renderSoftRefExportSelector(array $softref): string if (!($softref['subst']['description'] ?? false)) { $textFieldHtml .= sprintf( ' - %s
+ %s
', htmlspecialchars($this->lang->getLL('impexpcore_printerror_description')), $softref['subst']['tokenID'], @@ -1135,7 +1127,7 @@ protected function renderSelectBox(string $name, string $value, array $options): ); } - return ''; + return ''; } public function getFileadminFolderName(): string diff --git a/typo3/sysext/impexp/Resources/Private/Language/locallang.xlf b/typo3/sysext/impexp/Resources/Private/Language/locallang.xlf index 6c629e52f635..3d966d5b3c64 100644 --- a/typo3/sysext/impexp/Resources/Private/Language/locallang.xlf +++ b/typo3/sysext/impexp/Resources/Private/Language/locallang.xlf @@ -171,9 +171,6 @@ Output options - - Meta data - Title @@ -211,7 +208,7 @@ File - (From path: %s) + From path: %s NOTE: No decompressor available for compressed files! diff --git a/typo3/sysext/impexp/Resources/Private/Partials/Export/AdvancedOptions.html b/typo3/sysext/impexp/Resources/Private/Partials/Export/AdvancedOptions.html index f1fe81b8b574..6ac40d28880d 100644 --- a/typo3/sysext/impexp/Resources/Private/Partials/Export/AdvancedOptions.html +++ b/typo3/sysext/impexp/Resources/Private/Partials/Export/AdvancedOptions.html @@ -1,70 +1,86 @@ -

- -

-
- - -
+
-

- -

-
- -
+

+ +

+
+
+ + + +
+
-

- -

-
- -
+
+ +

+ +

+
+
+ + + +
+
-
-
+
- +

+ +

+
+ + +
+
+ +
+ +
diff --git a/typo3/sysext/impexp/Resources/Private/Partials/Export/Configuration.html b/typo3/sysext/impexp/Resources/Private/Partials/Export/Configuration.html index f485ae2ebd92..7ae8dbce41ad 100644 --- a/typo3/sysext/impexp/Resources/Private/Partials/Export/Configuration.html +++ b/typo3/sysext/impexp/Resources/Private/Partials/Export/Configuration.html @@ -1,182 +1,189 @@ -

- -

+
-
-
- -
-
- {inData.pagetree.id} - -
-
- -
-
- -
-
- - - {treeHTML} - - - - - -
-
- -
- - -
+

+ +

-
- - -
- - -

- -

-
- - {record.icon} - {record.title} - -
-
+ {inData.pagetree.id} +
-
- -

- -

-
- - {table.iconAndTitle} - -
+ + + {treeHTML} + + + + + +
+
+ +
+ + +
+ +
+ + +
+ + +

+ +

+
+
+ +
+
+ + {record.icon} + {record.title} + +
+
+
+
+ + +

+ +

+
+
+ +
+
+ + {table.iconAndTitle} + +
+
+
+
+
+ +

+ +

+ +
+ +
-
- -

- -

- -
- - -
-
- - -
+
+ + +
-
- -
+
+
+ + + +
+
-
- -

+

+ - - - - {key} - {key}, - - +

+ + + + {key} + {key}, + + +

- +

+ +

-

-

-

-
+
+ +
+ +
-
-
diff --git a/typo3/sysext/impexp/Resources/Private/Partials/Export/Save.html b/typo3/sysext/impexp/Resources/Private/Partials/Export/Save.html index 6417a8f93e35..2fddf4a53b4d 100644 --- a/typo3/sysext/impexp/Resources/Private/Partials/Export/Save.html +++ b/typo3/sysext/impexp/Resources/Private/Partials/Export/Save.html @@ -1,174 +1,205 @@ -

- -

-
- - -
-
- - - - - -
-
- - +
+ +

+ +

+ +
+ + +
+ +
+ + + + + +
+
-
-