[BUGFIX] impexp has to use module dispatcher 43/29443/2
authorMarkus Klein <klein.t3@mfc-linz.at>
Sun, 13 Apr 2014 14:53:08 +0000 (16:53 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Mon, 14 Apr 2014 08:14:30 +0000 (10:14 +0200)
Resolves: #57873
Releases: 6.2
Change-Id: I6f622c32429143bd55ffe9286a26a920d791ea5b
Reviewed-on: https://review.typo3.org/29443
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
typo3/sysext/backend/Classes/Clipboard/Clipboard.php
typo3/sysext/impexp/Classes/Task/ImportExportTask.php
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php

index f61bf0c..254398f 100644 (file)
@@ -283,7 +283,8 @@ class Clipboard {
                $opt[] = '<option value="" selected="selected">' . $this->clLabel('menu', 'rm') . '</option>';
                // Import / Export link:
                if ($elCount && ExtensionManagementUtility::isLoaded('impexp')) {
-                       $opt[] = '<option value="' . htmlspecialchars(('window.location.href=\'' . $this->backPath . ExtensionManagementUtility::extRelPath('impexp') . 'app/index.php' . $this->exportClipElementParameters() . '\';')) . '">' . $this->clLabel('export', 'rm') . '</option>';
+                       $url = BackendUtility::getModuleUrl('xMOD_tximpexp', $this->exportClipElementParameters());
+                       $opt[] = '<option value="' . htmlspecialchars(('window.location.href=' . GeneralUtility::quoteJSvalue($url) . ';')) . '">' . $this->clLabel('export', 'rm') . '</option>';
                }
                // Edit:
                if (!$this->fileMode && $elCount) {
@@ -697,14 +698,13 @@ class Clipboard {
        /**
         * Creates GET parameters for linking to the export module.
         *
-        * @return string GET parameters for current clipboard content to be exported.
-        * @todo Define visibility
+        * @return array GET parameters for current clipboard content to be exported
         */
-       public function exportClipElementParameters() {
+       protected function exportClipElementParameters() {
                // Init
                $pad = $this->current;
                $params = array();
-               $params[] = 'tx_impexp[action]=export';
+               $params['tx_impexp[action]'] = 'export';
                // Traverse items:
                if (is_array($this->clipData[$pad]['el'])) {
                        foreach ($this->clipData[$pad]['el'] as $k => $v) {
@@ -713,19 +713,19 @@ class Clipboard {
                                        // Rendering files/directories on the clipboard
                                        if ($table == '_FILE') {
                                                if (file_exists($v) && GeneralUtility::isAllowedAbsPath($v)) {
-                                                       $params[] = 'tx_impexp[' . (is_dir($v) ? 'dir' : 'file') . '][]=' . rawurlencode($v);
+                                                       $params['tx_impexp[' . (is_dir($v) ? 'dir' : 'file') . '][]'] = $v;
                                                }
                                        } else {
                                                // Rendering records:
                                                $rec = BackendUtility::getRecord($table, $uid);
                                                if (is_array($rec)) {
-                                                       $params[] = 'tx_impexp[record][]=' . rawurlencode(($table . ':' . $uid));
+                                                       $params['tx_impexp[record][]'] = $table . ':' . $uid;
                                                }
                                        }
                                }
                        }
                }
-               return '?' . implode('&', $params);
+               return $params;
        }
 
        /*****************************************
index bbd38a9..13f60e2 100644 (file)
@@ -78,7 +78,13 @@ class ImportExportTask implements \TYPO3\CMS\Taskcenter\TaskInterface {
                $id = (int)\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('display');
                // If a preset is found, it is rendered using an iframe
                if ($id > 0) {
-                       $url = $GLOBALS['BACK_PATH'] . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('impexp') . 'app/index.php?tx_impexp[action]=export&preset[load]=1&preset[select]=' . $id;
+                       $url = BackendUtility::getModuleUrl(
+                               'xMOD_tximpexp',
+                               array(
+                                       'tx_impexp[action]' => 'export',
+                                       'preset[load]' => 1,
+                                       'preset[select]' => $id)
+                       );
                        return $this->taskObject->urlInIframe($url, 1);
                } else {
                        // Header
index 15faa3d..3d47fe3 100644 (file)
@@ -226,7 +226,7 @@ class DatabaseRecordList extends \TYPO3\CMS\Recordlist\RecordList\AbstractDataba
                                $buttons['csv'] = '<a href="' . htmlspecialchars(($this->listURL() . '&csv=1')) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.csv', TRUE) . '">' . IconUtility::getSpriteIcon('mimetypes-text-csv') . '</a>';
                                // Export
                                if (ExtensionManagementUtility::isLoaded('impexp')) {
-                                       $url = $this->backPath . ExtensionManagementUtility::extRelPath('impexp') . 'app/index.php?tx_impexp[action]=export';
+                                       $url = BackendUtility::getModuleUrl('xMOD_tximpexp', array('tx_impexp[action]' => 'export'));
                                        $buttons['export'] = '<a href="' . htmlspecialchars(($url . '&tx_impexp[list][]=' . rawurlencode(($this->table . ':' . $this->id)))) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:rm.export', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-export-t3d') . '</a>';
                                }
                        }