Index: t3lib/class.t3lib_tceforms.php =================================================================== --- t3lib/class.t3lib_tceforms.php (revision 5476) +++ t3lib/class.t3lib_tceforms.php (working copy) @@ -184,13 +184,6 @@ require_once(PATH_t3lib.'class.t3lib_diff.php'); require_once(PATH_t3lib.'class.t3lib_tceforms_inline.php'); - /** - * Frontend version of TCEForms has been moved into its own file and should - * be included directly by calling scripts. - */ -require_once(PATH_t3lib . 'class.t3lib_tceforms_fe.php'); - - /** * 'TCEforms' - Class for creating the backend editing forms. * Index: t3lib/class.t3lib_tceforms_fe.php =================================================================== --- t3lib/class.t3lib_tceforms_fe.php (revision 5476) +++ t3lib/class.t3lib_tceforms_fe.php (working copy) @@ -150,6 +150,23 @@ } } +require_once(PATH_typo3 . 'template.php'); +$GLOBALS['TBE_TEMPLATE'] = t3lib_div::makeInstance('frontendDoc'); + +/** + * Dummy class that mimics alt_doc and other backend modules, serving as a + * wrapper for the tsfeDoc instance. Called from tceforms. + */ +class t3lib_tceforms_dummy { + public $doc; + + public function __construct() { + $this->doc = $GLOBALS['TBE_TEMPLATE']; + } +} +$GLOBALS['SOBE'] = t3lib_div::makeInstance('t3lib_tceforms_dummy'); + + if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tceforms_fe.php']) { include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tceforms_fe.php']); } Index: typo3/template.php =================================================================== --- typo3/template.php (revision 5476) +++ typo3/template.php (working copy) @@ -2200,6 +2200,31 @@ } +/** + * Extension class for "template" - used in the context of frontend editing. + */ +class frontendDoc extends template { + var $backPath = 'typo3/'; + + /** + * Used in the frontend context to insert header data via TSFE->additionalHeaderData. + * Mimics header inclusion from template->startPage(). + * + * @return void + */ + public function insertHeaderData() { + $GLOBALS['TSFE']->additionalHeaderData['docStyle'] = $this->docStyle(); + $GLOBALS['TSFE']->additionalHeaderData['JSLibraries'] = $this->renderJSlibraries(); + $GLOBALS['TSFE']->additionalHeaderData['JScode'] = $this->JScode; + $GLOBALS['TSFE']->additionalHeaderData['JScodeArray'] = $this->wrapScriptTags(implode("\n", $this->JScodeArray)); + + if ($this->extJScode) { + $GLOBALS['TSFE']->additionalHeaderData['extJScode'] = $this->wrapScriptTags('Ext.onReady(function() {' . chr(10) . $this->extJScode . chr(10) . '});'); + } + } +} + + if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/template.php']) { include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/template.php']); } Index: typo3/sysext/fe_edit/view/class.tx_feedit_editpanel.php =================================================================== --- typo3/sysext/fe_edit/view/class.tx_feedit_editpanel.php (revision 5476) +++ typo3/sysext/fe_edit/view/class.tx_feedit_editpanel.php (working copy) @@ -414,6 +414,8 @@ $finalOut = $tceforms->printNeededJSFunctions_top() . ($conf['edit.']['displayRecord'] ? $content : '') . $panel . ($theCmd=='new' ? $blackLine : '') . $tceforms->printNeededJSFunctions(); + $GLOBALS['SOBE']->doc->insertHeaderData(); + return $finalOut; }