[TASK] Show module action name and page title for import/export in bookmark list 68/44268/2
authorMichael Oehlhof <typo3@oehlhof.de>
Sun, 25 Oct 2015 19:49:43 +0000 (20:49 +0100)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Sun, 25 Oct 2015 22:10:29 +0000 (23:10 +0100)
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>
typo3/sysext/impexp/Classes/Controller/ImportExportController.php
typo3/sysext/impexp/Resources/Private/Language/locallang.xlf

index 744c1f1..3163373 100644 (file)
@@ -99,6 +99,13 @@ class ImportExportController extends BaseScriptClass
     protected $moduleTemplate;
 
     /**
+     *  The name of the shortcut for this page
+     *
+     * @var string
+     */
+    protected $shortcutName;
+
+    /**
      * Constructor
      */
     public function __construct()
@@ -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('');
index 743157a..e53fd86 100644 (file)
                        <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>