Index: typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php =================================================================== --- typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php (révision 7701) +++ typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php (copie de travail) @@ -83,6 +83,7 @@ public $RTEdivStyle; // Relative path to this extension. It ends with "/" public $extHttpPath; + public $backPath = ''; // TYPO3 site url public $siteURL; // TYPO3 host url @@ -209,8 +210,10 @@ * INIT THE EDITOR-SETTINGS * ======================================= */ + // Set backPath + $this->backPath = $this->isFrontendEditActive() ? '' : $this->TCEform->backPath; // Get the path to this extension: - $this->extHttpPath = $this->TCEform->backPath . t3lib_extMgm::extRelPath($this->ID); + $this->extHttpPath = $this->backPath . ($this->isFrontendEditActive() ? t3lib_extMgm::siteRelPath($this->ID) : t3lib_extMgm::extRelPath($this->ID)); // Get the site URL $this->siteURL = t3lib_div::getIndpEnv('TYPO3_SITE_URL'); // Get the host URL @@ -1110,7 +1113,11 @@ if ($this->is_FE()) { return ($GLOBALS['TSFE']->absRefPrefix ? $GLOBALS['TSFE']->absRefPrefix : '') . t3lib_div::createVersionNumberedFilename($relativeFilename); } else { - return t3lib_div::createVersionNumberedFilename('../' . $this->TCEform->backPath . $relativeFilename); + $filename = t3lib_div::createVersionNumberedFilename('../' . $this->backPath . $relativeFilename); + if ($this->isFrontendEditActive()) { + $filename = preg_replace('/^..\//', '', $filename); + } + return $filename; } } /** @@ -1147,10 +1154,13 @@ } else { if ($compress) { $compressor = t3lib_div::makeInstance('t3lib_compressor'); - $filename = $compressor->compressJsFile('../' . $this->TCEform->backPath . $relativeFilename); + $filename = $compressor->compressJsFile('../' . $this->backPath . $relativeFilename); } else { - $filename = t3lib_div::createVersionNumberedFilename('../' . $this->TCEform->backPath . $relativeFilename); + $filename = t3lib_div::createVersionNumberedFilename('../' . $this->backPath . $relativeFilename); } + if ($this->isFrontendEditActive()) { + $filename = preg_replace('/^..\//', '', $filename); + } } return $filename; } @@ -1305,12 +1315,12 @@ list($extKey,$local) = explode('/',substr($filename,4),2); $newFilename = ''; if (strcmp($extKey,'') && t3lib_extMgm::isLoaded($extKey) && strcmp($local,'')) { - $newFilename = ($this->is_FE() ? t3lib_extMgm::siteRelPath($extKey) : $this->TCEform->backPath . t3lib_extMgm::extRelPath($extKey)) . $local; + $newFilename = ($this->is_FE() ? t3lib_extMgm::siteRelPath($extKey) : $this->backPath . t3lib_extMgm::extRelPath($extKey)) . $local; } } elseif (substr($filename,0,1) != '/') { - $newFilename = ($this->is_FE() ? '' : '../' . $this->TCEform->backPath) . $filename; + $newFilename = ($this->is_FE() ? '' : ($this->isFrontendEditActive() ? '' : '../') . $this->backPath) . $filename; } else { - $newFilename = ($this->is_FE() ? '' : '../' . $this->TCEform->backPath) . substr($filename, 1); + $newFilename = ($this->is_FE() ? '' : ($this->isFrontendEditActive() ? '' : '../') . $this->backPath) . substr($filename, 1); } return $newFilename; } @@ -1350,9 +1360,17 @@ */ function is_FE() { - global $TSFE; - return is_object($TSFE) && is_array($this->LOCAL_LANG) && !strstr($this->elementId,'TSFE_EDIT'); + return is_object($GLOBALS['TSFE']) && !$this->isFrontendEditActive(); } + + /** + * Checks whether frontend editing is active. + * + * @return boolean + */ + public function isFrontendEditActive() { + return is_object($GLOBALS['TSFE']) && $GLOBALS['TSFE']->beUserLogin && ($GLOBALS['BE_USER']->frontendEdit instanceof t3lib_frontendedit); + } /** * Client Browser Information Index: typo3/sysext/rtehtmlarea/extensions/SpellChecker/class.tx_rtehtmlarea_spellchecker.php =================================================================== --- typo3/sysext/rtehtmlarea/extensions/SpellChecker/class.tx_rtehtmlarea_spellchecker.php (révision 7701) +++ typo3/sysext/rtehtmlarea/extensions/SpellChecker/class.tx_rtehtmlarea_spellchecker.php (copie de travail) @@ -96,7 +96,7 @@ RTEarea['.$RTEcounter.'].buttons.'. $button .'.spellCheckerMode = "' . $spellCheckerMode .'"; RTEarea['.$RTEcounter.'].buttons.'. $button .'.enablePersonalDicts = ' . ($enablePersonalDicts ? 'true' : 'false') .';'; $registerRTEinJavascriptString .= ' - RTEarea['.$RTEcounter.'].buttons.'. $button .'.path = "' . ($this->htmlAreaRTE->is_FE() ? ($GLOBALS['TSFE']->absRefPrefix ? $GLOBALS['TSFE']->absRefPrefix : '') . 'index.php?eID=rtehtmlarea_spellchecker' : $this->htmlAreaRTE->TCEform->backPath . 'ajax.php?ajaxID=rtehtmlarea::spellchecker') . '";'; + RTEarea['.$RTEcounter.'].buttons.'. $button .'.path = "' . (($this->htmlAreaRTE->is_FE() || $this->htmlAreaRTE->isFrontendEditActive()) ? ($GLOBALS['TSFE']->absRefPrefix ? $GLOBALS['TSFE']->absRefPrefix : '') . 'index.php?eID=rtehtmlarea_spellchecker' : $this->htmlAreaRTE->backPath . 'ajax.php?ajaxID=rtehtmlarea::spellchecker') . '";'; } return $registerRTEinJavascriptString; } Index: typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js =================================================================== --- typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js (révision 7701) +++ typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js (copie de travail) @@ -2845,8 +2845,8 @@ var docHeader = Ext.get('typo3-docheader'); if (docHeader) { size.height -= docHeader.getHeight(); + docHeader.dom = null; } - docHeader.dom = null; return size; } } Index: typo3/sysext/rtehtmlarea/pi2/class.tx_rtehtmlarea_pi2.php =================================================================== --- typo3/sysext/rtehtmlarea/pi2/class.tx_rtehtmlarea_pi2.php (révision 7701) +++ typo3/sysext/rtehtmlarea/pi2/class.tx_rtehtmlarea_pi2.php (copie de travail) @@ -81,7 +81,7 @@ // Get the path to this extension: $this->extHttpPath = t3lib_extMgm::siteRelPath($this->ID); // Get the site URL - $this->siteURL = t3lib_div::getIndpEnv('TYPO3_SITE_URL'); + $this->siteURL = $GLOBALS['TSFE']->absRefPrefix ? $GLOBALS['TSFE']->absRefPrefix : ''; // Get the host URL $this->hostURL = ''; // Element ID + pid @@ -207,14 +207,14 @@ // Preloading the pageStyle and including RTE skin stylesheets $this->addPageStyle(); $this->addSkin(); - $pageRenderer->addCssFile($this->hostURL . '/t3lib/js/extjs/ux/resize.css'); + $pageRenderer->addCssFile($this->siteURL . 't3lib/js/extjs/ux/resize.css'); // Loading JavaScript files and code $pageRenderer->loadExtJs(); $pageRenderer->enableExtJSQuickTips(); if (!$GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->ID]['enableCompressedScripts']) { $pageRenderer->enableExtJsDebug(); } - $pageRenderer->addJsFile($this->hostURL . '/t3lib/js/extjs/ux/ext.resizable.js'); + $pageRenderer->addJsFile($this->siteURL . 't3lib/js/extjs/ux/ext.resizable.js'); if ($this->TCEform->RTEcounter == 1) { $this->TCEform->additionalJS_pre['rtehtmlarea-loadJScode'] = $this->loadJScode($this->TCEform->RTEcounter); } @@ -273,6 +273,14 @@ $pageRenderer->addCssFile($href, $relation, 'screen', $title); } /** + * Return true if we are in the FE, but not in the FE editing feature of BE. + * + * @return boolean + */ + function is_FE() { + return true; + } + /** * Return the JS-Code for copy the HTML-Code from the editor in the hidden input field. * This is for submit function from the form. *