[TASK] Import/Export Module uses module dispatcher 63/28063/7
authorAnja Leichsenring <aleichsenring@ab-softlab.de>
Tue, 4 Mar 2014 20:35:35 +0000 (21:35 +0100)
committerMarkus Klein <klein.t3@mfc-linz.at>
Wed, 5 Mar 2014 21:04:51 +0000 (22:04 +0100)
Change-Id: I1ac785adf3b0573a50954855befdda838fd01c33
Resolves: #55671
Releases: 6.2
Reviewed-on: https://review.typo3.org/28063
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/js/extjs/components/pagetree/javascript/actions.js
typo3/sysext/backend/Classes/Controller/BackendController.php
typo3/sysext/impexp/Classes/Clickmenu.php
typo3/sysext/impexp/Classes/Controller/ImportExportController.php
typo3/sysext/impexp/app/conf.php
typo3/sysext/impexp/app/index.php
typo3/sysext/impexp/ext_tables.php

index 4573866..6e6b1cc 100644 (file)
@@ -34,6 +34,7 @@ Ext.namespace('TYPO3.Components.PageTree');
  * @author Stefan Galinski <stefan.galinski@gmail.com>
  */
 TYPO3.Components.PageTree.Actions = {
+
        /**
         * Evaluates a response from an ext direct call and shows a flash message
         * if it was an exceptional result
@@ -384,10 +385,11 @@ TYPO3.Components.PageTree.Actions = {
        exportT3d: function(node) {
                node.select();
                TYPO3.Backend.ContentContainer.setUrl(
-                       'sysext/impexp/app/index.php?tx_impexp[action]=export&' +
-                               'id=0&tx_impexp[pagetree][id]=' + node.attributes.nodeData.id +
-                               '&tx_impexp[pagetree][levels]=0' +
-                               '&tx_impexp[pagetree][tables][]=_ALL'
+                       TYPO3.settings.ImportExport.moduleUrl +
+                       '&tx_impexp[action]=export&' +
+                       'id=0&tx_impexp[pagetree][id]=' + node.attributes.nodeData.id +
+                       '&tx_impexp[pagetree][levels]=0' +
+                       '&tx_impexp[pagetree][tables][]=_ALL'
                );
        },
 
@@ -400,8 +402,9 @@ TYPO3.Components.PageTree.Actions = {
        importT3d: function(node) {
                node.select();
                TYPO3.Backend.ContentContainer.setUrl(
-                       'sysext/impexp/app/index.php?id=' + node.attributes.nodeData.id +
-                               '&table=pages&tx_impexp[action]=import'
+                       TYPO3.settings.ImportExport.moduleUrl +
+                       '&id=' + node.attributes.nodeData.id +
+                       '&table=pages&tx_impexp[action]=import'
                );
        },
 
index 699bd12..235e383 100644 (file)
@@ -110,6 +110,7 @@ class BackendController {
                $this->pageRenderer->addInlineSetting('BackendLogin.BackendLogin::refreshLogin', 'ajaxUrl', BackendUtility::getAjaxUrl('BackendLogin::refreshLogin'));
                $this->pageRenderer->addInlineSetting('BackendLogin.BackendLogin::isTimedOut', 'ajaxUrl', BackendUtility::getAjaxUrl('BackendLogin::isTimedOut'));
                $this->pageRenderer->addInlineSetting('BackendLogin.BackendLogin::getChallenge', 'ajaxUrl', BackendUtility::getAjaxUrl('BackendLogin::getChallenge'));
+               $this->pageRenderer->addInlineSetting('ImportExport', 'moduleUrl', BackendUtility::getModuleUrl('xMOD_tximpexp'));
                // Add default BE javascript
                $this->js = '';
                $this->jsFiles = array(
index 7de2d69..faad165 100644 (file)
@@ -50,19 +50,31 @@ class Clickmenu {
                // Show import/export on second level menu OR root level.
                if ($backRef->cmLevel && \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('subname') == 'moreoptions' || $table === 'pages' && $uid == 0) {
                        $LL = $this->includeLL();
-                       $modUrl = $backRef->backPath . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('impexp') . 'app/index.php';
-                       $url = $modUrl . '?tx_impexp[action]=export&id=' . ($table == 'pages' ? $uid : $backRef->rec['pid']);
+                       $urlParameters = array(
+                               'tx_impexp' => array(
+                                       'action' => 'export'
+                               ),
+                               'id' => ($table == 'pages' ? $uid : $backRef->rec['pid'])
+                       );
                        if ($table == 'pages') {
-                               $url .= '&tx_impexp[pagetree][id]=' . $uid;
-                               $url .= '&tx_impexp[pagetree][levels]=0';
-                               $url .= '&tx_impexp[pagetree][tables][]=_ALL';
+                               $urlParameters['tx_impexp']['pagetree']['id'] = $uid;
+                               $urlParameters['tx_impexp']['pagetree']['levels'] = 0;
+                               $urlParameters['tx_impexp']['pagetree']['tables'][] = '_ALL';
                        } else {
-                               $url .= '&tx_impexp[record][]=' . rawurlencode(($table . ':' . $uid));
-                               $url .= '&tx_impexp[external_ref][tables][]=_ALL';
+                               $urlParameters['tx_impexp']['record'][] = rawurlencode($table . ':' . $uid);
+                               $urlParameters['tx_impexp']['external_ref']['tables'][] = '_ALL';
                        }
+                       $url = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('xMOD_tximpexp', $urlParameters);
                        $localItems[] = $backRef->linkItem($GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->getLLL('export', $LL)), $backRef->excludeIcon(\TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-export-t3d')), $backRef->urlRefForCM($url), 1);
                        if ($table == 'pages') {
-                               $url = $modUrl . '?id=' . $uid . '&table=' . $table . '&tx_impexp[action]=import';
+                               $urlParameters = array(
+                                       'id' => $uid,
+                                       'table' => $table,
+                                       'tx_impexp' => array(
+                                               'action' => 'import'
+                                       ),
+                               );
+                               $url = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('xMOD_tximpexp', $urlParameters);
                                $localItems[] = $backRef->linkItem($GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->getLLL('import', $LL)), $backRef->excludeIcon(\TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-import-t3d')), $backRef->urlRefForCM($url), 1);
                        }
                }
index 0993ac2..6ef7428 100644 (file)
@@ -61,6 +61,7 @@ class ImportExportController extends \TYPO3\CMS\Backend\Module\BaseScriptClass {
         * @todo Define visibility
         */
        public function main() {
+               $GLOBALS['LANG']->includeLLFile('EXT:impexp/app/locallang.xlf');
                // Start document template object:
                $this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
                $this->doc->backPath = $GLOBALS['BACK_PATH'];
index aee7ca1..6e07eab 100644 (file)
@@ -1,5 +1,5 @@
 <?php
 define('TYPO3_MOD_PATH', 'sysext/impexp/app/');
 $BACK_PATH = '../../../';
-// xMOD_[modulename][optional: '_something']
 $MCONF['name'] = 'xMOD_tximpexp';
+$MCONF['script'] = '_DISPATCH';
index c81f9b1..f67218e 100644 (file)
  *
  * external_ref[tables][]=table/_ALL
  */
-unset($MCONF);
-require __DIR__ . '/conf.php';
-require_once $BACK_PATH . 'init.php';
-$LANG->includeLLFile('EXT:impexp/app/locallang.xlf');
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('impexp', 1);
+
 /*
  * @deprecated since 6.0, the classname SC_mod_tools_log_index and this file is obsolete
  * and will be removed with 6.2. The class was renamed and is now located at:
  * typo3/sysext/impexp/Classes/Controller/ImportExportController.php
  */
-require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('impexp') . 'Classes/Controller/ImportExportController.php';
 // Make instance:
 $SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Impexp\\Controller\\ImportExportController');
 $SOBE->init();
index a396e82..8f47c96 100644 (file)
@@ -50,4 +50,5 @@ if (TYPO3_MODE === 'BE') {
                        }
                }
        ';
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModulePath('xMOD_tximpexp', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'app/');
 }