Fixed bug #9346: Preinitialise GLOBALS[LANG] in init.php
authorDmitry Dulepov <dmitry.dulepov@gmail.com>
Thu, 18 Sep 2008 17:37:10 +0000 (17:37 +0000)
committerDmitry Dulepov <dmitry.dulepov@gmail.com>
Thu, 18 Sep 2008 17:37:10 +0000 (17:37 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@4144 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/ajax.php
typo3/classes/class.modulemenu.php
typo3/classes/class.shortcutmenu.php
typo3/init.php
typo3/template.php

index db94f8d..ce39807 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2008-09-18  Dmitry Dulepov  <dmitry@typo3.org>
+
+       * Fixed bug #9346: Preinitialise GLOBALS[LANG] in init.php (thanks to Steffen Kamper)
 
 2008-09-17  Martin Kutschker  <masi@typo3.org>
 
index 545a82d..b23abe1 100644 (file)
@@ -34,11 +34,6 @@ $TYPO3_AJAX = true;
 
 require('init.php');
 require('classes/class.typo3ajax.php');
-require_once(PATH_typo3.'sysext/lang/lang.php');
-
-
-$GLOBALS['LANG'] = t3lib_div::makeInstance('language');
-$GLOBALS['LANG']->init($GLOBALS['BE_USER']->uc['lang']);
 
        // finding the script path from the variable
 $ajaxID = (string) t3lib_div::_GP('ajaxID');
index 8905ee9..36dc023 100644 (file)
 
 
 if(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX) {
-       require_once(PATH_typo3.'sysext/lang/lang.php');
-
-       $GLOBALS['LANG'] = t3lib_div::makeInstance('language');
-       $GLOBALS['LANG']->init($GLOBALS['BE_USER']->uc['lang']);
        $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_misc.xml');
 }
 
@@ -552,4 +548,4 @@ if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/class
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/classes/class.modulemenu.php']);
 }
 
-?>
\ No newline at end of file
+?>
index f7c433f..ada67ee 100644 (file)
 if(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX) {
        require_once('interfaces/interface.backend_toolbaritem.php');
        require_once(PATH_t3lib.'class.t3lib_loadmodules.php');
-       require_once(PATH_typo3.'sysext/lang/lang.php');
 
-       $GLOBALS['LANG'] = t3lib_div::makeInstance('language');
-       $GLOBALS['LANG']->init($GLOBALS['BE_USER']->uc['lang']);
        $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_misc.xml');
 
                // needed to get the correct icons when reloading the menu after saving it
index 37ac889..1ece826 100755 (executable)
@@ -164,6 +164,7 @@ require(PATH_t3lib.'config_default.php');
 if (!defined ('TYPO3_db'))     die ('The configuration file was not included.');
 
 require_once(PATH_t3lib.'class.t3lib_db.php');         // The database library
+/** @var TYPO3_DB t3lib_db */
 $TYPO3_DB = t3lib_div::makeInstance('t3lib_DB');
 $TYPO3_DB->debugOutput = $TYPO3_CONF_VARS['SYS']['sqlDebug'];
 
@@ -357,6 +358,13 @@ $BE_USER->trackBeUser($TYPO3_CONF_VARS['BE']['trackBeUser']);      // Tracking backen
 $WEBMOUNTS = $BE_USER->returnWebmounts();              // ! WILL INCLUDE deleted mount pages as well!
 $FILEMOUNTS = $BE_USER->returnFilemounts();
 
+// *******************************
+// $GLOBALS['LANG'] initialisation
+// *******************************  
+require_once(PATH_typo3.'sysext/lang/lang.php');
+$GLOBALS['LANG'] = t3lib_div::makeInstance('language');
+$GLOBALS['LANG']->init($BE_USER->uc['lang']);
+
 
 // ****************
 // CLI processing
index 45ee7dc..5a2934b 100755 (executable)
@@ -2029,15 +2029,6 @@ if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/templ
 
 
 
-// ******************************************************
-// The backend language engine is started (ext: "lang")
-// ******************************************************
-require_once(PATH_typo3.'sysext/lang/lang.php');
-$GLOBALS['LANG'] = t3lib_div::makeInstance('language');
-$GLOBALS['LANG']->init($BE_USER->uc['lang']);
-
-
-
 // ******************************
 // The template is loaded
 // ******************************