[TASK] Remove direct call to ajax.php in ExtDirect API 01/42101/3
authorWouter Wolters <typo3@wouterwolters.nl>
Wed, 29 Jul 2015 15:41:53 +0000 (17:41 +0200)
committerBenjamin Mack <benni@typo3.org>
Mon, 3 Aug 2015 22:37:35 +0000 (00:37 +0200)
A leftover from the integration of AJAX requests in index.php

Resolves: #68631
Releases: master
Change-Id: I19d4862475abded09740955225fa1a36042e1d08
Reviewed-on: http://review.typo3.org/42101
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Benjamin Mack <benni@typo3.org>
typo3/sysext/core/Classes/ExtDirect/ExtDirectApi.php

index 88e32cf..2504cd5 100755 (executable)
@@ -14,6 +14,7 @@ namespace TYPO3\CMS\Core\ExtDirect;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
@@ -130,13 +131,11 @@ class ExtDirectApi {
         * @return string
         */
        public function getRoutingUrl($namespace) {
-               $url = '';
                if (TYPO3_MODE === 'FE') {
-                       $url = GeneralUtility::locationHeaderUrl('?eID=ExtDirect&action=route&namespace=');
+                       $url = GeneralUtility::locationHeaderUrl('?eID=ExtDirect&action=route&namespace=' . rawurlencode($namespace));
                } else {
-                       $url = GeneralUtility::locationHeaderUrl(GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir . 'ajax.php?ajaxID=ExtDirect::route&namespace=');
+                       $url = BackendUtility::getAjaxUrl('ExtDirect::route', array('namespace' => $namespace));
                }
-               $url .= rawurlencode($namespace);
                return $url;
        }
 
@@ -144,7 +143,6 @@ class ExtDirectApi {
         * Generates the API or reads it from cache
         *
         * @param array $filterNamespaces
-        * @param bool $checkGetParam
         * @return string $javascriptNamespaces
         */
        protected function getExtDirectApi(array $filterNamespaces) {