From c8e7f9e3286d1e4217076bcc6dc5ea397d0933ab Mon Sep 17 00:00:00 2001 From: Michael Oehlhof <typo3@oehlhof.de> Date: Sun, 25 Oct 2015 20:49:43 +0100 Subject: [PATCH] [TASK] Show module action name and page title for import/export in bookmark list Resolves: #71007 Releases: master Change-Id: I67056e2df58daaff6107bae16a0385d01b48b964 Reviewed-on: https://review.typo3.org/44268 Reviewed-by: Daniel Goerz <ervaude@gmail.com> Tested-by: Daniel Goerz <ervaude@gmail.com> Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de> Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de> --- .../Controller/ImportExportController.php | 18 ++++++++++++++++-- .../Resources/Private/Language/locallang.xlf | 6 ++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/typo3/sysext/impexp/Classes/Controller/ImportExportController.php b/typo3/sysext/impexp/Classes/Controller/ImportExportController.php index 744c1f13e537..3163373f38d5 100644 --- a/typo3/sysext/impexp/Classes/Controller/ImportExportController.php +++ b/typo3/sysext/impexp/Classes/Controller/ImportExportController.php @@ -98,6 +98,13 @@ class ImportExportController extends BaseScriptClass */ protected $moduleTemplate; + /** + * The name of the shortcut for this page + * + * @var string + */ + protected $shortcutName; + /** * Constructor */ @@ -143,13 +150,14 @@ class ImportExportController extends BaseScriptClass ); $this->moduleTemplate->setForm('<form action="' . htmlspecialchars(BackendUtility::getModuleUrl('xMOD_tximpexp')) . '" method="post" enctype="multipart/form-data">' . '<input type="hidden" name="id" value="' . $this->id . '" />'); - $this->content .= $this->moduleTemplate->sectionHeader($this->lang->getLL('title')); - $this->content .= $this->moduleTemplate->spacer(5); // Input data grabbed: $inData = GeneralUtility::_GP('tx_impexp'); + $this->content .= $this->moduleTemplate->sectionHeader($this->lang->getLL('title_' . (string)$inData['action'])); + $this->content .= $this->moduleTemplate->spacer(5); $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(); @@ -158,6 +166,7 @@ class ImportExportController extends BaseScriptClass $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.... @@ -241,6 +250,7 @@ class ImportExportController extends BaseScriptClass if ($this->getBackendUser()->mayMakeShortcut()) { $shortcutButton = $buttonBar->makeShortcutButton() ->setGetVariables(['tx_impexp']) + ->setDisplayName($this->shortcutName) ->setModuleName($this->moduleName); $buttonBar->addButton($shortcutButton); } @@ -399,6 +409,7 @@ class ImportExportController extends BaseScriptClass } $pagetree = GeneralUtility::makeInstance(\TYPO3\CMS\Impexp\View\ExportPageTreeView::class); $this->treeHTML = $pagetree->printTree($tree->tree); + $this->shortcutName .= ' (' . $sPage['title'] . ')'; } } // In any case we should have a multi-level array, $idH, with the page structure @@ -1016,6 +1027,9 @@ class ImportExportController extends BaseScriptClass // must have trailing slash. $path = $this->getDefaultImportExportFolder(); $exportFiles = $this->getExportFiles(); + + $this->shortcutName .= ' (' . $this->pageinfo['title'] . ')'; + // Configuration $row = array(); $selectOptions = array(''); diff --git a/typo3/sysext/impexp/Resources/Private/Language/locallang.xlf b/typo3/sysext/impexp/Resources/Private/Language/locallang.xlf index 743157a6bf57..e53fd86dc469 100644 --- a/typo3/sysext/impexp/Resources/Private/Language/locallang.xlf +++ b/typo3/sysext/impexp/Resources/Private/Language/locallang.xlf @@ -12,6 +12,12 @@ <trans-unit id="title"> <source>Import / Export</source> </trans-unit> + <trans-unit id="title_import"> + <source>Import</source> + </trans-unit> + <trans-unit id="title_export"> + <source>Export</source> + </trans-unit> <trans-unit id="tableselec_configuration"> <source>Configuration</source> </trans-unit> -- GitLab