* Fixed bug #7450: htmlArea RTE: localization is broken when the RTE is used by a...
authorStanislas Rolland <typo3@sjbr.ca>
Thu, 7 Feb 2008 18:15:01 +0000 (18:15 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Thu, 7 Feb 2008 18:15:01 +0000 (18:15 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3124 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/class.tx_rtehtmlareaapi.php
typo3/sysext/rtehtmlarea/extensions/BlockElements/class.tx_rtehtmlarea_blockelements.php
typo3/sysext/rtehtmlarea/extensions/DefaultFont/class.tx_rtehtmlarea_defaultfont.php
typo3/sysext/rtehtmlarea/extensions/InlineElements/class.tx_rtehtmlarea_inlineelements.php
typo3/sysext/rtehtmlarea/pi2/class.tx_rtehtmlarea_pi2.php

index da8fa0c..a3bbe8a 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
 2008-02-07  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
 
        * Fixed bug #4588: Frontend htmlArea RTE loads global RTE config instead of function parameter $thisConfig
+       * Fixed bug #7450: htmlArea RTE: localization is broken when the RTE is used by a frontend plugin
 
 2008-02-07  Benjamin Mack  <mack@xnos.org>
 
index 6b71993..7b6f0b5 100644 (file)
@@ -1,6 +1,7 @@
 2008-02-07  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
 
        * Fixed bug #4588: Frontend htmlArea RTE loads global RTE config instead of function parameter $thisConfig
+       * Fixed bug #7450: htmlArea RTE: localization is broken when the RTE is used by a frontend plugin
 
 2008-02-06  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
 
index 434fb9a..03778f0 100644 (file)
@@ -56,12 +56,13 @@ abstract class tx_rtehtmlareaapi {
         * @return      boolean         true if this plugin object should be made available in the current environment and is correctly initialized
         */
        public function main($parentObject) {
-               global $TYPO3_CONF_VARS, $LANG;
+               global $TYPO3_CONF_VARS, $LANG, $TSFE;
                
                $this->htmlAreaRTE =& $parentObject;
                $this->rteExtensionKey =& $this->htmlAreaRTE->ID;
                $this->thisConfig =& $this->htmlAreaRTE->thisConfig;
                $this->toolbar =& $this->htmlAreaRTE->toolbar;
+               $this->LOCAL_LANG =& $this->htmlAreaRTE->LOCAL_LANG;
                
                        // Check if the plugin should be disabled in frontend
                if ($this->htmlAreaRTE->is_FE() && $TYPO3_CONF_VARS['EXTCONF'][$this->rteExtensionKey]['plugins'][$this->pluginName]['disableInFE']) {
@@ -70,7 +71,7 @@ abstract class tx_rtehtmlareaapi {
                        // Localization array must be initialized here
                if ($this->relativePathToLocallangFile) {
                        if ($this->htmlAreaRTE->is_FE()) {
-                               $this->LOCAL_LANG = t3lib_div::readLLfile('EXT:' . $this->extensionKey . '/' . $this->relativePathToLocallangFile, $this->htmlAreaRTE->language);
+                               $this->LOCAL_LANG = array_merge_recursive($this->LOCAL_LANG, t3lib_div::readLLfile('EXT:' . $this->extensionKey . '/' . $this->relativePathToLocallangFile, $this->htmlAreaRTE->language));
                        } else {
                                $LANG->includeLLFile('EXT:' . $this->extensionKey . '/' . $this->relativePathToLocallangFile);
                        }
index bf879f3..5da4643 100644 (file)
@@ -134,7 +134,7 @@ class tx_rtehtmlarea_blockelements extends tx_rtehtmlareaapi {
                        if ($this->htmlAreaRTE->cleanList($this->thisConfig['hidePStyleItems']) != '*') {
                                foreach ($blockElementsOrder as $item) {
                                        if ($this->htmlAreaRTE->is_FE()) {
-                                               $blockElementsOptions[$item] = $TSFE->csConvObj->conv($TSFE->getLLL($this->defaultBlockElements[$item],$this->LOCAL_LANG), $TSFE->labelsCharset, $TSFE->renderCharset);
+                                               $blockElementsOptions[$item] = $TSFE->csConvObj->conv($TSFE->getLLL($this->defaultBlockElements[$item],$this->LOCAL_LANG), $this->htmlAreaRTE->charset, $this->htmlAreaRTE->OutputCharset);
                                        } else {
                                                $blockElementsOptions[$item] = $LANG->getLL($this->defaultBlockElements[$item]);
                                        }
index 653816e..7f17364 100644 (file)
@@ -134,7 +134,7 @@ class tx_rtehtmlarea_defaultfont extends tx_rtehtmlareaapi {
                $defaultFontFacesList = 'nofont,';
                if ($this->htmlAreaRTE->is_FE()) {
                        $HTMLAreaFontname['nofont'] = '
-                               "' . $TSFE->csConvObj->conv($TSFE->getLLL('No font',$this->LOCAL_LANG), $TSFE->labelsCharset, $TSFE->renderCharset) . '" : ""';
+                               "' . $TSFE->csConvObj->conv($TSFE->getLLL('No font',$this->LOCAL_LANG), $this->htmlAreaRTE->charset, $this->htmlAreaRTE->OutputCharset) . '" : ""';
                } else {
                        $HTMLAreaFontname['nofont'] = '
                                "' . $LANG->getLL('No font') . '" : ""';
@@ -201,7 +201,7 @@ class tx_rtehtmlarea_defaultfont extends tx_rtehtmlareaapi {
                        // Builing JS array of default font sizes
                $HTMLAreaFontSizes = array();
                if ($this->htmlAreaRTE->is_FE()) {
-                       $HTMLAreaFontSizes[0] = $TSFE->csConvObj->conv($TSFE->getLLL('No size',$this->LOCAL_LANG), $TSFE->labelsCharset, $TSFE->renderCharset);
+                       $HTMLAreaFontSizes[0] = $TSFE->csConvObj->conv($TSFE->getLLL('No size',$this->LOCAL_LANG), $this->htmlAreaRTE->charset, $this->htmlAreaRTE->OutputCharset);
                } else {
                        $HTMLAreaFontSizes[0] = $LANG->getLL('No size');
                }
index de123e2..771905e 100644 (file)
@@ -146,7 +146,7 @@ class tx_rtehtmlarea_inlineelements extends tx_rtehtmlareaapi {
                if (in_array('formattext', $this->toolbar)) {
                        if (!is_array( $this->thisConfig['buttons.']) || !is_array( $this->thisConfig['buttons.']['formattext.'])) {
                                $registerRTEinJavascriptString .= '
-                       RTEarea['.$RTEcounter.']["buttons"]["formattext"] = new Object();';
+                       RTEarea['.$RTEcounter.'].buttons.formattext = new Object();';
                        }
                        
                                // Default inline elements
@@ -183,7 +183,7 @@ class tx_rtehtmlarea_inlineelements extends tx_rtehtmlareaapi {
                        $inlineElementsOptions = array();
                        foreach ($inlineElementsOrder as $item) {
                                if ($this->htmlAreaRTE->is_FE()) {
-                                       $inlineElementsOptions[$this->buttonToInlineElement[$item]] = $TSFE->csConvObj->conv($TSFE->getLLL($this->defaultInlineElements[$this->buttonToInlineElement[$item]],$this->LOCAL_LANG), $TSFE->labelsCharset, $TSFE->renderCharset);
+                                       $inlineElementsOptions[$this->buttonToInlineElement[$item]] = $TSFE->csConvObj->conv($TSFE->getLLL($this->defaultInlineElements[$this->buttonToInlineElement[$item]],$this->LOCAL_LANG), $this->htmlAreaRTE->charset, $this->htmlAreaRTE->OutputCharset);
                                } else {
                                        $inlineElementsOptions[$this->buttonToInlineElement[$item]] = $LANG->getLL($this->defaultInlineElements[$this->buttonToInlineElement[$item]]);
                                }
index 050e7b8..2bf67bd 100644 (file)
@@ -177,7 +177,7 @@ class tx_rtehtmlarea_pi2 extends tx_rtehtmlarea_base {
                }
                
                        // Character set
-               $this->charset = $TSFE->labelsCharset;
+               $this->charset = $TSFE->labelsCharset ? $TSFE->labelsCharset : $TSFE->renderCharset;
                $this->OutputCharset  = $TSFE->metaCharset ? $TSFE->metaCharset : $TSFE->renderCharset;
                
                        // Set the charset of the content