/***************************************************************
* Copyright notice
*
-* (c) 2008 Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
+* (c) 2008 Stanislas Rolland <typo3(arobas)sjbr.ca>
* All rights reserved
*
* This script is part of the Typo3 project. The Typo3 project is
/**
* Default Font plugin for htmlArea RTE
*
- * @author Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
+ * @author Stanislas Rolland <typo3(arobas)sjbr.ca>
*
* TYPO3 SVN ID: $Id$
*
$configureRTEInJavascriptString = '';
// Builing JS array of default font faces
+ // utf8-encode labels if we are responding to an IRRE ajax call
$HTMLAreaFontname = array();
$HTMLAreaFontname['nofont'] = '
"' . $fontName . '" : "' . $this->htmlAreaRTE->cleanList($fontValue) . '"';
$defaultFontFacesList = 'nofont,';
if ($this->htmlAreaRTE->is_FE()) {
$HTMLAreaFontname['nofont'] = '
- "' . $TSFE->getLLL('No font', $this->LOCAL_LANG) . '" : ""';
+ "' . $GLOBALS['TSFE']->getLLL('No font', $this->LOCAL_LANG) . '" : ""';
} else {
$HTMLAreaFontname['nofont'] = '
- "' . $LANG->getLL('No font') . '" : ""';
+ "' . ($this->htmlAreaRTE->TCEform->inline->isAjaxCall ? $GLOBALS['LANG']->csConvObj->utf8_encode($GLOBALS['LANG']->getLL('No font'), $GLOBALS['LANG']->charSet) : $GLOBALS['LANG']->getLL('No font')) . '" : ""';
}
$hideFontFaces = $this->htmlAreaRTE->cleanList($this->thisConfig['hideFontFaces']);
foreach ($this->defaultFontFaces as $fontName => $fontValue) {
if (!t3lib_div::inList($hideFontFaces, $index+1)) {
$HTMLAreaFontname[$fontName] = '
- "' . $fontName . '" : "' . $this->htmlAreaRTE->cleanList($fontValue) . '"';
+ "' . ((!$this->htmlAreaRTE->is_FE() && $this->htmlAreaRTE->TCEform->inline->isAjaxCall) ? $GLOBALS['LANG']->csConvObj->utf8_encode($fontName, $GLOBALS['LANG']->charSet) : $fontName) . '" : "' . $this->htmlAreaRTE->cleanList($fontValue) . '"';
$defaultFontFacesList .= $fontName . ',';
}
$index++;
$fontName = substr($fontName,0,-1);
$fontLabel = $this->htmlAreaRTE->getPageConfigLabel($conf['name'],0);
$HTMLAreaFontname[$fontName] = '
- "' . $fontLabel . '" : "' . $this->htmlAreaRTE->cleanList($conf['value']) . '"';
+ "' . ((!$this->htmlAreaRTE->is_FE() && $this->htmlAreaRTE->TCEform->inline->isAjaxCall) ? $GLOBALS['LANG']->csConvObj->utf8_encode($fontLabel, $GLOBALS['LANG']->charSet) : $fontLabel) . '" : "' . $this->htmlAreaRTE->cleanList($conf['value']) . '"';
}
}
$HTMLAreaJSFontSize = '{';
if ($this->htmlAreaRTE->cleanList($this->thisConfig['hideFontSizes']) != '*') {
+ // utf8-encode labels if we are responding to an IRRE ajax call
+ if (!$this->htmlAreaRTE->is_FE() && $this->htmlAreaRTE->TCEform->inline->isAjaxCall) {
+ foreach ($HTMLAreaFontSizes as $FontSizeItem => $FontSizeLabel) {
+ $HTMLAreaFontSizes[$FontSizeItem] = $GLOBALS['LANG']->csConvObj->utf8_encode($FontSizeLabel, $GLOBALS['LANG']->charSet);
+ }
+ }
$HTMLAreaFontSizeIndex = 0;
foreach ($HTMLAreaFontSizes as $FontSizeItem => $FontSizeLabel) {
if($HTMLAreaFontSizeIndex) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/extensions/DefaultFont/class.tx_rtehtmlarea_defaultfont.php']);
}
-?>
\ No newline at end of file
+?>
"' . $GLOBALS['TSFE']->getLLL((($buttonId == 'fontstyle') ? 'No font' : 'No size'), $this->LOCAL_LANG) . '" : ""';
} else {
$items['none'] = '
- "' . $GLOBALS['LANG']->getLL(($buttonId == 'fontstyle') ? 'No font' : 'No size') . '" : ""';
+ "' . ($this->htmlAreaRTE->TCEform->inline->isAjaxCall
+ ? $GLOBALS['LANG']->csConvObj->utf8_encode($GLOBALS['LANG']->getLL(($buttonId == 'fontstyle') ? 'No font' : 'No size'), $GLOBALS['LANG']->charSet)
+ : $GLOBALS['LANG']->getLL(($buttonId == 'fontstyle') ? 'No font' : 'No size')) . '" : ""';
}
$defaultItems = 'none,';
$label = $GLOBALS['TSFE']->getLLL($name,$this->LOCAL_LANG);
} else {
$label = $GLOBALS['LANG']->getLL($name);
+ $label = $this->htmlAreaRTE->TCEform->inline->isAjaxCall ? $GLOBALS['LANG']->csConvObj->utf8_encode($label, $GLOBALS['LANG']->charSet) : $label;
}
$items[$name] = '
- "' . $name . '" : "' . $this->htmlAreaRTE->cleanList($value) . '"';
+ "' . $label . '" : "' . $this->htmlAreaRTE->cleanList($value) . '"';
$defaultItems .= $name . ',';
}
$index++;
foreach ($this->RTEProperties[($buttonId == 'fontstyle') ? 'fonts.' : 'fontSizes.'] as $name => $conf) {
$name = substr($name,0,-1);
$label = $this->htmlAreaRTE->getPageConfigLabel($conf['name'],0);
+ $label = (!$this->htmlAreaRTE->is_FE() && $this->htmlAreaRTE->TCEform->inline->isAjaxCall) ? $GLOBALS['LANG']->csConvObj->utf8_encode($label, $GLOBALS['LANG']->charSet) : $label;
$items[$name] = '
"' . $label . '" : "' . $this->htmlAreaRTE->cleanList($conf['value']) . '"';
}