Fixed #12244: Improve locallangXMLOverride feature (Thanks to Steffen Gebert), this...
authorBenni Mack <benni.mack@typo3.org>
Sat, 7 Nov 2009 15:39:12 +0000 (15:39 +0000)
committerBenni Mack <benni.mack@typo3.org>
Sat, 7 Nov 2009 15:39:12 +0000 (15:39 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6371 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_div.php
t3lib/config_default.php
typo3/sysext/lang/lang.php

index ee73880..b813026 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-11-07  Benjamin Mack  <benni@typo3.org>
+
+       * Fixed #12244: Improve locallangXMLOverride feature (Thanks to Steffen Gebert), this changes the LLoverride feature to $GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride'] as an array
+
 2009-11-07  Steffen Kamper  <info@sk-typo3.de>
 
        * Fixed bug #12013: tslib_pagegen fails to read mime type of the shortcut icon (thanks to Xavier Perseguers)
index 97d33ea..8ef69a2 100644 (file)
@@ -4401,11 +4401,13 @@ final class t3lib_div {
                                }
                                $fileNotFound = TRUE;
                        }
-                       if (isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['locallangXMLOverride'][$fileRef])) {
-                               $languageOverrideFileName = t3lib_div::getFileAbsFileName($GLOBALS['TYPO3_CONF_VARS']['EXT']['locallangXMLOverride'][$fileRef]);
-                               if (@is_file($languageOverrideFileName)) {
-                                       $languageOverrideArray = t3lib_div::readLLXMLfile($languageOverrideFileName, $langKey, $charset);
-                                       $LOCAL_LANG = t3lib_div::array_merge_recursive_overrule($LOCAL_LANG, $languageOverrideArray);
+                       if (is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride'][$fileRef])) {
+                               foreach ($GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride'][$fileRef] as $overrideFile) {
+                                       $languageOverrideFileName = t3lib_div::getFileAbsFileName($overrideFile);
+                                       if (@is_file($languageOverrideFileName)) {
+                                               $languageOverrideArray = t3lib_div::readLLXMLfile($languageOverrideFileName, $langKey, $charset);
+                                               $LOCAL_LANG = t3lib_div::array_merge_recursive_overrule($LOCAL_LANG, $languageOverrideArray);
+                                       }
                                }
                        }
                }
index 7d1c8c8..b06599f 100644 (file)
@@ -165,6 +165,7 @@ $TYPO3_CONF_VARS = array(
                'exceptionalErrors' => E_ALL ^ E_NOTICE ^ E_WARNING ^ E_USER_ERROR ^ E_USER_NOTICE ^ E_USER_WARNING,    // Integer: The E_* constant that will be handled as an exception by t3lib_error_ErrorHandler. Default is "E_ALL ^ E_NOTICE ^ E_WARNING ^ E_USER_ERROR ^ E_USER_NOTICE ^ E_USER_WARNING" (4341) and "0" if displayError=0. Some values for errors: E_ALL=6143, E_ALL ^ E_NOTICE ^ E_WARNING=6133. See php documentation for more details on this integer.
                'enable_errorDLOG' => 0,                                // Boolean: If set, errors are written to the developer log (requires an installed *devlog* extension).
                'enable_exceptionDLOG' => 0,                    // Boolean: If set, exceptions are written to the developer log (requires an installed *devlog* extension).
+               'locallangXMLOverride' => array(),                              // For extension/overriding of the arrays in 'locallang' files in frontend and backend. See 'Inside TYPO3' for more information.
        ),
        'EXT' => array (        // Options related to the Extension Management
                'noEdit' => TRUE,                                               // Boolean: If set, the Extension Manager does NOT allow extension files to be edited! (Otherwise both local and global extensions can be edited.)
@@ -182,7 +183,6 @@ $TYPO3_CONF_VARS = array(
                'extConf' => array(                                             // Config-options for extensions, stored as serialized arrays by extension-keys. Handled automatically by the EM.
 //                     '--key--' => array()
                ),
-               'locallangXMLOverride' => array(),                                      // For extension/overriding of the arrays in 'locallang' files in frontend and backend. See 'Inside TYPO3' for more information.
        ),
        'BE' => array(          // Backend Configuration.
                'unzip_path' => '',                                             // Path to "unzip".
index dcee446..b8796c6 100755 (executable)
@@ -412,6 +412,8 @@ class language {
                        }
 
                                // Overriding file?
+                               // @deprecated since TYPO3 4.3, remove in TYPO3 4.5, please use the generic method in
+                               // t3lib_div::readLLfile and the global array $GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']
                        if (isset($GLOBALS['TYPO3_CONF_VARS']['BE']['XLLfile'][$fileRef]))      {
                                $ORarray = $this->readLLfile($GLOBALS['TYPO3_CONF_VARS']['BE']['XLLfile'][$fileRef]);
                                $LOCAL_LANG = t3lib_div::array_merge_recursive_overrule($LOCAL_LANG,$ORarray);
@@ -458,4 +460,4 @@ if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/lang/la
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/lang/lang.php']);
 }
 
-?>
\ No newline at end of file
+?>