2 namespace TYPO3\CMS\Core\Page
;
4 /***************************************************************
7 * (c) 2009-2011 Steffen Kamper <info@sk-typo3.de>
8 * (c) 2011 Kai Vogel <kai.vogel@speedprogs.de>
11 * This script is part of the TYPO3 project. The TYPO3 project is
12 * free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * The GNU General Public License can be found at
18 * http://www.gnu.org/copyleft/gpl.html.
19 * A copy is found in the textfile GPL.txt and important notices to the license
20 * from the author is found in LICENSE.txt distributed with these scripts.
23 * This script is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
28 * This copyright notice MUST APPEAR in all copies of the script!
29 ***************************************************************/
31 * TYPO3 pageRender class (new in TYPO3 4.3.0)
32 * This class render the HTML of a webpage, usable for BE and FE
34 * @author Steffen Kamper <info@sk-typo3.de>
35 * @author Kai Vogel <kai.vogel@speedprogs.de>
37 class PageRenderer
implements \TYPO3\CMS\Core\SingletonInterface
{
39 // Constants for the part to be rendered
40 const PART_COMPLETE
= 0;
41 const PART_HEADER
= 1;
42 const PART_FOOTER
= 2;
43 // Available adapters for extJs
44 const EXTJS_ADAPTER_JQUERY
= 'jquery';
45 const EXTJS_ADAPTER_PROTOTYPE
= 'prototype';
46 const EXTJS_ADAPTER_YUI
= 'yui';
47 // jQuery Core version that is shipped with TYPO3
48 const JQUERY_VERSION_LATEST
= '1.8.2';
49 // jQuery namespace options
50 const JQUERY_NAMESPACE_NONE
= 'none';
51 const JQUERY_NAMESPACE_DEFAULT
= 'jQuery';
52 const JQUERY_NAMESPACE_DEFAULT_NOCONFLICT
= 'defaultNoConflict';
56 protected $compressJavascript = FALSE;
61 protected $compressCss = FALSE;
66 protected $removeLineBreaksFromTemplate = FALSE;
71 protected $concatenateFiles = FALSE;
76 protected $concatenateJavascript = FALSE;
81 protected $concatenateCss = FALSE;
86 protected $moveJsFromHeaderToFooter = FALSE;
89 * @var \TYPO3\CMS\Core\Charset\CharsetConverter
94 * @var \TYPO3\CMS\Core\Localization\Locales
100 * Two character string or 'default'
107 * @var \TYPO3\CMS\Core\Resource\ResourceCompressor
109 protected $compressor;
111 // Arrays containing associative array for the included files
115 protected $jsFiles = array();
120 protected $jsFooterFiles = array();
125 protected $jsLibs = array();
130 protected $jsFooterLibs = array();
135 protected $cssFiles = array();
138 * The title of the page
145 * Charset for the rendering
164 protected $renderXhtml = TRUE;
166 // Static header blocks
170 protected $xmlPrologAndDocType = '';
175 protected $metaTags = array();
180 protected $inlineComments = array();
185 protected $headerData = array();
190 protected $footerData = array();
195 protected $titleTag = '<title>|</title>';
200 protected $metaCharsetTag = '<meta http-equiv="Content-Type" content="text/html; charset=|" />';
205 protected $htmlTag = '<html>';
210 protected $headTag = '<head>';
215 protected $baseUrlTag = '<base href="|" />';
220 protected $iconMimeType = '';
225 protected $shortcutTag = '<link rel="shortcut icon" href="%1$s"%2$s />
226 <link rel="icon" href="%1$s"%2$s />';
228 // Static inline code blocks
232 protected $jsInline = array();
237 protected $jsFooterInline = array();
242 protected $extOnReadyCode = array();
247 protected $cssInline = array();
252 protected $bodyContent;
257 protected $templateFile;
262 protected $jsLibraryNames = array('prototype', 'scriptaculous', 'extjs');
264 // Paths to contibuted libraries
268 protected $prototypePath = 'contrib/prototype/';
273 protected $scriptaculousPath = 'contrib/scriptaculous/';
278 protected $extCorePath = 'contrib/extjs/';
283 protected $extJsPath = 'contrib/extjs/';
288 protected $svgPath = 'contrib/websvg/';
291 * The local directory where one can find jQuery versions and plugins
295 protected $jQueryPath = 'contrib/jquery/';
297 // Internal flags for JS-libraries
299 * This array holds all jQuery versions that should be included in the
301 * Each version is described by "source", "version" and "namespace"
303 * The namespace of every particular version is the key
304 * of that array, because only one version per namespace can exist.
306 * The type "source" describes where the jQuery core should be included from
307 * currently, TYPO3 supports "local" (make use of jQuery path), "google",
308 * "jquery" and "msn".
309 * Currently there are downsides to "local" and "jquery", as "local" only
310 * supports the latest/shipped jQuery core out of the box, and
311 * "jquery" does not have SSL support.
315 protected $jQueryVersions = array();
318 * Array of jQuery version numbers shipped with the core
322 protected $availableLocalJqueryVersions = array(
323 self
::JQUERY_VERSION_LATEST
327 * Array of jQuery CDNs with placeholders
331 protected $jQueryCdnUrls = array(
332 'google' => '//ajax.googleapis.com/ajax/libs/jquery/%1$s/jquery%2$s.js',
333 'msn' => '//ajax.aspnetcdn.com/ajax/jQuery/jquery-%1$s%2$s.js',
334 'jquery' => 'http://code.jquery.com/jquery-%1$s%2$s.js'
340 protected $addPrototype = FALSE;
345 protected $addScriptaculous = FALSE;
350 protected $addScriptaculousModules = array('builder' => FALSE, 'effects' => FALSE, 'dragdrop' => FALSE, 'controls' => FALSE, 'slider' => FALSE);
355 protected $addExtJS = FALSE;
360 protected $addExtCore = FALSE;
365 protected $extJSadapter = 'ext/ext-base.js';
370 protected $extDirectCodeAdded = FALSE;
375 protected $enableExtJsDebug = FALSE;
380 protected $enableExtCoreDebug = FALSE;
385 protected $enableJqueryDebug = FALSE;
390 protected $extJStheme = TRUE;
395 protected $extJScss = TRUE;
400 protected $enableExtJSQuickTips = FALSE;
405 protected $inlineLanguageLabels = array();
410 protected $inlineLanguageLabelFiles = array();
415 protected $inlineSettings = array();
420 protected $inlineJavascriptWrap = array();
423 * Saves error messages generated during compression
427 protected $compressError = '';
430 * Is empty string for HTML and ' /' for XHTML rendering
434 protected $endingSlash = '';
441 protected $addSvg = FALSE;
446 protected $enableSvgDebug = FALSE;
456 * @param string $templateFile Declare the used template file. Omit this parameter will use default template
457 * @param string $backPath Relative path to typo3-folder. It varies for BE modules, in FE it will be typo3/
459 public function __construct($templateFile = '', $backPath = NULL) {
461 $this->csConvObj
= \TYPO3\CMS\Core\Utility\GeneralUtility
::makeInstance('TYPO3\\CMS\\Core\\Charset\\CharsetConverter');
462 $this->locales
= \TYPO3\CMS\Core\Utility\GeneralUtility
::makeInstance('TYPO3\\CMS\\Core\\Localization\\Locales');
463 if (strlen($templateFile)) {
464 $this->templateFile
= $templateFile;
466 $this->backPath
= isset($backPath) ?
$backPath : $GLOBALS['BACK_PATH'];
467 $this->inlineJavascriptWrap
= array(
468 '<script type="text/javascript">' . LF
. '/*<![CDATA[*/' . LF
. '<!-- ' . LF
,
469 '// -->' . LF
. '/*]]>*/' . LF
. '</script>' . LF
471 $this->inlineCssWrap
= array(
472 '<style type="text/css">' . LF
. '/*<![CDATA[*/' . LF
. '<!-- ' . LF
,
473 '-->' . LF
. '/*]]>*/' . LF
. '</style>' . LF
478 * Reset all vars to initial values
482 protected function reset() {
483 $this->templateFile
= TYPO3_mainDir
. 'templates/template_page_backend.html';
484 $this->jsFiles
= array();
485 $this->jsFooterFiles
= array();
486 $this->jsInline
= array();
487 $this->jsFooterInline
= array();
488 $this->jsLibs
= array();
489 $this->cssFiles
= array();
490 $this->cssInline
= array();
491 $this->metaTags
= array();
492 $this->inlineComments
= array();
493 $this->headerData
= array();
494 $this->footerData
= array();
495 $this->extOnReadyCode
= array();
496 $this->jQueryVersions
= array();
499 /*****************************************************/
504 /*****************************************************/
508 * @param string $title title of webpage
511 public function setTitle($title) {
512 $this->title
= $title;
516 * Enables/disables rendering of XHTML code
518 * @param boolean $enable Enable XHTML
521 public function setRenderXhtml($enable) {
522 $this->renderXhtml
= $enable;
526 * Sets xml prolog and docType
528 * @param string $xmlPrologAndDocType Complete tags for xml prolog and docType
531 public function setXmlPrologAndDocType($xmlPrologAndDocType) {
532 $this->xmlPrologAndDocType
= $xmlPrologAndDocType;
538 * @param string $charSet Used charset
541 public function setCharSet($charSet) {
542 $this->charSet
= $charSet;
548 * @param string $lang Used language
551 public function setLanguage($lang) {
556 * Set the meta charset tag
558 * @param string $metaCharsetTag
561 public function setMetaCharsetTag($metaCharsetTag) {
562 $this->metaCharsetTag
= $metaCharsetTag;
568 * @param string $htmlTag Html tag
571 public function setHtmlTag($htmlTag) {
572 $this->htmlTag
= $htmlTag;
578 * @param string $headTag HTML head tag
581 public function setHeadTag($headTag) {
582 $this->headTag
= $headTag;
588 * @param string $favIcon
591 public function setFavIcon($favIcon) {
592 $this->favIcon
= $favIcon;
596 * Sets icon mime type
598 * @param string $iconMimeType
601 public function setIconMimeType($iconMimeType) {
602 $this->iconMimeType
= $iconMimeType;
608 * @param string $baseUrl HTML base URL
611 public function setBaseUrl($baseUrl) {
612 $this->baseUrl
= $baseUrl;
618 * @param string $file
621 public function setTemplateFile($file) {
622 $this->templateFile
= $file;
628 * @param string $backPath
631 public function setBackPath($backPath) {
632 $this->backPath
= $backPath;
636 * Sets Content for Body
638 * @param string $content
641 public function setBodyContent($content) {
642 $this->bodyContent
= $content;
646 * Sets path to prototype library (relative to typo3 directory)
648 * @param string $path Path to prototype library
651 public function setPrototypePath($path) {
652 $this->prototypePath
= $path;
656 * Sets Path for scriptaculous library (relative to typo3 directory)
658 * @param string $path
661 public function setScriptaculousPath($path) {
662 $this->scriptaculousPath
= $path;
666 * Sets Path for Ext Core library (relative to typo3 directory)
668 * @param string $path
671 public function setExtCorePath($path) {
672 $this->extCorePath
= $path;
676 * Sets Path for ExtJs library (relative to typo3 directory)
678 * @param string $path
681 public function setExtJsPath($path) {
682 $this->extJsPath
= $path;
686 * Sets Path for SVG library (websvg)
688 * @param string $path
691 public function setSvgPath($path) {
692 $this->svgPath
= $path;
695 /*****************************************************/
697 /* Public Enablers / Disablers */
700 /*****************************************************/
702 * Enables MoveJsFromHeaderToFooter
706 public function enableMoveJsFromHeaderToFooter() {
707 $this->moveJsFromHeaderToFooter
= TRUE;
711 * Disables MoveJsFromHeaderToFooter
715 public function disableMoveJsFromHeaderToFooter() {
716 $this->moveJsFromHeaderToFooter
= FALSE;
720 * Enables compression of javascript
724 public function enableCompressJavascript() {
725 $this->compressJavascript
= TRUE;
729 * Disables compression of javascript
733 public function disableCompressJavascript() {
734 $this->compressJavascript
= FALSE;
738 * Enables compression of css
742 public function enableCompressCss() {
743 $this->compressCss
= TRUE;
747 * Disables compression of css
751 public function disableCompressCss() {
752 $this->compressCss
= FALSE;
756 * Enables concatenation of js and css files
760 public function enableConcatenateFiles() {
761 $this->concatenateFiles
= TRUE;
765 * Disables concatenation of js and css files
769 public function disableConcatenateFiles() {
770 $this->concatenateFiles
= FALSE;
774 * Enables concatenation of js files
778 public function enableConcatenateJavascript() {
779 $this->concatenateJavascript
= TRUE;
783 * Disables concatenation of js files
787 public function disableConcatenateJavascript() {
788 $this->concatenateJavascript
= FALSE;
792 * Enables concatenation of css files
796 public function enableConcatenateCss() {
797 $this->concatenateCss
= TRUE;
801 * Disables concatenation of css files
805 public function disableConcatenateCss() {
806 $this->concatenateCss
= FALSE;
810 * Sets removal of all line breaks in template
814 public function enableRemoveLineBreaksFromTemplate() {
815 $this->removeLineBreaksFromTemplate
= TRUE;
819 * Unsets removal of all line breaks in template
823 public function disableRemoveLineBreaksFromTemplate() {
824 $this->removeLineBreaksFromTemplate
= FALSE;
829 * This is a shortcut to switch off all compress/concatenate features to enable easier debug
833 public function enableDebugMode() {
834 $this->compressJavascript
= FALSE;
835 $this->compressCss
= FALSE;
836 $this->concatenateFiles
= FALSE;
837 $this->removeLineBreaksFromTemplate
= FALSE;
838 $this->enableExtCoreDebug
= TRUE;
839 $this->enableExtJsDebug
= TRUE;
840 $this->enableJqueryDebug
= TRUE;
841 $this->enableSvgDebug
= TRUE;
844 /*****************************************************/
849 /*****************************************************/
853 * @return string $title Title of webpage
855 public function getTitle() {
862 * @return string $charSet
864 public function getCharSet() {
865 return $this->charSet
;
871 * @return string $lang
873 public function getLanguage() {
878 * Returns rendering mode XHTML or HTML
880 * @return boolean TRUE if XHTML, FALSE if HTML
882 public function getRenderXhtml() {
883 return $this->renderXhtml
;
889 * @return string $htmlTag Html tag
891 public function getHtmlTag() {
892 return $this->htmlTag
;
900 public function getMetaCharsetTag() {
901 return $this->metaCharsetTag
;
907 * @return string $tag Head tag
909 public function getHeadTag() {
910 return $this->headTag
;
916 * @return string $favIcon
918 public function getFavIcon() {
919 return $this->favIcon
;
923 * Gets icon mime type
925 * @return string $iconMimeType
927 public function getIconMimeType() {
928 return $this->iconMimeType
;
934 * @return string $url
936 public function getBaseUrl() {
937 return $this->baseUrl
;
945 public function getTemplateFile() {
946 return $this->templateFile
;
950 * Gets MoveJsFromHeaderToFooter
954 public function getMoveJsFromHeaderToFooter() {
955 return $this->moveJsFromHeaderToFooter
;
959 * Gets compress of javascript
963 public function getCompressJavascript() {
964 return $this->compressJavascript
;
968 * Gets compress of css
972 public function getCompressCss() {
973 return $this->compressCss
;
977 * Gets concatenate of js and css files
981 public function getConcatenateFiles() {
982 return $this->concatenateFiles
;
986 * Gets concatenate of js files
990 public function getConcatenateJavascript() {
991 return $this->concatenateJavascript
;
995 * Gets concatenate of css files
999 public function getConcatenateCss() {
1000 return $this->concatenateCss
;
1004 * Gets remove of empty lines from template
1008 public function getRemoveLineBreaksFromTemplate() {
1009 return $this->removeLineBreaksFromTemplate
;
1013 * Gets content for body
1017 public function getBodyContent() {
1018 return $this->bodyContent
;
1022 * Gets Path for prototype library (relative to typo3 directory)
1026 public function getPrototypePath() {
1027 return $this->prototypePath
;
1031 * Gets Path for scriptaculous library (relative to typo3 directory)
1035 public function getScriptaculousPath() {
1036 return $this->scriptaculousPath
;
1040 * Gets Path for Ext Core library (relative to typo3 directory)
1044 public function getExtCorePath() {
1045 return $this->extCorePath
;
1049 * Gets Path for ExtJs library (relative to typo3 directory)
1053 public function getExtJsPath() {
1054 return $this->extJsPath
;
1058 * Gets Path for SVG library (relative to typo3 directory)
1062 public function getSvgPath() {
1063 return $this->svgPath
;
1067 * Gets the inline language labels.
1069 * @return array The inline language labels
1071 public function getInlineLanguageLabels() {
1072 return $this->inlineLanguageLabels
;
1076 * Gets the inline language files
1080 public function getInlineLanguageLabelFiles() {
1081 return $this->inlineLanguageLabelFiles
;
1084 /*****************************************************/
1086 /* Public Functions to add Data */
1089 /*****************************************************/
1093 * @param string $meta Meta data (complete metatag)
1096 public function addMetaTag($meta) {
1097 if (!in_array($meta, $this->metaTags
)) {
1098 $this->metaTags
[] = $meta;
1103 * Adds inline HTML comment
1105 * @param string $comment
1108 public function addInlineComment($comment) {
1109 if (!in_array($comment, $this->inlineComments
)) {
1110 $this->inlineComments
[] = $comment;
1117 * @param string $data Free header data for HTML header
1120 public function addHeaderData($data) {
1121 if (!in_array($data, $this->headerData
)) {
1122 $this->headerData
[] = $data;
1129 * @param string $data Free header data for HTML header
1132 public function addFooterData($data) {
1133 if (!in_array($data, $this->footerData
)) {
1134 $this->footerData
[] = $data;
1139 * Adds JS Library. JS Library block is rendered on top of the JS files.
1141 * @param string $name Arbitrary identifier
1142 * @param string $file File name
1143 * @param string $type Content Type
1144 * @param boolean $compress Flag if library should be compressed
1145 * @param boolean $forceOnTop Flag if added library should be inserted at begin of this block
1146 * @param string $allWrap
1147 * @param boolean $excludeFromConcatenation
1150 public function addJsLibrary($name, $file, $type = 'text/javascript', $compress = FALSE, $forceOnTop = FALSE, $allWrap = '', $excludeFromConcatenation = FALSE) {
1152 $type = 'text/javascript';
1154 if (!in_array(strtolower($name), $this->jsLibs
)) {
1155 $this->jsLibs
[strtolower($name)] = array(
1158 'section' => self
::PART_HEADER
,
1159 'compress' => $compress,
1160 'forceOnTop' => $forceOnTop,
1161 'allWrap' => $allWrap,
1162 'excludeFromConcatenation' => $excludeFromConcatenation
1168 * Adds JS Library to Footer. JS Library block is rendered on top of the Footer JS files.
1170 * @param string $name Arbitrary identifier
1171 * @param string $file File name
1172 * @param string $type Content Type
1173 * @param boolean $compress Flag if library should be compressed
1174 * @param boolean $forceOnTop Flag if added library should be inserted at begin of this block
1175 * @param string $allWrap
1176 * @param boolean $excludeFromConcatenation
1179 public function addJsFooterLibrary($name, $file, $type = 'text/javascript', $compress = FALSE, $forceOnTop = FALSE, $allWrap = '', $excludeFromConcatenation = FALSE) {
1181 $type = 'text/javascript';
1183 if (!in_array(strtolower($name), $this->jsLibs
)) {
1184 $this->jsLibs
[strtolower($name)] = array(
1187 'section' => self
::PART_FOOTER
,
1188 'compress' => $compress,
1189 'forceOnTop' => $forceOnTop,
1190 'allWrap' => $allWrap,
1191 'excludeFromConcatenation' => $excludeFromConcatenation
1199 * @param string $file File name
1200 * @param string $type Content Type
1201 * @param boolean $compress
1202 * @param boolean $forceOnTop
1203 * @param string $allWrap
1204 * @param boolean $excludeFromConcatenation
1207 public function addJsFile($file, $type = 'text/javascript', $compress = TRUE, $forceOnTop = FALSE, $allWrap = '', $excludeFromConcatenation = FALSE) {
1209 $type = 'text/javascript';
1211 if (!isset($this->jsFiles
[$file])) {
1212 if (strpos($file, 'ajax.php?') !== FALSE) {
1215 $this->jsFiles
[$file] = array(
1218 'section' => self
::PART_HEADER
,
1219 'compress' => $compress,
1220 'forceOnTop' => $forceOnTop,
1221 'allWrap' => $allWrap,
1222 'excludeFromConcatenation' => $excludeFromConcatenation
1228 * Adds JS file to footer
1230 * @param string $file File name
1231 * @param string $type Content Type
1232 * @param boolean $compress
1233 * @param boolean $forceOnTop
1234 * @param string $allWrap
1235 * @param boolean $excludeFromConcatenation
1238 public function addJsFooterFile($file, $type = 'text/javascript', $compress = TRUE, $forceOnTop = FALSE, $allWrap = '', $excludeFromConcatenation = FALSE) {
1240 $type = 'text/javascript';
1242 if (!isset($this->jsFiles
[$file])) {
1243 if (strpos($file, 'ajax.php?') !== FALSE) {
1246 $this->jsFiles
[$file] = array(
1249 'section' => self
::PART_FOOTER
,
1250 'compress' => $compress,
1251 'forceOnTop' => $forceOnTop,
1252 'allWrap' => $allWrap,
1253 'excludeFromConcatenation' => $excludeFromConcatenation
1259 * Adds JS inline code
1261 * @param string $name
1262 * @param string $block
1263 * @param boolean $compress
1264 * @param boolean $forceOnTop
1267 public function addJsInlineCode($name, $block, $compress = TRUE, $forceOnTop = FALSE) {
1268 if (!isset($this->jsInline
[$name]) && !empty($block)) {
1269 $this->jsInline
[$name] = array(
1270 'code' => $block . LF
,
1271 'section' => self
::PART_HEADER
,
1272 'compress' => $compress,
1273 'forceOnTop' => $forceOnTop
1279 * Adds JS inline code to footer
1281 * @param string $name
1282 * @param string $block
1283 * @param boolean $compress
1284 * @param boolean $forceOnTop
1287 public function addJsFooterInlineCode($name, $block, $compress = TRUE, $forceOnTop = FALSE) {
1288 if (!isset($this->jsInline
[$name]) && !empty($block)) {
1289 $this->jsInline
[$name] = array(
1290 'code' => $block . LF
,
1291 'section' => self
::PART_FOOTER
,
1292 'compress' => $compress,
1293 'forceOnTop' => $forceOnTop
1299 * Adds Ext.onready code, which will be wrapped in Ext.onReady(function() {...});
1301 * @param string $block Javascript code
1302 * @param boolean $forceOnTop Position of the javascript code (TRUE for putting it on top, default is FALSE = bottom)
1305 public function addExtOnReadyCode($block, $forceOnTop = FALSE) {
1306 if (!in_array($block, $this->extOnReadyCode
)) {
1308 array_unshift($this->extOnReadyCode
, $block);
1310 $this->extOnReadyCode
[] = $block;
1316 * Adds the ExtDirect code
1318 * @param array $filterNamespaces Limit the output to defined namespaces. If empty, all namespaces are generated
1321 public function addExtDirectCode(array $filterNamespaces = array()) {
1322 if ($this->extDirectCodeAdded
) {
1325 $this->extDirectCodeAdded
= TRUE;
1326 if (count($filterNamespaces) === 0) {
1327 $filterNamespaces = array('TYPO3');
1329 // For ExtDirect we need flash message support
1330 $this->addJsFile(\TYPO3\CMS\Core\Utility\GeneralUtility
::resolveBackPath($this->backPath
. '../t3lib/js/extjs/ux/flashmessages.js'));
1331 // Add language labels for ExtDirect
1332 if (TYPO3_MODE
=== 'FE') {
1333 $this->addInlineLanguageLabelArray(array(
1334 'extDirect_timeoutHeader' => $GLOBALS['TSFE']->sL('LLL:EXT:lang/locallang_misc.xml:extDirect_timeoutHeader'),
1335 'extDirect_timeoutMessage' => $GLOBALS['TSFE']->sL('LLL:EXT:lang/locallang_misc.xml:extDirect_timeoutMessage')
1338 $this->addInlineLanguageLabelArray(array(
1339 'extDirect_timeoutHeader' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_misc.xml:extDirect_timeoutHeader'),
1340 'extDirect_timeoutMessage' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_misc.xml:extDirect_timeoutMessage')
1343 $token = ($api = '');
1344 if (TYPO3_MODE
=== 'BE') {
1345 $formprotection = \TYPO3\CMS\Core\FormProtection\FormProtectionFactory
::get();
1346 $token = $formprotection->generateToken('extDirect');
1348 /** @var $extDirect \TYPO3\CMS\Core\ExtDirect\ExtDirectApi */
1349 $extDirect = \TYPO3\CMS\Core\Utility\GeneralUtility
::makeInstance('TYPO3\\CMS\\Core\\ExtDirect\\ExtDirectApi');
1350 $api = $extDirect->getApiPhp($filterNamespaces);
1352 $this->addJsInlineCode('TYPO3ExtDirectAPI', $api, FALSE);
1354 // Note: we need to iterate thru the object, because the addProvider method
1355 // does this only with multiple arguments
1356 $this->addExtOnReadyCode('
1358 TYPO3.ExtDirectToken = "' . $token . '";
1359 for (var api in Ext.app.ExtDirectAPI) {
1360 var provider = Ext.Direct.addProvider(Ext.app.ExtDirectAPI[api]);
1361 provider.on("beforecall", function(provider, transaction, meta) {
1362 if (transaction.data) {
1363 transaction.data[transaction.data.length] = TYPO3.ExtDirectToken;
1365 transaction.data = [TYPO3.ExtDirectToken];
1369 provider.on("call", function(provider, transaction, meta) {
1370 if (transaction.isForm) {
1371 transaction.params.securityToken = TYPO3.ExtDirectToken;
1377 var extDirectDebug = function(message, header, group) {
1378 var TYPO3ViewportInstance = null;
1380 if (top && top.TYPO3 && typeof top.TYPO3.Backend === "object") {
1381 TYPO3ViewportInstance = top.TYPO3.Backend;
1382 } else if (typeof TYPO3 === "object" && typeof TYPO3.Backend === "object") {
1383 TYPO3ViewportInstance = TYPO3.Backend;
1386 if (TYPO3ViewportInstance !== null) {
1387 TYPO3ViewportInstance.DebugConsole.addTab(message, header, group);
1388 } else if (typeof console === "object") {
1389 console.log(message);
1391 document.write(message);
1395 Ext.Direct.on("exception", function(event) {
1396 if (event.code === Ext.Direct.exceptions.TRANSPORT && !event.where) {
1397 TYPO3.Flashmessage.display(
1398 TYPO3.Severity.error,
1399 TYPO3.l10n.localize("extDirect_timeoutHeader"),
1400 TYPO3.l10n.localize("extDirect_timeoutMessage"),
1405 if (event.code === "parse") {
1407 "<p>" + event.xhr.responseText + "<\\/p>",
1409 "ExtDirect - Exception"
1411 } else if (event.code === "router") {
1412 TYPO3.Flashmessage.display(
1413 TYPO3.Severity.error,
1418 } else if (event.where) {
1419 backtrace = "<p style=\\"margin-top: 20px;\\">" +
1420 "<strong>Backtrace:<\\/strong><br \\/>" +
1421 event.where.replace(/#/g, "<br \\/>#") +
1424 "<p>" + event.message + "<\\/p>" + backtrace,
1426 "ExtDirect - Exception"
1434 Ext.Direct.on("event", function(event, provider) {
1435 if (typeof event.debug !== "undefined" && event.debug !== "") {
1436 extDirectDebug(event.debug, event.method, "ExtDirect - Debug");
1445 * @param string $file
1446 * @param string $rel
1447 * @param string $media
1448 * @param string $title
1449 * @param boolean $compress
1450 * @param boolean $forceOnTop
1451 * @param string $allWrap
1452 * @param boolean $excludeFromConcatenation
1455 public function addCssFile($file, $rel = 'stylesheet', $media = 'all', $title = '', $compress = TRUE, $forceOnTop = FALSE, $allWrap = '', $excludeFromConcatenation = FALSE) {
1456 if (!isset($this->cssFiles
[$file])) {
1457 $this->cssFiles
[$file] = array(
1462 'compress' => $compress,
1463 'forceOnTop' => $forceOnTop,
1464 'allWrap' => $allWrap,
1465 'excludeFromConcatenation' => $excludeFromConcatenation
1471 * Adds CSS inline code
1473 * @param string $name
1474 * @param string $block
1475 * @param boolean $compress
1476 * @param boolean $forceOnTop
1479 public function addCssInlineBlock($name, $block, $compress = FALSE, $forceOnTop = FALSE) {
1480 if (!isset($this->cssInline
[$name]) && !empty($block)) {
1481 $this->cssInline
[$name] = array(
1483 'compress' => $compress,
1484 'forceOnTop' => $forceOnTop
1490 * Call this function if you need to include the jQuery library
1492 * @param null|string $version The jQuery version that should be included, either "latest" or any available version
1493 * @param null|string $source The location of the jQuery source, can be "local", "google", "msn", "jquery" or just an URL to your jQuery lib
1494 * @param string $namespace The namespace in which the jQuery object of the specific version should be stored.
1496 * @throws \UnexpectedValueException
1498 public function loadJquery($version = NULL, $source = NULL, $namespace = self
::JQUERY_NAMESPACE_DEFAULT
) {
1499 // Set it to the version that is shipped with the TYPO3 core
1500 if ($version === NULL ||
$version === 'latest') {
1501 $version = self
::JQUERY_VERSION_LATEST
;
1503 // Check if the source is set, otherwise set it to "default"
1504 if ($source === NULL) {
1507 if ($source === 'local' && !in_array($version, $this->availableLocalJqueryVersions
)) {
1508 throw new \
UnexpectedValueException('The requested jQuery version is not available in the local filesystem.', 1341505305);
1510 if (!preg_match('/^[a-zA-Z0-9]+$/', $namespace)) {
1511 throw new \
UnexpectedValueException('The requested namespace contains non alphanumeric characters.', 1341571604);
1513 $this->jQueryVersions
[$namespace] = array(
1514 'version' => $version,
1520 * Call function if you need the prototype library
1524 public function loadPrototype() {
1525 $this->addPrototype
= TRUE;
1529 * Call function if you need the Scriptaculous library
1531 * @param string $modules Add modules you need. use "all" if you need complete modules
1534 public function loadScriptaculous($modules = 'all') {
1535 // Scriptaculous require prototype, so load prototype too.
1536 $this->addPrototype
= TRUE;
1537 $this->addScriptaculous
= TRUE;
1539 if ($modules == 'all') {
1540 foreach ($this->addScriptaculousModules
as $key => $value) {
1541 $this->addScriptaculousModules
[$key] = TRUE;
1544 $mods = \TYPO3\CMS\Core\Utility\GeneralUtility
::trimExplode(',', $modules);
1545 foreach ($mods as $mod) {
1546 if (isset($this->addScriptaculousModules
[strtolower($mod)])) {
1547 $this->addScriptaculousModules
[strtolower($mod)] = TRUE;
1555 * call this function if you need the extJS library
1557 * @param boolean $css Flag, if set the ext-css will be loaded
1558 * @param boolean $theme Flag, if set the ext-theme "grey" will be loaded
1559 * @param string $adapter Choose alternative adapter, possible values: yui, prototype, jquery
1562 public function loadExtJS($css = TRUE, $theme = TRUE, $adapter = '') {
1564 // Empty $adapter will always load the ext adapter
1565 switch (\TYPO3\CMS\Core\Utility\GeneralUtility
::strtolower(trim($adapter))) {
1566 case self
::EXTJS_ADAPTER_YUI
:
1567 $this->extJSadapter
= 'yui/ext-yui-adapter.js';
1569 case self
::EXTJS_ADAPTER_PROTOTYPE
:
1570 $this->extJSadapter
= 'prototype/ext-prototype-adapter.js';
1572 case self
::EXTJS_ADAPTER_JQUERY
:
1573 $this->extJSadapter
= 'jquery/ext-jquery-adapter.js';
1577 $this->addExtJS
= TRUE;
1578 $this->extJStheme
= $theme;
1579 $this->extJScss
= $css;
1583 * Enables ExtJs QuickTips
1588 public function enableExtJSQuickTips() {
1589 $this->enableExtJSQuickTips
= TRUE;
1593 * Call function if you need the ExtCore library
1597 public function loadExtCore() {
1598 $this->addExtCore
= TRUE;
1602 * Call function if you need the SVG library
1606 public function loadSvg() {
1607 $this->addSvg
= TRUE;
1611 * Call this function to load debug version of ExtJS. Use this for development only
1615 public function enableSvgDebug() {
1616 $this->enableSvgDebug
= TRUE;
1620 * Call this function to force flash usage with SVG library
1624 public function svgForceFlash() {
1625 $this->addMetaTag('<meta name="svg.render.forceflash" content="true" />');
1629 * Call this function to load debug version of ExtJS. Use this for development only
1633 public function enableExtJsDebug() {
1634 $this->enableExtJsDebug
= TRUE;
1638 * Call this function to load debug version of ExtCore. Use this for development only
1642 public function enableExtCoreDebug() {
1643 $this->enableExtCoreDebug
= TRUE;
1647 * Adds Javascript Inline Label. This will occur in TYPO3.lang - object
1648 * The label can be used in scripts with TYPO3.lang.<key>
1651 * @param string $key
1652 * @param string $value
1655 public function addInlineLanguageLabel($key, $value) {
1656 $this->inlineLanguageLabels
[$key] = $value;
1660 * Adds Javascript Inline Label Array. This will occur in TYPO3.lang - object
1661 * The label can be used in scripts with TYPO3.lang.<key>
1662 * Array will be merged with existing array.
1665 * @param array $array
1668 public function addInlineLanguageLabelArray(array $array) {
1669 $this->inlineLanguageLabels
= array_merge($this->inlineLanguageLabels
, $array);
1673 * Gets labels to be used in JavaScript fetched from a locallang file.
1675 * @param string $fileRef Input is a file-reference (see \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName). That file is expected to be a 'locallang.xml' file containing a valid XML TYPO3 language structure.
1676 * @param string $selectionPrefix Prefix to select the correct labels (default: '')
1677 * @param string $stripFromSelectionName Sub-prefix to be removed from label names in the result (default: '')
1678 * @param integer $errorMode Error mode (when file could not be found): 0 - syslog entry, 1 - do nothing, 2 - throw an exception
1681 public function addInlineLanguageLabelFile($fileRef, $selectionPrefix = '', $stripFromSelectionName = '', $errorMode = 0) {
1682 $index = md5($fileRef . $selectionPrefix . $stripFromSelectionName);
1683 if ($fileRef && !isset($this->inlineLanguageLabelFiles
[$index])) {
1684 $this->inlineLanguageLabelFiles
[$index] = array(
1685 'fileRef' => $fileRef,
1686 'selectionPrefix' => $selectionPrefix,
1687 'stripFromSelectionName' => $stripFromSelectionName,
1688 'errorMode' => $errorMode
1694 * Adds Javascript Inline Setting. This will occur in TYPO3.settings - object
1695 * The label can be used in scripts with TYPO3.setting.<key>
1698 * @param string $namespace
1699 * @param string $key
1700 * @param string $value
1703 public function addInlineSetting($namespace, $key, $value) {
1705 if (strpos($namespace, '.')) {
1706 $parts = explode('.', $namespace);
1707 $a = &$this->inlineSettings
;
1708 foreach ($parts as $part) {
1713 $this->inlineSettings
[$namespace][$key] = $value;
1716 $this->inlineSettings
[$key] = $value;
1721 * Adds Javascript Inline Setting. This will occur in TYPO3.settings - object
1722 * The label can be used in scripts with TYPO3.setting.<key>
1723 * Array will be merged with existing array.
1726 * @param string $namespace
1727 * @param array $array
1730 public function addInlineSettingArray($namespace, array $array) {
1732 if (strpos($namespace, '.')) {
1733 $parts = explode('.', $namespace);
1734 $a = &$this->inlineSettings
;
1735 foreach ($parts as $part) {
1738 $a = array_merge((array) $a, $array);
1740 $this->inlineSettings
[$namespace] = array_merge((array) $this->inlineSettings
[$namespace], $array);
1743 $this->inlineSettings
= array_merge($this->inlineSettings
, $array);
1748 * Adds content to body content
1750 * @param string $content
1753 public function addBodyContent($content) {
1754 $this->bodyContent
.= $content;
1757 /*****************************************************/
1759 /* Render Functions */
1761 /*****************************************************/
1763 * Render the section (Header or Footer)
1765 * @param integer $part Section which should be rendered: self::PART_COMPLETE, self::PART_HEADER or self::PART_FOOTER
1766 * @return string Content of rendered section
1768 public function render($part = self
::PART_COMPLETE
) {
1769 $this->prepareRendering();
1770 list($jsLibs, $jsFiles, $jsFooterFiles, $cssFiles, $jsInline, $cssInline, $jsFooterInline, $jsFooterLibs) = $this->renderJavaScriptAndCss();
1771 $metaTags = implode(LF
, $this->metaTags
);
1772 $markerArray = $this->getPreparedMarkerArray($jsLibs, $jsFiles, $jsFooterFiles, $cssFiles, $jsInline, $cssInline, $jsFooterInline, $jsFooterLibs, $metaTags);
1773 $template = $this->getTemplateForPart($part);
1775 return trim(\TYPO3\CMS\Core\Html\HtmlParser
::substituteMarkerArray($template, $markerArray, '###|###'));
1779 * Render the page but not the JavaScript and CSS Files
1781 * @param string $substituteHash The hash that is used for the placehoder markers
1783 * @return string Content of rendered section
1785 public function renderPageWithUncachedObjects($substituteHash) {
1786 $this->prepareRendering();
1787 $markerArray = $this->getPreparedMarkerArrayForPageWithUncachedObjects($substituteHash);
1788 $template = $this->getTemplateForPart(self
::PART_COMPLETE
);
1789 return trim(\TYPO3\CMS\Core\Html\HtmlParser
::substituteMarkerArray($template, $markerArray, '###|###'));
1793 * Renders the JavaScript and CSS files that have been added during processing
1794 * of uncached content objects (USER_INT, COA_INT)
1796 * @param string $cachedPageContent
1797 * @param string $substituteHash The hash that is used for the placehoder markers
1801 public function renderJavaScriptAndCssForProcessingOfUncachedContentObjects($cachedPageContent, $substituteHash) {
1802 $this->prepareRendering();
1803 list($jsLibs, $jsFiles, $jsFooterFiles, $cssFiles, $jsInline, $cssInline, $jsFooterInline, $jsFooterLibs) = $this->renderJavaScriptAndCss();
1804 $markerArray = array(
1805 '<!-- ###CSS_INCLUDE' . $substituteHash . '### -->' => $cssFiles,
1806 '<!-- ###CSS_INLINE' . $substituteHash . '### -->' => $cssInline,
1807 '<!-- ###JS_INLINE' . $substituteHash . '### -->' => $jsInline,
1808 '<!-- ###JS_INCLUDE' . $substituteHash . '### -->' => $jsFiles,
1809 '<!-- ###JS_LIBS' . $substituteHash . '### -->' => $jsLibs,
1810 '<!-- ###HEADERDATA' . $substituteHash . '### -->' => implode(LF
, $this->headerData
),
1811 '<!-- ###FOOTERDATA' . $substituteHash . '### -->' => implode(LF
, $this->footerData
),
1812 '<!-- ###JS_LIBS_FOOTER' . $substituteHash . '### -->' => $jsFooterLibs,
1813 '<!-- ###JS_INCLUDE_FOOTER' . $substituteHash . '### -->' => $jsFooterFiles,
1814 '<!-- ###JS_INLINE_FOOTER' . $substituteHash . '### -->' => $jsFooterInline
1816 foreach ($markerArray as $placeHolder => $content) {
1817 $cachedPageContent = str_replace($placeHolder, $content, $cachedPageContent);
1820 return $cachedPageContent;
1824 * Remove ending slashes from static header block
1825 * if the page is beeing rendered as html (not xhtml)
1826 * and define property $this->endingSlash for further use
1830 protected function prepareRendering() {
1831 if ($this->getRenderXhtml()) {
1832 $this->endingSlash
= ' /';
1834 $this->metaCharsetTag
= str_replace(' />', '>', $this->metaCharsetTag
);
1835 $this->baseUrlTag
= str_replace(' />', '>', $this->baseUrlTag
);
1836 $this->shortcutTag
= str_replace(' />', '>', $this->shortcutTag
);
1837 $this->endingSlash
= '';
1842 * Renders all JavaScript and CSS
1844 * @return array<string>
1846 protected function renderJavaScriptAndCss() {
1847 $this->executePreRenderHook();
1848 $mainJsLibs = $this->renderMainJavaScriptLibraries();
1849 if ($this->concatenateFiles ||
$this->concatenateJavascript ||
$this->concatenateCss
) {
1850 // Do the file concatenation
1851 $this->doConcatenate();
1853 if ($this->compressCss ||
$this->compressJavascript
) {
1854 // Do the file compression
1855 $this->doCompress();
1857 $this->executeRenderPostTransformHook();
1858 $cssFiles = $this->renderCssFiles();
1859 $cssInline = $this->renderCssInline();
1860 list($jsLibs, $jsFooterLibs) = $this->renderAdditionalJavaScriptLibraries();
1861 list($jsFiles, $jsFooterFiles) = $this->renderJavaScriptFiles();
1862 list($jsInline, $jsFooterInline) = $this->renderInlineJavaScript();
1863 $jsLibs = $mainJsLibs . $jsLibs;
1864 if ($this->moveJsFromHeaderToFooter
) {
1865 $jsFooterLibs = $jsLibs . LF
. $jsFooterLibs;
1867 $jsFooterFiles = $jsFiles . LF
. $jsFooterFiles;
1869 $jsFooterInline = $jsInline . LF
. $jsFooterInline;
1872 $this->executePostRenderHook($jsLibs, $jsFiles, $jsFooterFiles, $cssFiles, $jsInline, $cssInline, $jsFooterInline, $jsFooterLibs);
1873 return array($jsLibs, $jsFiles, $jsFooterFiles, $cssFiles, $jsInline, $cssInline, $jsFooterInline, $jsFooterLibs);
1877 * Fills the marker array with the given strings and trims each value
1879 * @param $jsLibs string
1880 * @param $jsFiles string
1881 * @param $jsFooterFiles string
1882 * @param $cssFiles string
1883 * @param $jsInline string
1884 * @param $cssInline string
1885 * @param $jsFooterInline string
1886 * @param $jsFooterLibs string
1887 * @param $metaTags string
1888 * @return array Marker array
1890 protected function getPreparedMarkerArray($jsLibs, $jsFiles, $jsFooterFiles, $cssFiles, $jsInline, $cssInline, $jsFooterInline, $jsFooterLibs, $metaTags) {
1891 $markerArray = array(
1892 'XMLPROLOG_DOCTYPE' => $this->xmlPrologAndDocType
,
1893 'HTMLTAG' => $this->htmlTag
,
1894 'HEADTAG' => $this->headTag
,
1895 'METACHARSET' => $this->charSet ?
str_replace('|', htmlspecialchars($this->charSet
), $this->metaCharsetTag
) : '',
1896 'INLINECOMMENT' => $this->inlineComments ? LF
. LF
. '<!-- ' . LF
. implode(LF
, $this->inlineComments
) . '-->' . LF
. LF
: '',
1897 'BASEURL' => $this->baseUrl ?
str_replace('|', $this->baseUrl
, $this->baseUrlTag
) : '',
1898 'SHORTCUT' => $this->favIcon ?
sprintf($this->shortcutTag
, htmlspecialchars($this->favIcon
), $this->iconMimeType
) : '',
1899 'CSS_INCLUDE' => $cssFiles,
1900 'CSS_INLINE' => $cssInline,
1901 'JS_INLINE' => $jsInline,
1902 'JS_INCLUDE' => $jsFiles,
1903 'JS_LIBS' => $jsLibs,
1904 'TITLE' => $this->title ?
str_replace('|', htmlspecialchars($this->title
), $this->titleTag
) : '',
1905 'META' => $metaTags,
1906 'HEADERDATA' => $this->headerData ?
implode(LF
, $this->headerData
) : '',
1907 'FOOTERDATA' => $this->footerData ?
implode(LF
, $this->footerData
) : '',
1908 'JS_LIBS_FOOTER' => $jsFooterLibs,
1909 'JS_INCLUDE_FOOTER' => $jsFooterFiles,
1910 'JS_INLINE_FOOTER' => $jsFooterInline,
1911 'BODY' => $this->bodyContent
1913 $markerArray = array_map('trim', $markerArray);
1914 return $markerArray;
1918 * Fills the marker array with the given strings and trims each value
1920 * @param string $substituteHash The hash that is used for the placehoder markers
1921 * @return array Marker array
1923 protected function getPreparedMarkerArrayForPageWithUncachedObjects($substituteHash) {
1924 $markerArray = array(
1925 'XMLPROLOG_DOCTYPE' => $this->xmlPrologAndDocType
,
1926 'HTMLTAG' => $this->htmlTag
,
1927 'HEADTAG' => $this->headTag
,
1928 'METACHARSET' => $this->charSet ?
str_replace('|', htmlspecialchars($this->charSet
), $this->metaCharsetTag
) : '',
1929 'INLINECOMMENT' => $this->inlineComments ? LF
. LF
. '<!-- ' . LF
. implode(LF
, $this->inlineComments
) . '-->' . LF
. LF
: '',
1930 'BASEURL' => $this->baseUrl ?
str_replace('|', $this->baseUrl
, $this->baseUrlTag
) : '',
1931 'SHORTCUT' => $this->favIcon ?
sprintf($this->shortcutTag
, htmlspecialchars($this->favIcon
), $this->iconMimeType
) : '',
1932 'TITLE' => $this->title ?
str_replace('|', htmlspecialchars($this->title
), $this->titleTag
) : '',
1933 'META' => implode(LF
, $this->metaTags
),
1934 'BODY' => $this->bodyContent
,
1935 'CSS_INCLUDE' => '<!-- ###CSS_INCLUDE' . $substituteHash . '### -->',
1936 'CSS_INLINE' => '<!-- ###CSS_INLINE' . $substituteHash . '### -->',
1937 'JS_INLINE' => '<!-- ###JS_INLINE' . $substituteHash . '### -->',
1938 'JS_INCLUDE' => '<!-- ###JS_INCLUDE' . $substituteHash . '### -->',
1939 'JS_LIBS' => '<!-- ###JS_LIBS' . $substituteHash . '### -->',
1940 'HEADERDATA' => '<!-- ###HEADERDATA' . $substituteHash . '### -->',
1941 'FOOTERDATA' => '<!-- ###FOOTERDATA' . $substituteHash . '### -->',
1942 'JS_LIBS_FOOTER' => '<!-- ###JS_LIBS_FOOTER' . $substituteHash . '### -->',
1943 'JS_INCLUDE_FOOTER' => '<!-- ###JS_INCLUDE_FOOTER' . $substituteHash . '### -->',
1944 'JS_INLINE_FOOTER' => '<!-- ###JS_INLINE_FOOTER' . $substituteHash . '### -->'
1946 $markerArray = array_map('trim', $markerArray);
1947 return $markerArray;
1951 * Reads the template file and returns the requested part as string
1953 * @param integer $part
1956 protected function getTemplateForPart($part) {
1957 $templateFile = \TYPO3\CMS\Core\Utility\GeneralUtility
::getFileAbsFileName($this->templateFile
, TRUE);
1958 $template = \TYPO3\CMS\Core\Utility\GeneralUtility
::getUrl($templateFile);
1959 if ($this->removeLineBreaksFromTemplate
) {
1960 $template = strtr($template, array(LF
=> '', CR
=> ''));
1962 if ($part != self
::PART_COMPLETE
) {
1963 $templatePart = explode('###BODY###', $template);
1964 $template = $templatePart[$part - 1];
1970 * Helper function for render the main JavaScript libraries,
1971 * currently: jQuery, prototype, SVG, ExtJs
1973 * @return string Content with JavaScript libraries
1975 protected function renderMainJavaScriptLibraries() {
1977 if ($this->addSvg
) {
1978 $out .= '<script src="' . $this->processJsFile(($this->backPath
. $this->svgPath
. 'svg.js')) . '" data-path="' . $this->backPath
. $this->svgPath
. '"' . ($this->enableSvgDebug ?
' data-debug="true"' : '') . '></script>';
1980 // Include jQuery Core for each namespace, depending on the version and source
1981 if (!empty($this->jQueryVersions
)) {
1982 foreach ($this->jQueryVersions
as $namespace => $jQueryVersion) {
1983 $out .= $this->renderJqueryScriptTag($jQueryVersion['version'], $jQueryVersion['source'], $namespace);
1986 if ($this->addPrototype
) {
1987 $out .= '<script src="' . $this->processJsFile(($this->backPath
. $this->prototypePath
. 'prototype.js')) . '" type="text/javascript"></script>' . LF
;
1988 unset($this->jsFiles
[$this->backPath
. $this->prototypePath
. 'prototype.js']);
1990 if ($this->addScriptaculous
) {
1992 foreach ($this->addScriptaculousModules
as $key => $value) {
1993 if ($this->addScriptaculousModules
[$key]) {
1997 // Resolve dependencies
1998 if (in_array('dragdrop', $mods) ||
in_array('controls', $mods)) {
1999 $mods = array_merge(array('effects'), $mods);
2002 foreach ($mods as $module) {
2003 $out .= '<script src="' . $this->processJsFile(($this->backPath
. $this->scriptaculousPath
. $module . '.js')) . '" type="text/javascript"></script>' . LF
;
2004 unset($this->jsFiles
[$this->backPath
. $this->scriptaculousPath
. $module . '.js']);
2007 $out .= '<script src="' . $this->processJsFile(($this->backPath
. $this->scriptaculousPath
. 'scriptaculous.js')) . '" type="text/javascript"></script>' . LF
;
2008 unset($this->jsFiles
[$this->backPath
. $this->scriptaculousPath
. 'scriptaculous.js']);
2010 // Include extCore, but only if ExtJS is not included
2011 if ($this->addExtCore
&& !$this->addExtJS
) {
2012 $out .= '<script src="' . $this->processJsFile(($this->backPath
. $this->extCorePath
. 'ext-core' . ($this->enableExtCoreDebug ?
'-debug' : '') . '.js')) . '" type="text/javascript"></script>' . LF
;
2013 unset($this->jsFiles
[$this->backPath
. $this->extCorePath
. 'ext-core' . ($this->enableExtCoreDebug ?
'-debug' : '') . '.js']);
2016 if ($this->addExtJS
) {
2017 // Use the base adapter all the time
2018 $out .= '<script src="' . $this->processJsFile(($this->backPath
. $this->extJsPath
. 'adapter/' . ($this->enableExtJsDebug ?
str_replace('.js', '-debug.js', $this->extJSadapter
) : $this->extJSadapter
))) . '" type="text/javascript"></script>' . LF
;
2019 $out .= '<script src="' . $this->processJsFile(($this->backPath
. $this->extJsPath
. 'ext-all' . ($this->enableExtJsDebug ?
'-debug' : '') . '.js')) . '" type="text/javascript"></script>' . LF
;
2020 // Add extJS localization
2021 // Load standard ISO mapping and modify for use with ExtJS
2022 $localeMap = $this->locales
->getIsoMapping();
2023 $localeMap[''] = 'en';
2024 $localeMap['default'] = 'en';
2026 $localeMap['gr'] = 'el_GR';
2027 // Norwegian Bokmaal
2028 $localeMap['no'] = 'no_BO';
2030 $localeMap['se'] = 'se_SV';
2031 $extJsLang = isset($localeMap[$this->lang
]) ?
$localeMap[$this->lang
] : $this->lang
;
2032 // TODO autoconvert file from UTF8 to current BE charset if necessary!!!!
2033 $extJsLocaleFile = $this->extJsPath
. 'locale/ext-lang-' . $extJsLang . '.js';
2034 if (file_exists(PATH_typo3
. $extJsLocaleFile)) {
2035 $out .= '<script src="' . $this->processJsFile(($this->backPath
. $extJsLocaleFile)) . '" type="text/javascript" charset="utf-8"></script>' . LF
;
2037 // Remove extjs from JScodeLibArray
2038 unset($this->jsFiles
[$this->backPath
. $this->extJsPath
. 'ext-all.js'], $this->jsFiles
[$this->backPath
. $this->extJsPath
. 'ext-all-debug.js']);
2040 if (count($this->inlineLanguageLabelFiles
)) {
2041 foreach ($this->inlineLanguageLabelFiles
as $languageLabelFile) {
2042 $this->includeLanguageFileForInline($languageLabelFile['fileRef'], $languageLabelFile['selectionPrefix'], $languageLabelFile['stripFromSelectionName'], $languageLabelFile['$errorMode']);
2045 unset($this->inlineLanguageLabelFiles
);
2046 // Convert labels/settings back to UTF-8 since json_encode() only works with UTF-8:
2047 if ($this->getCharSet() !== 'utf-8') {
2048 if ($this->inlineLanguageLabels
) {
2049 $this->csConvObj
->convArray($this->inlineLanguageLabels
, $this->getCharSet(), 'utf-8');
2051 if ($this->inlineSettings
) {
2052 $this->csConvObj
->convArray($this->inlineSettings
, $this->getCharSet(), 'utf-8');
2055 $inlineSettings = $this->inlineLanguageLabels ?
'TYPO3.lang = ' . json_encode($this->inlineLanguageLabels
) . ';' : '';
2056 $inlineSettings .= $this->inlineSettings ?
'TYPO3.settings = ' . json_encode($this->inlineSettings
) . ';' : '';
2057 if ($this->addExtCore ||
$this->addExtJS
) {
2058 // Set clear.gif, move it on top, add handler code
2060 if (count($this->extOnReadyCode
)) {
2061 foreach ($this->extOnReadyCode
as $block) {
2065 $out .= $this->inlineJavascriptWrap
[0] . '
2067 Ext.BLANK_IMAGE_URL = "' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility
::locationHeaderUrl(($this->backPath
. 'gfx/clear.gif'))) . '";' . LF
. $inlineSettings . 'Ext.onReady(function() {' . ($this->enableExtJSQuickTips ?
'Ext.QuickTips.init();' . LF
: '') . $code . ' });' . $this->inlineJavascriptWrap
[1];
2068 unset($this->extOnReadyCode
);
2069 // Include TYPO3.l10n object
2070 if (TYPO3_MODE
=== 'BE') {
2071 $out .= '<script src="' . $this->processJsFile(($this->backPath
. 'sysext/lang/res/js/be/typo3lang.js')) . '" type="text/javascript" charset="utf-8"></script>' . LF
;
2073 if ($this->extJStheme
) {
2074 if (isset($GLOBALS['TBE_STYLES']['extJS']['theme'])) {
2075 $this->addCssFile($this->backPath
. $GLOBALS['TBE_STYLES']['extJS']['theme'], 'stylesheet', 'all', '', TRUE, TRUE);
2077 $this->addCssFile($this->backPath
. $this->extJsPath
. 'resources/css/xtheme-blue.css', 'stylesheet', 'all', '', TRUE, TRUE);
2080 if ($this->extJScss
) {
2081 if (isset($GLOBALS['TBE_STYLES']['extJS']['all'])) {
2082 $this->addCssFile($this->backPath
. $GLOBALS['TBE_STYLES']['extJS']['all'], 'stylesheet', 'all', '', TRUE, TRUE);
2084 $this->addCssFile($this->backPath
. $this->extJsPath
. 'resources/css/ext-all-notheme.css', 'stylesheet', 'all', '', TRUE, TRUE);
2088 if ($inlineSettings) {
2089 $out .= $this->inlineJavascriptWrap
[0] . $inlineSettings . $this->inlineJavascriptWrap
[1];
2096 * Renders the HTML script tag for the given jQuery version.
2098 * @param string $version The jQuery version that should be included, either "latest" or any available version
2099 * @param string $source The location of the jQuery source, can be "local", "google", "msn" or "jquery
2100 * @param string $namespace The namespace in which the jQuery object of the specific version should be stored
2103 protected function renderJqueryScriptTag($version, $source, $namespace) {
2105 case isset($this->jQueryCdnUrls
[$source]):
2106 if ($this->enableJqueryDebug
) {
2109 $minifyPart = '.min';
2111 $jQueryFileName = sprintf($this->jQueryCdnUrls
[$source], $version, $minifyPart);
2113 case $source === 'local':
2114 $jQueryFileName = $this->backPath
. $this->jQueryPath
. 'jquery-' . rawurlencode($version);
2115 if ($this->enableJqueryDebug
) {
2116 $jQueryFileName .= '.js';
2118 $jQueryFileName .= '.min.js';
2122 $jQueryFileName = $source;
2124 // Include the jQuery Core
2125 $scriptTag = '<script src="' . htmlspecialchars($jQueryFileName) . '" type="text/javascript"></script>' . LF
;
2126 // Set the noConflict mode to be available via "TYPO3.jQuery" in all installations
2127 switch ($namespace) {
2128 case self
::JQUERY_NAMESPACE_DEFAULT_NOCONFLICT
:
2129 $scriptTag .= \TYPO3\CMS\Core\Utility\GeneralUtility
::wrapJS('jQuery.noConflict();');
2131 case self
::JQUERY_NAMESPACE_NONE
:
2133 case self
::JQUERY_NAMESPACE_DEFAULT
:
2136 $scriptTag .= \TYPO3\CMS\Core\Utility\GeneralUtility
::wrapJS('var TYPO3 = TYPO3 || {}; TYPO3.' . $namespace . ' = jQuery.noConflict(true);');
2147 protected function renderCssFiles() {
2149 if (count($this->cssFiles
)) {
2150 foreach ($this->cssFiles
as $file => $properties) {
2151 $file = \TYPO3\CMS\Core\Utility\GeneralUtility
::resolveBackPath($file);
2152 $file = \TYPO3\CMS\Core\Utility\GeneralUtility
::createVersionNumberedFilename($file);
2153 $tag = '<link rel="' . htmlspecialchars($properties['rel']) . '" type="text/css" href="' . htmlspecialchars($file) . '" media="' . htmlspecialchars($properties['media']) . '"' . ($properties['title'] ?
' title="' . htmlspecialchars($properties['title']) . '"' : '') . $this->endingSlash
. '>';
2154 if ($properties['allWrap'] && strpos($properties['allWrap'], '|') !== FALSE) {
2155 $tag = str_replace('|', $tag, $properties['allWrap']);
2157 if ($properties['forceOnTop']) {
2158 $cssFiles = $tag . LF
. $cssFiles;
2160 $cssFiles .= LF
. $tag;
2172 protected function renderCssInline() {
2174 if (count($this->cssInline
)) {
2175 foreach ($this->cssInline
as $name => $properties) {
2176 if ($properties['forceOnTop']) {
2177 $cssInline = '/*' . htmlspecialchars($name) . '*/' . LF
. $properties['code'] . LF
. $cssInline;
2179 $cssInline .= '/*' . htmlspecialchars($name) . '*/' . LF
. $properties['code'] . LF
;
2182 $cssInline = $this->inlineCssWrap
[0] . $cssInline . $this->inlineCssWrap
[1];
2188 * Render JavaScipt libraries
2190 * @return array<string> jsLibs and jsFooterLibs strings
2192 protected function renderAdditionalJavaScriptLibraries() {
2195 if (count($this->jsLibs
)) {
2196 foreach ($this->jsLibs
as $properties) {
2197 $properties['file'] = \TYPO3\CMS\Core\Utility\GeneralUtility
::resolveBackPath($properties['file']);
2198 $properties['file'] = \TYPO3\CMS\Core\Utility\GeneralUtility
::createVersionNumberedFilename($properties['file']);
2199 $tag = '<script src="' . htmlspecialchars($properties['file']) . '" type="' . htmlspecialchars($properties['type']) . '"></script>';
2200 if ($properties['allWrap'] && strpos($properties['allWrap'], '|') !== FALSE) {
2201 $tag = str_replace('|', $tag, $properties['allWrap']);
2203 if ($properties['forceOnTop']) {
2204 if ($properties['section'] === self
::PART_HEADER
) {
2205 $jsLibs = $tag . LF
. $jsLibs;
2207 $jsFooterLibs = $tag . LF
. $jsFooterLibs;
2210 if ($properties['section'] === self
::PART_HEADER
) {
2211 $jsLibs .= LF
. $tag;
2213 $jsFooterLibs .= LF
. $tag;
2218 if ($this->moveJsFromHeaderToFooter
) {
2219 $jsFooterLibs = $jsLibs . LF
. $jsFooterLibs;
2222 return array($jsLibs, $jsFooterLibs);
2226 * Render JavaScript files
2228 * @return array<string> jsFiles and jsFooterFiles strings
2230 protected function renderJavaScriptFiles() {
2232 $jsFooterFiles = '';
2233 if (count($this->jsFiles
)) {
2234 foreach ($this->jsFiles
as $file => $properties) {
2235 $file = \TYPO3\CMS\Core\Utility\GeneralUtility
::resolveBackPath($file);
2236 $file = \TYPO3\CMS\Core\Utility\GeneralUtility
::createVersionNumberedFilename($file);
2237 $tag = '<script src="' . htmlspecialchars($file) . '" type="' . htmlspecialchars($properties['type']) . '"></script>';
2238 if ($properties['allWrap'] && strpos($properties['allWrap'], '|') !== FALSE) {
2239 $tag = str_replace('|', $tag, $properties['allWrap']);
2241 if ($properties['forceOnTop']) {
2242 if ($properties['section'] === self
::PART_HEADER
) {
2243 $jsFiles = $tag . LF
. $jsFiles;
2245 $jsFooterFiles = $tag . LF
. $jsFooterFiles;
2248 if ($properties['section'] === self
::PART_HEADER
) {
2249 $jsFiles .= LF
. $tag;
2251 $jsFooterFiles .= LF
. $tag;
2256 if ($this->moveJsFromHeaderToFooter
) {
2257 $jsFooterFiles = $jsFiles . LF
. $jsFooterFiles;
2260 return array($jsFiles, $jsFooterFiles);
2264 * Render inline JavaScript
2266 * @return array<string> jsInline and jsFooterInline string
2268 protected function renderInlineJavaScript() {
2270 $jsFooterInline = '';
2271 if (count($this->jsInline
)) {
2272 foreach ($this->jsInline
as $name => $properties) {
2273 if ($properties['forceOnTop']) {
2274 if ($properties['section'] === self
::PART_HEADER
) {
2275 $jsInline = '/*' . htmlspecialchars($name) . '*/' . LF
. $properties['code'] . LF
. $jsInline;
2277 $jsFooterInline = '/*' . htmlspecialchars($name) . '*/' . LF
. $properties['code'] . LF
. $jsFooterInline;
2280 if ($properties['section'] === self
::PART_HEADER
) {
2281 $jsInline .= '/*' . htmlspecialchars($name) . '*/' . LF
. $properties['code'] . LF
;
2283 $jsFooterInline .= '/*' . htmlspecialchars($name) . '*/' . LF
. $properties['code'] . LF
;
2289 $jsInline = $this->inlineJavascriptWrap
[0] . $jsInline . $this->inlineJavascriptWrap
[1];
2291 if ($jsFooterInline) {
2292 $jsFooterInline = $this->inlineJavascriptWrap
[0] . $jsFooterInline . $this->inlineJavascriptWrap
[1];
2294 if ($this->moveJsFromHeaderToFooter
) {
2295 $jsFooterInline = $jsInline . LF
. $jsFooterInline;
2298 return array($jsInline, $jsFooterInline);
2302 * Include language file for inline usage
2304 * @param string $fileRef
2305 * @param string $selectionPrefix
2306 * @param string $stripFromSelectionName
2307 * @param integer $errorMode
2309 * @throws \RuntimeException
2311 protected function includeLanguageFileForInline($fileRef, $selectionPrefix = '', $stripFromSelectionName = '', $errorMode = 0) {
2312 if (!isset($this->lang
) ||
!isset($this->charSet
)) {
2313 throw new \
RuntimeException('Language and character encoding are not set.', 1284906026);
2315 $labelsFromFile = array();
2316 $allLabels = \TYPO3\CMS\Core\Utility\GeneralUtility
::readLLfile($fileRef, $this->lang
, $this->charSet
, $errorMode);
2317 // Regular expression to strip the selection prefix and possibly something from the label name:
2318 $labelPattern = '#^' . preg_quote($selectionPrefix, '#') . '(' . preg_quote($stripFromSelectionName, '#') . ')?#';
2319 if ($allLabels !== FALSE) {
2320 // Merge language specific translations:
2321 if ($this->lang
!== 'default' && isset($allLabels[$this->lang
])) {
2322 $labels = array_merge($allLabels['default'], $allLabels[$this->lang
]);
2324 $labels = $allLabels['default'];
2326 // Iterate through all locallang labels:
2327 foreach ($labels as $label => $value) {
2328 if ($selectionPrefix === '') {
2329 $labelsFromFile[$label] = $value;
2330 } elseif (strpos($label, $selectionPrefix) === 0) {
2331 $key = preg_replace($labelPattern, '', $label);
2332 $labelsFromFile[$label] = $value;
2335 $this->inlineLanguageLabels
= array_merge($this->inlineLanguageLabels
, $labelsFromFile);
2339 /*****************************************************/
2343 /*****************************************************/
2345 * Concatenate files into one file
2346 * registered handler
2350 protected function doConcatenate() {
2351 $this->doConcatenateCss();
2352 $this->doConcatenateJavaScript();
2356 * Concatenate JavaScript files according to the configuration.
2360 protected function doConcatenateJavaScript() {
2361 if ($this->concatenateFiles ||
$this->concatenateJavascript
) {
2362 if (!empty($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE
]['jsConcatenateHandler'])) {
2363 // use external concatenation routine
2365 'jsLibs' => &$this->jsLibs
,
2366 'jsFiles' => &$this->jsFiles
,
2367 'jsFooterFiles' => &$this->jsFooterFiles
,
2368 'headerData' => &$this->headerData
,
2369 'footerData' => &$this->footerData
2371 \TYPO3\CMS\Core\Utility\GeneralUtility
::callUserFunction($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE
]['jsConcatenateHandler'], $params, $this);
2373 $this->jsLibs
= $this->getCompressor()->concatenateJsFiles($this->jsLibs
);
2374 $this->jsFiles
= $this->getCompressor()->concatenateJsFiles($this->jsFiles
);
2375 $this->jsFooterFiles
= $this->getCompressor()->concatenateJsFiles($this->jsFooterFiles
);
2381 * Concatenate CSS files according to configuration.
2385 protected function doConcatenateCss() {
2386 if ($this->concatenateFiles ||
$this->concatenateCss
) {
2387 if (!empty($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE
]['cssConcatenateHandler'])) {
2388 // use external concatenation routine
2390 'cssFiles' => &$this->cssFiles
,
2391 'headerData' => &$this->headerData
,
2392 'footerData' => &$this->footerData
2394 \TYPO3\CMS\Core\Utility\GeneralUtility
::callUserFunction($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE
]['cssConcatenateHandler'], $params, $this);
2396 $cssOptions = array();
2397 if (TYPO3_MODE
=== 'BE') {
2398 $cssOptions = array('baseDirectories' => $GLOBALS['TBE_TEMPLATE']->getSkinStylesheetDirectories());
2400 $this->cssFiles
= $this->getCompressor()->concatenateCssFiles($this->cssFiles
, $cssOptions);
2406 * Compresses inline code
2410 protected function doCompress() {
2411 $this->doCompressJavaScript();
2412 $this->doCompressCss();
2416 * Compresses CSS according to configuration.
2420 protected function doCompressCss() {
2421 if ($this->compressCss
) {
2422 // Use external compression routine
2424 'cssInline' => &$this->cssInline
,
2425 'cssFiles' => &$this->cssFiles
,
2426 'headerData' => &$this->headerData
,
2427 'footerData' => &$this->footerData
2429 if (!empty($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE
]['cssCompressHandler'])) {
2430 // use external concatenation routine
2431 \TYPO3\CMS\Core\Utility\GeneralUtility
::callUserFunction($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE
]['cssCompressHandler'], $params, $this);
2433 $this->cssFiles
= $this->getCompressor()->compressCssFiles($this->cssFiles
);
2439 * Compresses JavaScript according to configuration.
2443 protected function doCompressJavaScript() {
2444 if ($this->compressJavascript
) {
2445 if (!empty($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE
]['jsCompressHandler'])) {
2446 // Use external compression routine
2448 'jsInline' => &$this->jsInline
,
2449 'jsFooterInline' => &$this->jsFooterInline
,
2450 'jsLibs' => &$this->jsLibs
,
2451 'jsFiles' => &$this->jsFiles
,
2452 'jsFooterFiles' => &$this->jsFooterFiles
,
2453 'headerData' => &$this->headerData
,
2454 'footerData' => &$this->footerData
2456 \TYPO3\CMS\Core\Utility\GeneralUtility
::callUserFunction($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE
]['jsCompressHandler'], $params, $this);
2458 // Traverse the arrays, compress files
2459 if (count($this->jsInline
)) {
2460 foreach ($this->jsInline
as $name => $properties) {
2461 if ($properties['compress']) {
2463 $this->jsInline
[$name]['code'] = \TYPO3\CMS\Core\Utility\GeneralUtility
::minifyJavaScript($properties['code'], $error);
2465 $this->compressError
.= 'Error with minify JS Inline Block "' . $name . '": ' . $error . LF
;
2470 $this->jsLibs
= $this->getCompressor()->compressJsFiles($this->jsLibs
);
2471 $this->jsFiles
= $this->getCompressor()->compressJsFiles($this->jsFiles
);
2472 $this->jsFooterFiles
= $this->getCompressor()->compressJsFiles($this->jsFooterFiles
);
2478 * Returns instance of t3lib_Compressor
2480 * @return \TYPO3\CMS\Core\Resource\ResourceCompressor Instance of t3lib_Compressor
2482 protected function getCompressor() {
2483 if ($this->compressor
=== NULL) {
2484 $this->compressor
= \TYPO3\CMS\Core\Utility\GeneralUtility
::makeInstance('TYPO3\\CMS\\Core\\Resource\\ResourceCompressor');
2486 return $this->compressor
;
2490 * Processes a Javascript file dependent on the current context
2492 * Adds the version number for Frontend, compresses the file for Backend
2494 * @param string $filename Filename
2495 * @return string New filename
2497 protected function processJsFile($filename) {
2498 switch (TYPO3_MODE
) {
2500 if ($this->compressJavascript
) {
2501 $filename = $this->getCompressor()->compressJsFile($filename);
2503 $filename = \TYPO3\CMS\Core\Utility\GeneralUtility
::createVersionNumberedFilename($filename);
2507 if ($this->compressJavascript
) {
2508 $filename = $this->getCompressor()->compressJsFile($filename);
2515 /*****************************************************/
2519 /*****************************************************/
2521 * Execute PreRenderHook for possible manuipulation
2525 protected function executePreRenderHook() {
2526 if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-preProcess'])) {
2528 'jsLibs' => &$this->jsLibs
,
2529 'jsFooterLibs' => &$this->jsFooterLibs
,
2530 'jsFiles' => &$this->jsFiles
,
2531 'jsFooterFiles' => &$this->jsFooterFiles
,
2532 'cssFiles' => &$this->cssFiles
,
2533 'headerData' => &$this->headerData
,
2534 'footerData' => &$this->footerData
,
2535 'jsInline' => &$this->jsInline
,
2536 'jsFooterInline' => &$this->jsFooterInline
,
2537 'cssInline' => &$this->cssInline
2539 foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-preProcess'] as $hook) {
2540 \TYPO3\CMS\Core\Utility\GeneralUtility
::callUserFunction($hook, $params, $this);
2546 * PostTransform for possible manuipulation of concatenated and compressed files
2550 protected function executeRenderPostTransformHook() {
2551 if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-postTransform'])) {
2553 'jsLibs' => &$this->jsLibs
,
2554 'jsFooterLibs' => &$this->jsFooterLibs
,
2555 'jsFiles' => &$this->jsFiles
,
2556 'jsFooterFiles' => &$this->jsFooterFiles
,
2557 'cssFiles' => &$this->cssFiles
,
2558 'headerData' => &$this->headerData
,
2559 'footerData' => &$this->footerData
,
2560 'jsInline' => &$this->jsInline
,
2561 'jsFooterInline' => &$this->jsFooterInline
,
2562 'cssInline' => &$this->cssInline
2564 foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-postTransform'] as $hook) {
2565 \TYPO3\CMS\Core\Utility\GeneralUtility
::callUserFunction($hook, $params, $this);
2571 * Execute postRenderHook for possible manipulation
2573 * @param $jsLibs string
2574 * @param $jsFiles string
2575 * @param $jsFooterFiles string
2576 * @param $cssFiles string
2577 * @param $jsInline string
2578 * @param $cssInline string
2579 * @param $jsFooterInline string
2580 * @param $jsFooterLibs string
2583 protected function executePostRenderHook(&$jsLibs, &$jsFiles, &$jsFooterFiles, &$cssFiles, &$jsInline, &$cssInline, &$jsFooterInline, &$jsFooterLibs) {
2584 if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-postProcess'])) {
2586 'jsLibs' => &$jsLibs,
2587 'jsFiles' => &$jsFiles,
2588 'jsFooterFiles' => &$jsFooterFiles,
2589 'cssFiles' => &$cssFiles,
2590 'headerData' => &$this->headerData
,
2591 'footerData' => &$this->footerData
,
2592 'jsInline' => &$jsInline,
2593 'cssInline' => &$cssInline,
2594 'xmlPrologAndDocType' => &$this->xmlPrologAndDocType
,
2595 'htmlTag' => &$this->htmlTag
,
2596 'headTag' => &$this->headTag
,
2597 'charSet' => &$this->charSet
,
2598 'metaCharsetTag' => &$this->metaCharsetTag
,
2599 'shortcutTag' => &$this->shortcutTag
,
2600 'inlineComments' => &$this->inlineComments
,
2601 'baseUrl' => &$this->baseUrl
,
2602 'baseUrlTag' => &$this->baseUrlTag
,
2603 'favIcon' => &$this->favIcon
,
2604 'iconMimeType' => &$this->iconMimeType
,
2605 'titleTag' => &$this->titleTag
,
2606 'title' => &$this->title
,
2607 'metaTags' => &$this->metaTags
,
2608 'jsFooterInline' => &$jsFooterInline,
2609 'jsFooterLibs' => &$jsFooterLibs,
2610 'bodyContent' => &$this->bodyContent
2612 foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-postProcess'] as $hook) {
2613 \TYPO3\CMS\Core\Utility\GeneralUtility
::callUserFunction($hook, $params, $this);