Project

General

Profile

Bug #21078 ยป 0011985.patch

Administrator Admin, 2009-09-17 18:46

View differences:

tests/t3lib/t3lib_pagerenderer_testcase.php (Arbeitskopie)
/**
* Testcase for the t3lib_pageIncludes class in the TYPO3 core.
* Testcase for the t3lib_PageRenderer class in the TYPO3 core.
*
* @package TYPO3
* @subpackage t3lib
......
*/
class t3lib_PageRenderer_testcase extends tx_phpunit_testcase {
/**
* @var t3lib_pageIncludes
* @var t3lib_PageRenderer
*/
private $fixture;
const PART_COMPLETE = 0;
const PART_HEADER = 1;
const PART_FOOTER = 2;
public function setUp() {
$className = 't3lib_PageRenderer_' . uniqid('test');
eval('
class ' . $className . ' extends t3lib_PageRenderer {
}
');
$this->fixture = new $className();
$this->fixture = new t3lib_PageRenderer();
}
public function tearDown() {
......
$expectedReturnValue = '<tag method="private" name="test" />';
$this->fixture->addFooterData('<tag method="private" name="test" />');
$out = $this->fixture->render(self::PART_FOOTER);
$out = $this->fixture->render(t3lib_PageRenderer::PART_FOOTER);
$this->assertContains(
$expectedReturnValue,
......
$expectedReturnValue = '<script src="fileadmin/test.js" type="text/javascript"></script>';
$this->fixture->addJsFooterLibrary('test', 'fileadmin/test.js');
$out = $this->fixture->render(self::PART_FOOTER);
$out = $this->fixture->render(t3lib_PageRenderer::PART_FOOTER);
$this->assertContains(
$expectedReturnValue,
......
$expectedReturnValue = '<script src="fileadmin/test.js" type="text/javascript"></script>';
$this->fixture->addJsFooterFile('fileadmin/test.js');
$out = $this->fixture->render(self::PART_FOOTER);
$out = $this->fixture->render(t3lib_PageRenderer::PART_FOOTER);
$this->assertContains(
$expectedReturnValue,
......
$expectedReturnValue = 'var x = "testvar"';
$this->fixture->addJsFooterInlineCode('test', 'var x = "testvar"');
$out = $this->fixture->render(self::PART_FOOTER);
$out = $this->fixture->render(t3lib_PageRenderer::PART_FOOTER);
$this->assertContains(
$expectedReturnValue,
......
$this->fixture->loadExtJS();
$this->fixture->addInlineLanguageLabel('myKey', 'myValue');
$out = $this->fixture->enableMoveJsFromHeaderToFooter();
$out = $this->fixture->render(self::PART_FOOTER);
$out = $this->fixture->render(t3lib_PageRenderer::PART_FOOTER);
$this->assertContains(
$expectedReturnValue,
......
$this->fixture->loadExtJS();
$this->fixture->addInlineLanguageLabelArray(array('myKey1' => 'myValue1', 'myKey2' => 'myValue2',));
$out = $this->fixture->enableMoveJsFromHeaderToFooter();
$out = $this->fixture->render(self::PART_FOOTER);
$out = $this->fixture->render(t3lib_PageRenderer::PART_FOOTER);
$this->assertContains(
$expectedReturnValue,
......
$this->fixture->addInlineLanguageLabelArray(array('myKey1' => 'myValue1',));
$this->fixture->addInlineLanguageLabelArray(array('myKey2' => 'myValue2',));
$out = $this->fixture->enableMoveJsFromHeaderToFooter();
$out = $this->fixture->render(self::PART_FOOTER);
$out = $this->fixture->render(t3lib_PageRenderer::PART_FOOTER);
$this->assertContains(
$expectedReturnValue,
......
$this->fixture->loadExtJS();
$this->fixture->addInlineSetting('myApp', 'myKey', 'myValue');
$out = $this->fixture->enableMoveJsFromHeaderToFooter();
$out = $this->fixture->render(self::PART_FOOTER);
$out = $this->fixture->render(t3lib_PageRenderer::PART_FOOTER);
$this->assertContains(
$expectedReturnValue,
......
$this->fixture->loadExtJS();
$this->fixture->addInlineSettingArray('myApp', array('myKey1' => 'myValue1', 'myKey2' => 'myValue2',));
$out = $this->fixture->enableMoveJsFromHeaderToFooter();
$out = $this->fixture->render(self::PART_FOOTER);
$out = $this->fixture->render(t3lib_PageRenderer::PART_FOOTER);
$this->assertContains(
$expectedReturnValue,
......
$this->fixture->addInlineSettingArray('myApp', array('myKey1' => 'myValue1',));
$this->fixture->addInlineSettingArray('myApp', array('myKey2' => 'myValue2',));
$out = $this->fixture->enableMoveJsFromHeaderToFooter();
$out = $this->fixture->render(self::PART_FOOTER);
$out = $this->fixture->render(t3lib_PageRenderer::PART_FOOTER);
$this->assertContains(
$expectedReturnValue,
t3lib/class.t3lib_tceforms.php (Arbeitskopie)
$this->loadJavascriptLib('md5.js');
}
$GLOBALS['SOBE']->doc->loadPrototype();
$GLOBALS['SOBE']->doc->loadExtJS();
/** @var $pageRenderer t3lib_PageRenderer */
$pageRenderer = $GLOBALS['SOBE']->doc->getPageRenderer();
$pageRenderer->loadPrototype();
$pageRenderer->loadExtJS();
// make textareas resizable and flexible
if (!($GLOBALS['BE_USER']->uc['resizeTextareas'] == '0' && $GLOBALS['BE_USER']->uc['resizeTextareas_Flexible'] == '0')) {
......
'textareaFlexible' => (!$GLOBALS['BE_USER']->uc['resizeTextareas_Flexible'] == '0'),
'textareaResize' => (!$GLOBALS['BE_USER']->uc['resizeTextareas'] == '0'),
);
$GLOBALS['SOBE']->doc->addInlineSettingArray('', $resizableSettings);
$pageRenderer->addInlineSettingArray('', $resizableSettings);
$this->loadJavascriptLib('../t3lib/jsfunc.evalfield.js');
......
'dateFormat' => array('j-n-Y', 'G:i j-n-Y'),
'dateFormatUS' => array('n-j-Y', 'G:i n-j-Y'),
);
$GLOBALS['SOBE']->doc->addInlineSettingArray('', $typo3Settings);
$pageRenderer->addInlineSettingArray('', $typo3Settings);
$this->loadJavascriptLib('../t3lib/js/extjs/tceforms.js');
......
// if Suggest fields were processed, add the JS functions
if ($this->suggest->suggestCount > 0) {
$GLOBALS['SOBE']->doc->loadScriptaculous();
$pageRenderer->loadScriptaculous();
$this->loadJavascriptLib('../t3lib/js/jsfunc.tceforms_suggest.js');
}
t3lib/class.t3lib_pagerenderer.php (Arbeitskopie)
* @subpackage t3lib
* $Id$
*/
abstract class t3lib_PageRenderer implements t3lib_Singleton {
class t3lib_PageRenderer implements t3lib_Singleton {
protected $compressJavascript = FALSE;
protected $compressCss = FALSE;
typo3/class.browse_links.php (Arbeitskopie)
$this->doc = t3lib_div::makeInstance('template');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
// Load the Prototype library and browse_links.js
$this->doc->loadPrototype();
$this->doc->getPageRenderer()->loadPrototype();
$this->doc->loadJavascriptLib('js/browse_links.js');
// init hook objects:
typo3/file_list.php (Arbeitskopie)
$this->doc = t3lib_div::makeInstance('template');
$this->doc->backPath = $BACK_PATH;
$this->doc->setModuleTemplate('templates/file_list.html');
$this->doc->loadPrototype();
$this->doc->getPageRenderer()->loadPrototype();
// Validating the input "id" (the path, directory!) and checking it against the mounts of the user.
$this->id = $this->basicFF->is_directory($this->id);
typo3/template.php (Arbeitskopie)
* @package TYPO3
* @subpackage core
*/
class template extends t3lib_PageRenderer {
class template {
// Vars you typically might want to/should set from outside after making instance of this class:
var $backPath = ''; // 'backPath' pointing back to the PATH_typo3
......
var $hasDocheader = true;
// class for render the header / footer
/**
* @var t3lib_PageRenderer
*/
protected $pageRenderer;
protected $pageHeaderFooterTemplateFile = ''; // alternative template file
var $pageHeaderFooterTemplateFile = ''; // alternative template file
/**
* Constructor
* Imports relevant parts from global $TBE_STYLES (colorscheme)
......
*/
function template() {
global $TBE_STYLES;
parent::__construct(TYPO3_mainDir . 'templates/template_page_backend.html');
// Initializes the page rendering object:
$this->getPageRenderer();
// Setting default scriptID:
if (($temp_M = (string) t3lib_div::_GET('M')) && $GLOBALS['TBE_MODULES']['_PATHS'][$temp_M]) {
$this->scriptID = preg_replace('/^.*\/(sysext|ext)\//', 'ext/', $GLOBALS['TBE_MODULES']['_PATHS'][$temp_M] . 'index.php');
......
}
/**
* Gets instance of PageRenderer
*
* @return t3lib_PageRenderer
*/
public function getPageRenderer() {
if (!isset($this->pageRenderer)) {
$this->pageRenderer = t3lib_div::makeInstance('t3lib_PageRenderer');
$this->pageRenderer->setTemplateFile(
TYPO3_mainDir . 'templates/template_page_backend.html'
);
}
return $this->pageRenderer;
}
......
/*****************************************
*
* EVALUATION FUNCTIONS
......
}
}
$this->pageRenderer->backPath = $this->backPath;
// alternative template for Header and Footer
if ($this->pageHeaderFooterTemplateFile) {
$file = t3lib_div::getFileAbsFileName($this->pageHeaderFooterTemplateFile, TRUE);
if ($file) {
$this->setAlternativeTemplateFile($file);
$this->pageRenderer->setTemplateFile($file);
}
}
// For debugging: If this outputs "QuirksMode"/"BackCompat" (IE) the browser runs in quirks-mode. Otherwise the value is "CSS1Compat"
......
header ('Content-Type:text/html;charset='.$this->charset);
// Standard HTML tag
$this->setHtmlTag('<html xmlns="http://www.w3.org/1999/xhtml">');
$this->pageRenderer->setHtmlTag('<html xmlns="http://www.w3.org/1999/xhtml">');
switch($this->docType) {
case 'html_3':
......
}
}
$this->setXmlPrologAndDocType($headerStart);
$this->setHeadTag('<head>' . chr(10). '<!-- TYPO3 Script ID: '.htmlspecialchars($this->scriptID).' -->');
$this->setCharSet($this->charset);
$this->addMetaTag($this->generator());
$this->setTitle($title);
$this->pageRenderer->setXmlPrologAndDocType($headerStart);
$this->pageRenderer->setHeadTag('<head>' . chr(10). '<!-- TYPO3 Script ID: '.htmlspecialchars($this->scriptID).' -->');
$this->pageRenderer->setCharSet($this->charset);
$this->pageRenderer->addMetaTag($this->generator());
$this->pageRenderer->setTitle($title);
// add docstyles
$this->docStyle();
// add jsCode - has to go to headerData as it may contain the script tags already
$this->addHeaderData($this->JScode);
$this->pageRenderer->addHeaderData($this->JScode);
foreach ($this->JScodeArray as $name => $code) {
$this->addJsInlineCode($name, $code);
$this->pageRenderer->addJsInlineCode($name, $code);
}
if (count($this->JScodeLibArray)) {
foreach($this->JScodeLibArray as $library) {
$this->addHeaderData($library);
$this->pageRenderer->addHeaderData($library);
}
}
if ($this->extJScode) {
$this->addJsHandlerCode($this->extJScode, t3lib_pageIncludes::JSHANDLER_EXTONREADY);
$this->pageRenderer->addExtOnReadyCode($this->extJScode);
}
// Construct page header.
$str = $this->render(1);
$str = $this->pageRenderer->render(t3lib_PageRenderer::PART_HEADER);
$this->JScodeLibArray = array();
$this->JScode = $this->extJScode = '';
$this->JScodeArray = array();
$this->endOfPageJsBlock = $this->render(2);
$this->endOfPageJsBlock = $this->pageRenderer->render(t3lib_PageRenderer::PART_FOOTER);
if ($this->docType=='xhtml_frames') {
return $str;
......
$inDocStyles = implode(chr(10), $this->inDocStylesArray);
if ($this->styleSheetFile) {
$this->addCssFile($this->backPath . $this->styleSheetFile);
$this->pageRenderer->addCssFile($this->backPath . $this->styleSheetFile);
}
if ($this->styleSheetFile2) {
$this->addCssFile($this->backPath . $this->styleSheetFile2);
$this->pageRenderer->addCssFile($this->backPath . $this->styleSheetFile2);
}
$this->addCssInlineBlock('inDocStyles', $inDocStyles . chr(10) . '/*###POSTCSSMARKER###*/');
$this->pageRenderer->addCssInlineBlock('inDocStyles', $inDocStyles . chr(10) . '/*###POSTCSSMARKER###*/');
if ($this->styleSheetFile_post) {
$this->addCssFile($this->backPath . $this->styleSheetFile_post);
$this->pageRenderer->addCssFile($this->backPath . $this->styleSheetFile_post);
}
}
......
* @return void
*/
function addStyleSheet($key, $href, $title='', $relation='stylesheet') {
$this->addCssFile($this->backPath . $href, $relation, $title);
$this->pageRenderer->addCssFile($this->backPath . $href, $relation, $title);
}
/**
......
* @return void
*/
function loadJavascriptLib($lib) {
$this->addJsFile($this->backPath . $lib);
}
$this->pageRenderer->addJsFile($this->backPath . $lib);
}
......
* Please just call this function without expecting a return value for future calls
*/
function getContextMenuCode() {
$this->loadPrototype();
$this->pageRenderer->loadPrototype();
$this->loadJavascriptLib('js/clickmenu.js');
$this->JScodeArray['clickmenu'] = '
......
* @return array If values are present: [0] = A <script> section for the HTML page header, [1] = onmousemove/onload handler for HTML tag or alike, [2] = One empty <div> layer for the follow-mouse drag element
*/
function getDragDropCode($table) {
$this->loadPrototype();
$this->pageRenderer->loadPrototype();
$this->loadJavascriptLib('js/common.js');
$this->loadJavascriptLib('js/tree.js');
......
*/
function setModuleTemplate($filename) {
// Load Prototype lib for IE event
$this->loadPrototype();
$this->pageRenderer->loadPrototype();
$this->loadJavascriptLib('js/iecompatibility.js');
$this->moduleTemplate = $this->getHtmlTemplate($filename);
}
typo3/backend.php (Arbeitskopie)
/******************************************************
* now put the complete backend document together
******************************************************/
$GLOBALS['TBE_TEMPLATE']->loadScriptaculous('builder,effects,controls,dragdrop');
$GLOBALS['TBE_TEMPLATE']->loadExtJS();
$pageRenderer = $GLOBALS['TBE_TEMPLATE']->getPageRenderer();
$pageRenderer->loadScriptaculous('builder,effects,controls,dragdrop');
$pageRenderer->loadExtJS();
// remove duplicate entries
$this->jsFiles = array_unique($this->jsFiles);
typo3/alt_db_navframe.php (Arbeitskopie)
// Adding javascript code for AJAX (prototype), drag&drop and the pagetree as well as the click menu code
$this->doc->getDragDropCode('pages');
$this->doc->getContextMenuCode();
$this->doc->loadScriptaculous('effects');
$this->doc->getPageRenderer()->loadScriptaculous('effects');
$this->doc->JScode .= $this->doc->wrapScriptTags(
($this->currentSubScript?'top.currentSubScript=unescape("'.rawurlencode($this->currentSubScript).'");':'').'
typo3/alt_doc.php (Arbeitskopie)
$this->doc->setModuleTemplate('templates/alt_doc.html');
$this->doc->form = '<form action="'.htmlspecialchars($this->R_URI).'" method="post" enctype="'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'].'" name="editform" onsubmit="document.editform._scrollPosition.value=(document.documentElement.scrollTop || document.body.scrollTop); return TBE_EDITOR.checkSubmit(1);">';
$this->doc->loadPrototype();
$this->doc->getPageRenderer()->loadPrototype();
$this->doc->JScode = $this->doc->wrapScriptTags('
function jumpToUrl(URL,formEl) { //
if (!TBE_EDITOR.isFormChanged()) {
typo3/mod/web/perm/index.php (Arbeitskopie)
$this->doc->setModuleTemplate('templates/perm.html');
$this->doc->form = '<form action="'.$GLOBALS['BACK_PATH'].'tce_db.php" method="post" name="editform">';
$this->doc->loadJavascriptLib('../t3lib/jsfunc.updateform.js');
$this->doc->loadPrototype();
$this->doc->getPageRenderer()->loadPrototype();
$this->doc->loadJavascriptLib(TYPO3_MOD_PATH . 'perm.js');
// Setting up the context sensitive menu:
typo3/sysext/t3editor/class.tx_t3editor.php (Arbeitskopie)
$path_t3e = t3lib_extmgm::extRelPath('t3editor');
// include needed javascript-frameworks
$doc->loadPrototype();
$doc->loadScriptaculous();
/** @var $pageRenderer t3lib_PageRenderer */
$pageRenderer = $doc->getPageRenderer();
$pageRenderer->loadPrototype();
$pageRenderer->loadScriptaculous();
// include editor-css
$code.= '<link href="' .
typo3/sysext/taskcenter/task/index.php (Arbeitskopie)
$this->doc->divClass = '';
$this->doc->form = '<form action="index.php" method="post" name="editform">';
$this->backPath = $this->doc->backPath = $BACK_PATH;
$this->doc->loadPrototype();
$this->doc->getPageRenderer()->loadPrototype();
$this->doc->JScode = ' <script language="javascript" type="text/javascript">
script_ended = 0;
function jumpToUrl(URL) {
typo3/sysext/cms/tslib/class.tslib_fe.php (Arbeitskopie)
* @package TYPO3
* @subpackage tslib
*/
class tslib_fe extends t3lib_PageRenderer {
class tslib_fe {
// CURRENT PAGE:
var $id=''; // The page id (int)
......
var $pages_lockObj; // Locking object for accessing "cache_pages"
/**
* @var t3lib_PageRenderer
*/
protected $pageRenderer;
/**
* the page cache object, use this to save pages to the cache and to
* retrieve them again
*
......
}
$this->initCaches();
parent::__construct(PATH_tslib . 'templates/tslib_page_frontend.html');
}
/**
......
}
}
/**
* Gets instance of PageRenderer
*
* @return t3lib_PageRenderer
*/
public function getPageRenderer() {
if (!isset($this->pageRenderer)) {
$this->pageRenderer = t3lib_div::makeInstance('t3lib_PageRenderer');
$this->pageRenderer->setTemplateFile(PATH_tslib . 'templates/tslib_page_frontend.html');
}
return $this->pageRenderer;
}
......
/********************************************
*
* Initializing, resolving page id
typo3/sysext/cms/tslib/class.tslib_pagegen.php (Arbeitskopie)
* @return void
*/
public static function renderContentWithHeader($pageContent) {
// get instance of t3lib_PageRenderer
/** @var $pageRenderer t3lib_PageRenderer */
$pageRenderer = $GLOBALS['TSFE']->getPageRenderer();
$GLOBALS['TSFE']->backPath = 'typo3/';
$pageRenderer->backPath = 'typo3/';
if ($GLOBALS['TSFE']->config['config']['moveJsFromHeaderToFooter']) {
$GLOBALS['TSFE']->enableMoveJsFromHeaderToFooter();
$pageRenderer->enableMoveJsFromHeaderToFooter();
}
if ($GLOBALS['TSFE']->config['config']['pageRenderTemplateFile']) {
$file = $GLOBALS['TSFE']->tmpl->getFileName($GLOBALS['TSFE']->config['config']['pageRenderTemplateFile']);
if ($file) {
$GLOBALS['TSFE']->setTemplateFile($file);
$pageRenderer->setTemplateFile($file);
}
}
$customContent = $GLOBALS['TSFE']->config['config']['headerComment'];
if (trim($customContent)) {
$GLOBALS['TSFE']->addInlineComment($customContent);
$pageRenderer->addInlineComment($customContent);
}
// Setting charset:
......
// Adding doctype parts:
if (count($docTypeParts)) {
$GLOBALS['TSFE']->setXmlPrologAndDocType(implode(chr(10), $docTypeParts));
$pageRenderer->setXmlPrologAndDocType(implode(chr(10), $docTypeParts));
}
// Begin header section:
......
} else {
$_attr = '';
}
$GLOBALS['TSFE']->setHtmlTag('<html' . ($_attr ? ' ' . $_attr : '') . '>');
$pageRenderer->setHtmlTag('<html' . ($_attr ? ' ' . $_attr : '') . '>');
// Head tag:
$headTag = $GLOBALS['TSFE']->pSetup['headTag'] ? $GLOBALS['TSFE']->pSetup['headTag'] : '<head>';
$GLOBALS['TSFE']->setHeadTag($headTag);
$pageRenderer->setHeadTag($headTag);
// Setting charset meta tag:
$GLOBALS['TSFE']->setCharSet($theCharset);
$pageRenderer->setCharSet($theCharset);
$GLOBALS['TSFE']->addInlineComment('
$pageRenderer->addInlineComment('
This website is powered by TYPO3 - inspiring people to share!
TYPO3 is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.
TYPO3 is copyright 1998-2009 of Kasper Skaarhoj. Extensions are copyright of their respective owners.
......
');
if ($GLOBALS['TSFE']->baseUrl) {
$GLOBALS['TSFE']->setBaseUrl($GLOBALS['TSFE']->baseUrl);
$pageRenderer->setBaseUrl($GLOBALS['TSFE']->baseUrl);
}
if ($GLOBALS['TSFE']->pSetup['shortcutIcon']) {
......
if (($finfo = @finfo_open(FILEINFO_MIME))) {
$iconMimeType = ' type="' . finfo_file($finfo, $favIcon) . '"';
finfo_close($finfo);
$GLOBALS['TSFE']->setIconMimeType($iconMimeType);
$pageRenderer->setIconMimeType($iconMimeType);
}
}
$GLOBALS['TSFE']->setFavIcon($favIcon);
$pageRenderer->setFavIcon($favIcon);
}
......
}
if (count($temp_styleLines)) {
if ($GLOBALS['TSFE']->config['config']['inlineStyle2TempFile']) {
$GLOBALS['TSFE']->addCssFile(TSpagegen::inline2TempFile(implode(chr(10), $temp_styleLines), 'css'));
$pageRenderer->addCssFile(TSpagegen::inline2TempFile(implode(chr(10), $temp_styleLines), 'css'));
} else {
$GLOBALS['TSFE']->addCssInlineBlock('TSFEinlineStyle', implode(chr(10), $temp_styleLines));
$pageRenderer->addCssInlineBlock('TSFEinlineStyle', implode(chr(10), $temp_styleLines));
}
}
}
......
if ($GLOBALS['TSFE']->pSetup['stylesheet']) {
$ss = $GLOBALS['TSFE']->tmpl->getFileName($GLOBALS['TSFE']->pSetup['stylesheet']);
if ($ss) {
$GLOBALS['TSFE']->addCssFile($ss);
$pageRenderer->addCssFile($ss);
}
}
......
if (! $GLOBALS['TSFE']->pSetup['includeCSS.'][$key . '.']['external'] && substr($ss, 0, 1) != '/') { // To fix MSIE 6 that cannot handle these as relative paths (according to Ben v Ende)
$ss = t3lib_div::dirname(t3lib_div::getIndpEnv('SCRIPT_NAME')) . '/' . $ss;
}
$GLOBALS['TSFE']->addCssInlineBlock(
$pageRenderer->addCssInlineBlock(
'import_' . $key,
'@import url("' . htmlspecialchars($ss) . '") ' . htmlspecialchars($GLOBALS['TSFE']->pSetup['includeCSS.'][$key . '.']['media']) . ';',
$GLOBALS['TSFE']->pSetup['includeCSS.'][$key . '.']['compressed'] ? TRUE : FALSE,
......
''
);
} else {
$GLOBALS['TSFE']->addCssFile(
$pageRenderer->addCssFile(
htmlspecialchars($ss),
$GLOBALS['TSFE']->pSetup['includeCSS.'][$key . '.']['alternate'] ? 'alternate stylesheet' : 'stylesheet',
$GLOBALS['TSFE']->pSetup['includeCSS.'][$key . '.']['media'] ? $GLOBALS['TSFE']->pSetup['includeCSS.'][$key . '.']['media'] : 'screen',
......
if (trim($style)) {
if ($GLOBALS['TSFE']->config['config']['inlineStyle2TempFile']) {
$GLOBALS['TSFE']->addCssFile(TSpagegen::inline2TempFile($style, 'css'));
$pageRenderer->addCssFile(TSpagegen::inline2TempFile($style, 'css'));
} else {
$GLOBALS['TSFE']->addCssInlineBlock('additionalTSFEInlineStyle', $style);
$pageRenderer->addCssInlineBlock('additionalTSFEInlineStyle', $style);
}
}
// Javascript Libraries
if (is_array($GLOBALS['TSFE']->pSetup['javascriptLibs.'])) {
if ($GLOBALS['TSFE']->pSetup['javascriptLibs.']['Prototype']) {
$GLOBALS['TSFE']->loadPrototype();
$pageRenderer->loadPrototype();
}
if ($GLOBALS['TSFE']->pSetup['javascriptLibs.']['Scriptaculous']) {
$modules = $GLOBALS['TSFE']->pSetup['javascriptLibs.']['Scriptaculous.']['modules'] ? $GLOBALS['TSFE']->pSetup['javascriptLibs.']['Scriptaculous.']['modules'] : '';
$GLOBALS['TSFE']->loadScriptaculous($modules);
$pageRenderer->loadScriptaculous($modules);
}
if ($GLOBALS['TSFE']->pSetup['javascriptLibs.']['ExtCore']) {
$GLOBALS['TSFE']->loadExtCore();
$pageRenderer->loadExtCore();
if ($GLOBALS['TSFE']->pSetup['javascriptLibs.']['ExtCore.']['debug']) {
$GLOBALS['TSFE']->enableExtCoreDebug();
$pageRenderer->enableExtCoreDebug();
}
}
if ($GLOBALS['TSFE']->pSetup['javascriptLibs.']['ExtJs']) {
$css = $GLOBALS['TSFE']->pSetup['javascriptLibs.']['ExtJs.']['css'] ? TRUE : FALSE;
$theme = $GLOBALS['TSFE']->pSetup['javascriptLibs.']['ExtJs.']['theme'] ? TRUE : FALSE;
$adapter = $GLOBALS['TSFE']->pSetup['javascriptLibs.']['ExtJs.']['adapter'] ? $GLOBALS['TSFE']->pSetup['javascriptLibs.']['ExtJs.']['adapter'] : '';
$GLOBALS['TSFE']->loadExtJs($css, $theme, $adapter);
$pageRenderer->loadExtJs($css, $theme, $adapter);
if ($GLOBALS['TSFE']->pSetup['javascriptLibs.']['ExtJs.']['debug']) {
$GLOBALS['TSFE']->enableExtJsDebug();
$pageRenderer->enableExtJsDebug();
}
if ($GLOBALS['TSFE']->pSetup['javascriptLibs.']['ExtJs.']['quickTips']) {
$GLOBALS['TSFE']->enableExtJSQuickTips();
$pageRenderer->enableExtJSQuickTips();
}
}
}
......
if (! $type) {
$type = 'text/javascript';
}
$GLOBALS['TSFE']->addJsLibrary(
$pageRenderer->addJsLibrary(
htmlspecialchars($key),
htmlspecialchars($GLOBALS['TSFE']->absRefPrefix . $ss),
htmlspecialchars($type),
......
if (! $type) {
$type = 'text/javascript';
}
$GLOBALS['TSFE']->addJsFooterLibrary(
$pageRenderer->addJsFooterLibrary(
htmlspecialchars($key),
htmlspecialchars($GLOBALS['TSFE']->absRefPrefix . $ss),
htmlspecialchars($type),
......
if (! $type) {
$type = 'text/javascript';
}
$GLOBALS['TSFE']->addJsFile(
$pageRenderer->addJsFile(
htmlspecialchars($GLOBALS['TSFE']->absRefPrefix . $ss),
htmlspecialchars($type),
$GLOBALS['TSFE']->pSetup['includeJS.'][$key . '.']['compressed'] ? TRUE : FALSE,
......
if (! $type) {
$type = 'text/javascript';
}
$GLOBALS['TSFE']->addJsFooterFile(
$pageRenderer->addJsFooterFile(
htmlspecialchars($GLOBALS['TSFE']->absRefPrefix . $ss),
htmlspecialchars($type),
$GLOBALS['TSFE']->pSetup['includeFooterJS.'][$key . '.']['compressed'] ? TRUE : FALSE,
......
// Headerdata
if (is_array($GLOBALS['TSFE']->pSetup['headerData.'])) {
$GLOBALS['TSFE']->addHeaderData($GLOBALS['TSFE']->cObj->cObjGet($GLOBALS['TSFE']->pSetup['headerData.'], 'headerData.'));
$pageRenderer->addHeaderData($GLOBALS['TSFE']->cObj->cObjGet($GLOBALS['TSFE']->pSetup['headerData.'], 'headerData.'));
}
// Footerdata
if (is_array($GLOBALS['TSFE']->pSetup['footerData.'])) {
$GLOBALS['TSFE']->addFooterData($GLOBALS['TSFE']->cObj->cObjGet($GLOBALS['TSFE']->pSetup['footerData.'], 'footerData.'));
$pageRenderer->addFooterData($GLOBALS['TSFE']->cObj->cObjGet($GLOBALS['TSFE']->pSetup['footerData.'], 'footerData.'));
}
// Title
......
}
if (strlen($titleTagContent) && intval($GLOBALS['TSFE']->config['config']['noPageTitle']) !== 2) {
$GLOBALS['TSFE']->setTitle($titleTagContent);
$pageRenderer->setTitle($titleTagContent);
}
$GLOBALS['TSFE']->addMetaTag('<meta name="generator" content="TYPO3 ' . TYPO3_branch . ' CMS" />');
$pageRenderer->addMetaTag('<meta name="generator" content="TYPO3 ' . TYPO3_branch . ' CMS" />');
$conf = $GLOBALS['TSFE']->pSetup['meta.'];
if (is_array($conf)) {
......
if (strtolower($key) == 'refresh') {
$a = 'http-equiv';
}
$GLOBALS['TSFE']->addMetaTag('<meta ' . $a . '="' . $key . '" content="' . htmlspecialchars(trim($val)) . '" />');
$pageRenderer->addMetaTag('<meta ' . $a . '="' . $key . '" content="' . htmlspecialchars(trim($val)) . '" />');
}
}
}
......
// Should minify?
if ($GLOBALS['TSFE']->config['config']['minifyJS']) {
$GLOBALS['TSFE']->enableCompressJavascript();
$pageRenderer->enableCompressJavascript();
$minifyErrorScript = $minifyErrorInline = '';
$scriptJsCode = t3lib_div::minifyJavaScript($scriptJsCode, $minifyErrorScript);
if ($minifyErrorScript) {
......
if (! $GLOBALS['TSFE']->config['config']['removeDefaultJS']) {
// inlude default and inlineJS
if ($scriptJsCode) {
$GLOBALS['TSFE']->addJsInlineCode('_scriptCode', $scriptJsCode, $GLOBALS['TSFE']->config['config']['minifyJS']);
$pageRenderer->addJsInlineCode('_scriptCode', $scriptJsCode, $GLOBALS['TSFE']->config['config']['minifyJS']);
}
if ($inlineJS) {
$GLOBALS['TSFE']->addJsInlineCode('TS_inlineJS', $inlineJS, $GLOBALS['TSFE']->config['config']['minifyJS']);
$pageRenderer->addJsInlineCode('TS_inlineJS', $inlineJS, $GLOBALS['TSFE']->config['config']['minifyJS']);
}
if ($inlineFooterJs) {
$GLOBALS['TSFE']->addJsFooterInlineCode('TS_inlineFooter', $inlineFooterJs, $GLOBALS['TSFE']->config['config']['minifyJS']);
$pageRenderer->addJsFooterInlineCode('TS_inlineFooter', $inlineFooterJs, $GLOBALS['TSFE']->config['config']['minifyJS']);
}
} elseif ($GLOBALS['TSFE']->config['config']['removeDefaultJS'] === 'external') {
// put default and inlineJS in external file
$GLOBALS['TSFE']->addJsFile(TSpagegen::inline2TempFile($scriptJsCode . $inlineJS, 'js'), 'text/javascript', $GLOBALS['TSFE']->config['config']['minifyJS']);
$pageRenderer->addJsFile(TSpagegen::inline2TempFile($scriptJsCode . $inlineJS, 'js'), 'text/javascript', $GLOBALS['TSFE']->config['config']['minifyJS']);
if ($inlineFooterJs) {
$GLOBALS['TSFE']->addJsFooterFile(TSpagegen::inline2TempFile($inlineFooterJs, 'js'), 'text/javascript', $GLOBALS['TSFE']->config['config']['minifyJS']);
$pageRenderer->addJsFooterFile(TSpagegen::inline2TempFile($inlineFooterJs, 'js'), 'text/javascript', $GLOBALS['TSFE']->config['config']['minifyJS']);
}
} else {
// include only inlineJS
if ($inlineJS) {
$GLOBALS['TSFE']->addJsInlineCode('TS_inlineJS', $inlineJS, $GLOBALS['TSFE']->config['config']['minifyJS']);
$pageRenderer->addJsInlineCode('TS_inlineJS', $inlineJS, $GLOBALS['TSFE']->config['config']['minifyJS']);
}
if ($inlineFooterJs) {
$GLOBALS['TSFE']->addJsFooterInlineCode('TS_inlineFooter', $inlineFooterJs, $GLOBALS['TSFE']->config['config']['minifyJS']);
$pageRenderer->addJsFooterInlineCode('TS_inlineFooter', $inlineFooterJs, $GLOBALS['TSFE']->config['config']['minifyJS']);
}
}
// ExtJS specific code
if (is_array($GLOBALS['TSFE']->pSetup['inlineLanguageLabel.'])) {
$GLOBALS['TSFE']->addInlineLanguageLabelArray($GLOBALS['TSFE']->pSetup['inlineLanguageLabel.']);
$pageRenderer->addInlineLanguageLabelArray($GLOBALS['TSFE']->pSetup['inlineLanguageLabel.']);
}
if (is_array($GLOBALS['TSFE']->pSetup['inlineSettings.'])) {
$GLOBALS['TSFE']->addInlineSettingArray('TS', $GLOBALS['TSFE']->pSetup['inlineSettings.']);
$pageRenderer->addInlineSettingArray('TS', $GLOBALS['TSFE']->pSetup['inlineSettings.']);
}
if (is_array($GLOBALS['TSFE']->pSetup['extOnReady.'])) {
$GLOBALS['TSFE']->addExtOnReadyCode($GLOBALS['TSFE']->cObj->cObjGet($GLOBALS['TSFE']->pSetup['extOnReady.'], 'extOnReady.'));
$pageRenderer->addExtOnReadyCode($GLOBALS['TSFE']->cObj->cObjGet($GLOBALS['TSFE']->pSetup['extOnReady.'], 'extOnReady.'));
}
// compression and concatenate settings
if ($GLOBALS['TSFE']->config['config']['minifyCSS']) {
$GLOBALS['TSFE']->enableCompressCss();
$pageRenderer->enableCompressCss();
}
if ($GLOBALS['TSFE']->config['config']['minifyJS']) {
$GLOBALS['TSFE']->enableCompressJavascript();
$pageRenderer->enableCompressJavascript();
}
if ($GLOBALS['TSFE']->config['config']['concatenateJsAndCss']) {
$GLOBALS['TSFE']->enableConcatenateFiles();
$pageRenderer->enableConcatenateFiles();
}
// add header data block
if ($GLOBALS['TSFE']->additionalHeaderData) {
$GLOBALS['TSFE']->addHeaderData(implode(chr(10), $GLOBALS['TSFE']->additionalHeaderData));
$pageRenderer->addHeaderData(implode(chr(10), $GLOBALS['TSFE']->additionalHeaderData));
}
// add footer data block
if ($GLOBALS['TSFE']->additionalFooterData) {
$GLOBALS['TSFE']->addFooterData(implode(chr(10), $GLOBALS['TSFE']->additionalFooterData));
$pageRenderer->addFooterData(implode(chr(10), $GLOBALS['TSFE']->additionalFooterData));
}
// Header complete, now add content
......
if (count($JSef[1])) { // Event functions:
$bodyTag = preg_replace('/>$/', '', trim($bodyTag)) . ' ' . trim(implode(' ', $JSef[1])) . '>';
}
$GLOBALS['TSFE']->addBodyContent(chr(10) . $bodyTag);
$pageRenderer->addBodyContent(chr(10) . $bodyTag);
// Div-sections
if ($GLOBALS['TSFE']->divSection) {
$GLOBALS['TSFE']->addBodyContent(chr(10) . $GLOBALS['TSFE']->divSection);
$pageRenderer->addBodyContent(chr(10) . $GLOBALS['TSFE']->divSection);
}
// Page content
$GLOBALS['TSFE']->addBodyContent(chr(10) . $pageContent);
$pageRenderer->addBodyContent(chr(10) . $pageContent);
// Render complete page
$GLOBALS['TSFE']->content = $GLOBALS['TSFE']->render();
$GLOBALS['TSFE']->content = $pageRenderer->render();
// Ending page
if ($GLOBALS['TSFE']->pSetup['frameSet.']) {
typo3/sysext/cms/tslib/class.tslib_content.php (Arbeitskopie)
$typeConf = $conf[$conf['type'] . '.'];
//add SWFobject js-file
$GLOBALS['TSFE']->addJsFile('typo3/contrib/flashmedia/swfobject/swfobject.js');
$GLOBALS['TSFE']->getPageRenderer()->addJsFile('typo3/contrib/flashmedia/swfobject/swfobject.js');
$player = $this->stdWrap($conf[$conf['type'] . '.']['player'], $conf[$conf['type'] . '.']['player.']);
$installUrl = $conf['installUrl'] ? $conf['installUrl'] : $prefix . 'typo3/contrib/flashmedia/swfobject/expressInstall.swf';
......
$typeConf = $conf[$conf['type'] . '.'];
//add QTobject js-file
$GLOBALS['TSFE']->addJsFile('typo3/contrib/flashmedia/qtobject/qtobject.js');
$GLOBALS['TSFE']->getPageRenderer()->addJsFile('typo3/contrib/flashmedia/qtobject/qtobject.js');
$replaceElementIdString = uniqid('mmqt');
$GLOBALS['TSFE']->register['MMQTID'] = $replaceElementIdString;
$qtObject = 'QTObject' . $replaceElementIdString;
typo3/sysext/rtehtmlarea/mod3/class.tx_rtehtmlarea_browse_links.php (Arbeitskopie)
$this->doc = t3lib_div::makeInstance('template');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
// Loading the Prototype library and browse_links.js
$this->doc->loadPrototype();
$this->doc->getPageRenderer()->loadPrototype();
$this->doc->loadJavascriptLib('js/browse_links.js');
// Adding context menu code
$this->doc->getContextMenuCode();
typo3/sysext/rtehtmlarea/mod4/class.tx_rtehtmlarea_select_image.php (Arbeitskopie)
$this->doc->backPath = $BACK_PATH;
// Load the Prototype library and browse_links.js
$this->doc->loadPrototype();
$this->doc->getPageRenderer()->loadPrototype();
$this->doc->loadJavascriptLib('js/browse_links.js');
$this->doc->getContextMenuCode();
typo3/sysext/recycler/mod1/index.php (Arbeitskopie)
// Load CSS Stylesheets:
$this->loadStylesheet($this->relativePath . 'res/css/customExtJs.css');
// Load Ext JS:
$this->doc->loadExtJS();
$this->doc->getPageRenderer()->loadExtJS();
// Integrate dynamic JavaScript such as configuration or lables:
$this->doc->JScode.= t3lib_div::wrapJS('
Ext.namespace("Recycler");
typo3/sysext/scheduler/mod1/index.php (Arbeitskopie)
}
// Load necessary JavaScript
$this->doc->loadExtJS();
/** @var $pageRenderer t3lib_PageRenderer */
$pageRenderer = $this->doc->getPageRenderer();
$pageRenderer->loadExtJS();
$this->doc->loadJavascriptLib(t3lib_extMgm::extRelPath('scheduler') . 'res/tx_scheduler_be.js');
$this->doc->addJsFile($this->backPath . '../t3lib/js/extjs/tceforms.js');
$pageRenderer->addJsFile($this->backPath . '../t3lib/js/extjs/tceforms.js');
// Define settings for Date Picker
$typo3Settings = array(
......
'dateFormat' => array('j-n-Y', 'G:i j-n-Y'),
'dateFormatUS' => array('n-j-Y', 'G:i n-j-Y'),
);
$this->doc->addInlineSettingArray('', $typo3Settings);
$pageRenderer->addInlineSettingArray('', $typo3Settings);
// Define table layout for add/edit form
$tableLayout = array (
......
$registeredClasses = self::getRegisteredClasses();
// Load ExtJS framework and specific JS library
$this->doc->loadExtJS();
$this->doc->getPageRenderer()->loadExtJS();
$this->doc->loadJavascriptLib(t3lib_extMgm::extRelPath('scheduler') . 'res/tx_scheduler_be.js');
// Initialise table layout
    (1-1/1)