108 $this->TCEform = $parentObject;
118 $this->siteURL =
$GLOBALS[
'TSFE']->absRefPrefix ?:
'';
122 $this->elementId = $PA[
'itemFormElName'];
123 $this->elementParts[0] = $table;
124 $this->elementParts[1] = $row[
'uid'];
125 $this->tscPID = $thePidValue;
126 $this->thePid = $thePidValue;
128 $this->typeVal = $RTEtypeVal;
131 $pageTSConfig = $TSFE->getPagesTSconfig();
132 if (is_array($pageTSConfig) && is_array($pageTSConfig[
'RTE.'])) {
133 $this->RTEsetup = $pageTSConfig[
'RTE.'];
137 } elseif (is_array($this->RTEsetup[
'default.']) && is_array($this->RTEsetup[
'default.'][
'FE.'])) {
138 $this->thisConfig = $this->RTEsetup[
'default.'][
'FE.'];
142 if ($this->thisConfig[
'forceHTTPS']) {
143 $this->extHttpPath = preg_replace(
'/^(http|https)/',
'https', $this->extHttpPath);
144 $this->siteURL = preg_replace(
'/^(http|https)/',
'https', $this->siteURL);
145 $this->hostURL = preg_replace(
'/^(http|https)/',
'https', $this->hostURL);
148 $this->TCEform->RTEwindows[] = $PA[
'itemFormElName'];
149 $textAreaId = preg_replace(
'/[^a-zA-Z0-9_:.-]/',
'_', $PA[
'itemFormElName']);
150 $textAreaId = htmlspecialchars(preg_replace(
'/^[^a-zA-Z]/',
'x', $textAreaId)) .
'_' . strval($this->TCEform->RTEcounter);
158 $this->LOCAL_LANG = \TYPO3\CMS\Core\Utility\GeneralUtility::readLLfile(
'EXT:' . $this->ID .
'/locallang.xml', $this->
language);
162 $this->contentISOLanguage =
$GLOBALS[
'TSFE']->sys_language_isocode ?:
'en';
163 $this->contentLanguageUid = max($row[
'sys_language_uid'], 0);
165 $tableA =
'sys_language';
166 $tableB =
'static_languages';
167 $selectFields = $tableA .
'.uid,' . $tableB .
'.lg_iso_2,' . $tableB .
'.lg_country_iso_2';
168 $tableAB = $tableA .
' LEFT JOIN ' . $tableB .
' ON ' . $tableA .
'.static_lang_isocode=' . $tableB .
'.uid';
169 $whereClause = $tableA .
'.uid = ' . intval($this->contentLanguageUid);
172 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery($selectFields, $tableAB, $whereClause);
173 while ($languageRow =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res)) {
174 $this->contentISOLanguage = strtolower(trim($languageRow[
'lg_iso_2']) . (trim($languageRow[
'lg_country_iso_2']) ?
'_' . trim($languageRow[
'lg_country_iso_2']) :
''));
179 $this->charset = $TSFE->renderCharset;
180 $this->OutputCharset = $TSFE->metaCharset ?: $TSFE->renderCharset;
183 $this->contentCharset = $this->contentCharset ?:
'utf-8';
195 if (isset($this->thisConfig[
'RTEWidthOverride'])) {
196 if (strstr($this->thisConfig[
'RTEWidthOverride'],
'%')) {
197 if ($this->client[
'browser'] !=
'msie') {
198 $width = (int)$this->thisConfig[
'RTEWidthOverride'] > 0 ? $this->thisConfig[
'RTEWidthOverride'] :
'100%';
201 $width = (int)$this->thisConfig[
'RTEWidthOverride'] > 0 ? (
int)$this->thisConfig[
'RTEWidthOverride'] : $width;
204 $RTEWidth = strstr($width,
'%') ? $width : $width .
'px';
205 $editorWrapWidth = strstr($width,
'%') ? $width : ($width + 2) .
'px';
207 $RTEHeightOverride = (int)$this->thisConfig[
'RTEHeightOverride'];
208 $height = $RTEHeightOverride > 0 ? $RTEHeightOverride : $height;
209 $RTEHeight = $height .
'px';
210 $editorWrapHeight = ($height + 2) .
'px';
211 $this->RTEWrapStyle = $this->RTEWrapStyle ?: ($this->RTEdivStyle ?:
'height:' . $editorWrapHeight .
'; width:' . $editorWrapWidth .
';');
212 $this->RTEdivStyle = $this->RTEdivStyle ?:
'position:relative; left:0px; top:0px; height:' . $RTEHeight .
'; width:' . $RTEWidth .
'; border: 1px solid black;';
219 $this->TCEform->additionalJS_post[] = $this->
wrapCDATA($this->
registerRTEinJS($this->TCEform->RTEcounter,
'',
'',
'', $textAreaId));
221 $this->TCEform->additionalJS_submit[] = $this->
setSaveRTE($this->TCEform->RTEcounter, $this->TCEform->formName, $textAreaId);
223 if (!is_array(
$GLOBALS[
'TSFE']->pSetup[
'javascriptLibs.'][
'ExtJs.'])) {
224 $this->pageRenderer->loadExtJs();
225 $this->pageRenderer->enableExtJSQuickTips();
227 $this->pageRenderer->addJsFile($this->
getFullFileName(
'typo3/js/extjs/ux/ext.resizable.js'));
228 $this->pageRenderer->addJsFile(
'sysext/backend/Resources/Public/JavaScript/notifications.js');
231 $this->pageRenderer->addCssFile($this->siteURL .
'typo3/contrib/extjs/resources/css/ext-all-notheme.css');
232 $this->pageRenderer->addCssFile($this->siteURL .
'typo3/sysext/t3skin/extjs/xtheme-t3skin.css');
234 $this->pageRenderer->addCssFile($this->siteURL .
'typo3/js/extjs/ux/resize.css');
238 $this->pageRenderer->addJsInlineCode(
'HTMLArea-init', $this->
getRteInitJsCode(), TRUE);
246 foreach ($this->registeredPlugins as $pluginId => $plugin) {
247 if ($this->
isPluginEnabled($pluginId) && method_exists($plugin,
'transformContent')) {
248 $value = $plugin->transformContent($value);
253 <div id="pleasewait' . $textAreaId .
'" class="pleasewait" style="display: block;" >' . $TSFE->csConvObj->conv($TSFE->getLLL(
'Please wait', $this->LOCAL_LANG),
$this->charset, $TSFE->renderCharset) .
'</div> 254 <div id="editorWrap' . $textAreaId .
'" class="editorWrap" style="visibility: hidden; ' . htmlspecialchars($this->RTEWrapStyle) .
'"> 269 protected function addStyleSheet($key, $href, $title =
'', $relation =
'stylesheet') {
270 $this->pageRenderer->addCssFile($href, $relation,
'screen', $title);
283 public function setSaveRTE($RTEcounter, $form, $textareaId) {
285 if (RTEarea[\'' . $textareaId .
'\'] && !RTEarea[\
'' . $textareaId .
'\'].deleted) {
286 var field = document.getElementById(\
'RTEarea' . $textareaId .
'\');
287 if (field && field.nodeName.toLowerCase() == \
'textarea\') { 288 field.value = RTEarea[\'' . $textareaId .
'\'][\
'editor\'].getHTML(); 301 if (!isset($this->pageRenderer)) {
302 $this->pageRenderer =
$GLOBALS[
'TSFE']->getPageRenderer();
303 $this->pageRenderer->setBackPath(TYPO3_mainDir);
315 return implode(LF, array(
$TYPO3_CONF_VARS['SYS']['contentTable']
getFullFileName($filename)
static formatForTextarea($content)
buildJSMainLangFile($RTEcounter)
setSaveRTE($RTEcounter, $form, $textareaId)
isPluginEnabled($pluginId)
transformContent($dirRTE, $value, $table, $field, $row, $specConf, $thisConfig, $RTErelPath, $pid)
static isLoaded($key, $exitOnError=FALSE)
registerRTEinJS($RTEcounter, $table='', $uid='', $field='', $textAreaId='')
static convertVersionNumberToInteger($versionNumber)
addRteJsFiles($RTEcounter)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
clientInfo($userAgent='')
static BEenableFields($table, $inv=0)
static deleteClause($table, $tableAlias='')
initializeToolbarConfiguration()
addStyleSheet($key, $href, $title='', $relation='stylesheet')
drawRTE(&$parentObject, $table, $field, $row, $PA, $specConf, $thisConfig, $RTEtypeVal, $RTErelPath, $thePidValue)