Fixed bug #14717: [Usability] Add delay to close the context menu
[Packages/TYPO3.CMS.git] / typo3 / backend.php
index f7db92c..1d7f410 100644 (file)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 2007-2009 Ingo Renner <ingo@typo3.org>
+*  (c) 2007-2010 Ingo Renner <ingo@typo3.org>
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -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);
@@ -485,8 +497,7 @@ class TYPO3backend {
        var fsMod = new fsModules();' . $moduleFramesHelper . ';';
 
                        // add goToModule code
-               $pageRenderer = $GLOBALS['TBE_TEMPLATE']->getPageRenderer();
-               $pageRenderer->addExtOnReadyCode('
+               $this->pageRenderer->addExtOnReadyCode('
                        top.goToModule = ' . $goToModuleSwitch . ';
                ');
 
@@ -569,8 +580,7 @@ class TYPO3backend {
 
                $moduleParameters = t3lib_div::_GET('modParams');
                if($startModule) {
-                       $pageRenderer = $GLOBALS['TBE_TEMPLATE']->getPageRenderer();
-                       $pageRenderer->addExtOnReadyCode('
+                       $this->pageRenderer->addExtOnReadyCode('
                        // start in module:
                function startInModule(modName, cMR_flag, addGetVars)   {
                        Ext.onReady(function() {