Project

General

Profile

Bug #21041 » 11933_v2.diff

Administrator Admin, 2009-09-13 17:54

View differences:

typo3/template.php (working copy)
* 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.
......
* @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) . '});');
// add applied JS to $GLOBALS['TSFE']
// don't apply CSS styles because we are in FE
$this->backPath = $GLOBALS['TSFE']->backPath = 'typo3/';
if ($this->JScode) {
$GLOBALS['TSFE']->addHeaderData($this->JScode);
}
if (count($this->JScodeArray)) {
foreach ($this->JScodeArray as $name => $code) {
$GLOBALS['TSFE']->addJsInlineCode($name, $code);
}
}
if ($this->addPrototype) {
$GLOBALS['TSFE']->loadPrototype();
}
if ($this->addScriptaculous) {
$GLOBALS['TSFE']->loadScriptaculous();
}
if ($this->addExtJS) {
$GLOBALS['TSFE']->loadExtJs();
}
if ($this->inlineLanguageLabels) {
$GLOBALS['TSFE']->addInlineLanguageLabelArray($this->inlineLanguageLabels);
}
if ($this->inlineSettings) {
$GLOBALS['TSFE']->addInlineSettingArray($this->inlineSettings);
}
}
}
(2-2/3)