Fixed bug #14618: Bug: Add debug feature to Ext Direct (Thanks to Fabien Udriot)
[Packages/TYPO3.CMS.git] / typo3 / backend.php
index c6bbcb0..c68ce34 100644 (file)
@@ -247,8 +247,20 @@ class TYPO3backend {
                foreach ($this->jsFiles as $jsFile) {
                        $this->pageRenderer->addJsFile($jsFile);
                }
-                       // we mustn't compress this file
-               $this->pageRenderer->addJsFile('ajax.php?ajaxID=ExtDirect::getAPI&namespace=TYPO3.Backend', NULL, FALSE);
+
+                       // Those lines can be removed once we have at least one official ExtDirect router within the backend.
+               $hasExtDirectRouter = FALSE;
+               if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'])) {
+                       foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'] as $key => $value) {
+                               if (strpos($key, 'TYPO3.Backend') !== FALSE) {
+                                       $hasExtDirectRouter = TRUE;
+                                       break;
+                               }
+                       }
+               }
+               if ($hasExtDirectRouter) {
+                       $this->pageRenderer->addJsFile('ajax.php?ajaxID=ExtDirect::getAPI&namespace=TYPO3.Backend', NULL, FALSE);
+               }
 
                $this->generateJavascript();
                $this->pageRenderer->addJsInlineCode('BackendInlineJavascript', $this->js);