Index: t3lib/class.t3lib_tceforms.php =================================================================== --- t3lib/class.t3lib_tceforms.php (revision 6273) +++ t3lib/class.t3lib_tceforms.php (working copy) @@ -458,6 +458,7 @@ } } } + $this->finishForm($table, $row); } } } @@ -611,6 +612,7 @@ $cc++; } + $this->finishForm($table, $row); } } } @@ -730,11 +732,29 @@ $out.= $this->getPaletteFields($table,$row,'','',implode(',',t3lib_div::trimExplode('|',$palFields,1))); } } + $this->finishForm($table, $row); return $out; } /** + * "Finisher" tasks, after all fields were processed + * + * @param string The table name + * @param array The record array. + * @return void + */ + function finishForm ($table, $row) { + if ($this->RTEcounter > 0) { + // re-get RTE object, and call RTE finalizer method, if any + $RTEobj = t3lib_BEfunc::RTEgetObj(); + if (method_exists($RTEobj, 'finalizeRTE')) { + $RTEobj->finalizeRTE($this, $table, $row); + } + } + } + + /** * Creates a palette (collection of secondary options). * * @param string The table name Index: typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php =================================================================== --- typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php (revision 6273) +++ typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php (working copy) @@ -332,19 +332,13 @@ $this->RTEdivStyle = 'position:relative; left:0px; top:0px; height:' . $RTEHeight . 'px; width:'.$RTEWidth.'; border: 1px solid black; padding: 2px 2px 2px 2px;'; /* ======================================= - * LOAD CSS AND JAVASCRIPT + * LOAD CSS * ======================================= */ // Preloading the pageStyle and including RTE skin stylesheets $this->addPageStyle(); $this->addSkin(); - // Loading JavaScript files and code - if ($this->TCEform->RTEcounter == 1) { - $this->TCEform->additionalCode_pre['rtehtmlarea-loadJSfiles'] = $this->loadJSfiles($this->TCEform->RTEcounter); - $this->TCEform->additionalJS_pre['rtehtmlarea-loadJScode'] = $this->loadJScode($this->TCEform->RTEcounter); - } - /* ======================================= * DRAW THE EDITOR * ======================================= @@ -403,6 +397,22 @@ } /** + * Finalize RTE, called after all RTE fields were processed. + * + * @param object Reference to parent object, which is an instance of the TCEforms. + * @param string The table name + * @param array The current row from which field is being rendered + * + * @return void + */ + function finalizeRTE($parentObject, $table, $row) { + + // Loading JavaScript files and code + $this->TCEform->additionalCode_pre['rtehtmlarea-loadJSfiles'] = $this->loadJSfiles($this->TCEform->RTEcounter); + $this->TCEform->additionalJS_pre['rtehtmlarea-loadJScode'] = $this->loadJScode($this->TCEform->RTEcounter); + } + + /** * Add link to content style sheet to document header * * @return void