* Fixed bug #8351: RTE.classes configuration not honoured by htmlArea RTE Insert...
authorStanislas Rolland <typo3@sjbr.ca>
Thu, 8 May 2008 03:38:31 +0000 (03:38 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Thu, 8 May 2008 03:38:31 +0000 (03:38 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3644 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/mod3/class.tx_rtehtmlarea_browse_links.php
typo3/sysext/rtehtmlarea/mod3/class.tx_rtehtmlarea_dam_browse_links.php

index 6365e45..da9f449 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-05-07  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Fixed bug #8351: RTE.classes configuration not honoured by htmlArea RTE Insert/modify link class selector
+
 2008-05-06  Dmitry Dulepov  <dmitry@typo3.org>
 
        * Fixed bug #8330: Missing padding in select lists without icons (thanks to Uschi Renziehausen)
index 5a35657..5ad3349 100644 (file)
@@ -1,3 +1,7 @@
+2008-05-07  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Fixed bug #8351: RTE.classes configuration not honoured by htmlArea RTE Insert/modify link class selector
+
 2008-04-26  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Fixed bug #8254: htmlArea RTE sets invalid link to file selected using DAM media browser. Thanks to Xavier Perseguers.
index 77764c5..a91e845 100644 (file)
@@ -341,7 +341,9 @@ class tx_rtehtmlarea_browse_links extends browse_links {
                                                        if (!$this->setClass && $this->classesAnchorDefault[$anchorType] == $class) {
                                                                $selected = 'selected="selected"';
                                                        }
-                                                       $this->classesAnchorJSOptions[$anchorType] .= '<option ' . $selected . ' value="' .$class . '">' . $class . '</option>';
+                                                       $classLabel = (is_array($RTEsetup['properties']['classes.']) && is_array($RTEsetup['properties']['classes.'][$class.'.']) && $RTEsetup['properties']['classes.'][$class.'.']['name']) ? $this->getPageConfigLabel($RTEsetup['properties']['classes.'][$class.'.']['name'], 0) : $class;
+                                                       $classStyle = (is_array($RTEsetup['properties']['classes.']) && is_array($RTEsetup['properties']['classes.'][$class.'.']) && $RTEsetup['properties']['classes.'][$class.'.']['value']) ? $RTEsetup['properties']['classes.'][$class.'.']['value'] : '';
+                                                       $this->classesAnchorJSOptions[$anchorType] .= '<option ' . $selected . ' value="' .$class . '"' . ($classStyle?' style="'.$classStyle.'"':'') . '>' . $classLabel . '</option>';
                                                }
                                        }
                                        if ($this->classesAnchorJSOptions[$anchorType]) {
@@ -1114,7 +1116,13 @@ class tx_rtehtmlarea_browse_links extends browse_links {
 
                return $code;
        }
-
+       
+       /**
+        * Localize a string using the language of the content element rather than the language of the BE interface
+        *
+        * @param       string          string: the label to be localized
+        * @return      string          Localized string.
+        */
        public function getLLContent($string) {
                global $LANG;
 
@@ -1133,6 +1141,24 @@ class tx_rtehtmlarea_browse_links extends browse_links {
                $LANG->charSet = $BE_charSet;
                return $LLString;
        }
+       
+       /**
+        * Localize a label obtained from Page TSConfig
+        *
+        * @param       string          string: the label to be localized
+        * @return      string          Localized string.
+        */
+       public function getPageConfigLabel($string,$JScharCode=1) {
+               global $LANG;
+               if (strcmp(substr($string,0,4),'LLL:')) {
+                       $label = $string;
+               } else {
+                       $label = $LANG->sL(trim($string));
+               }
+               $label = str_replace('"', '\"', str_replace('\\\'', '\'', $label));
+               $label = $JScharCode ? $LANG->JScharCode($label): $label;
+               return $label;
+       }
 
 }
 
index c8dd790..2713405 100644 (file)
@@ -252,7 +252,9 @@ class tx_rtehtmlarea_dam_browse_links extends tx_dam_browse_media {
                                                        if (!$this->setClass && $this->classesAnchorDefault[$anchorType] == $class) {
                                                                $selected = 'selected="selected"';
                                                        }
-                                                       $this->classesAnchorJSOptions[$anchorType] .= '<option ' . $selected . ' value="' .$class . '">' . $class . '</option>';
+                                                       $classLabel = (is_array($RTEsetup['properties']['classes.']) && is_array($RTEsetup['properties']['classes.'][$class.'.']) && $RTEsetup['properties']['classes.'][$class.'.']['name']) ? $this->getPageConfigLabel($RTEsetup['properties']['classes.'][$class.'.']['name'], 0) : $class;
+                                                       $classStyle = (is_array($RTEsetup['properties']['classes.']) && is_array($RTEsetup['properties']['classes.'][$class.'.']) && $RTEsetup['properties']['classes.'][$class.'.']['value']) ? $RTEsetup['properties']['classes.'][$class.'.']['value'] : '';
+                                                       $this->classesAnchorJSOptions[$anchorType] .= '<option ' . $selected . ' value="' .$class . '"' . ($classStyle?' style="'.$classStyle.'"':'') . '>' . $classLabel . '</option>';
                                                }
                                        }
                                        if ($this->classesAnchorJSOptions[$anchorType]) {
@@ -878,7 +880,13 @@ class tx_rtehtmlarea_dam_browse_links extends tx_dam_browse_media {
                                                        </td>
                                                </tr>';
        }
-
+       
+       /**
+        * Localize a string using the language of the content element rather than the language of the BE interface
+        *
+        * @param       string          string: the label to be localized
+        * @return      string          Localized string.
+        */
        public function getLLContent($string) {
                global $LANG;
 
@@ -897,6 +905,24 @@ class tx_rtehtmlarea_dam_browse_links extends tx_dam_browse_media {
                $LANG->charSet = $BE_charSet;
                return $LLString;
        }
+       
+       /**
+        * Localize a label obtained from Page TSConfig
+        *
+        * @param       string          string: the label to be localized
+        * @return      string          Localized string.
+        */
+       public function getPageConfigLabel($string,$JScharCode=1) {
+               global $LANG;
+               if (strcmp(substr($string,0,4),'LLL:')) {
+                       $label = $string;
+               } else {
+                       $label = $LANG->sL(trim($string));
+               }
+               $label = str_replace('"', '\"', str_replace('\\\'', '\'', $label));
+               $label = $JScharCode ? $LANG->JScharCode($label): $label;
+               return $label;
+       }
 
 }