2 /***************************************************************
5 * (c) 2009-2010 Steffen Kamper (info@sk-typo3.de)
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 * A copy is found in the textfile GPL.txt and important notices to the license
17 * from the author is found in LICENSE.txt distributed with these scripts.
20 * This script is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
29 * TYPO3 pageRender class (new in TYPO3 4.3.0)
30 * This class render the HTML of a webpage, usable for BE and FE
32 * @author Steffen Kamper <info@sk-typo3.de>
37 class t3lib_PageRenderer
implements t3lib_Singleton
{
39 protected $compressJavascript = FALSE;
40 protected $compressCss = FALSE;
41 protected $removeLineBreaksFromTemplate = FALSE;
43 protected $concatenateFiles = FALSE;
45 protected $moveJsFromHeaderToFooter = FALSE;
47 /* @var t3lib_cs Instance of t3lib_cs */
51 /* @var t3lib_Compressor Instance of t3lib_Compressor */
52 protected $compressor;
54 // static array containing associative array for the included files
55 protected static $jsFiles = array();
56 protected static $jsFooterFiles = array();
57 protected static $jsLibs = array();
58 protected static $jsFooterLibs = array();
59 protected static $cssFiles = array();
66 protected $renderXhtml = TRUE;
68 // static header blocks
69 protected $xmlPrologAndDocType = '';
70 protected $metaTags = array();
71 protected $inlineComments = array();
72 protected $headerData = array();
73 protected $footerData = array();
74 protected $titleTag = '<title>|</title>';
75 protected $metaCharsetTag = '<meta http-equiv="Content-Type" content="text/html; charset=|" />';
76 protected $htmlTag = '<html>';
77 protected $headTag = '<head>';
78 protected $baseUrlTag = '<base href="|" />';
79 protected $iconMimeType = '';
80 protected $shortcutTag = '<link rel="shortcut icon" href="%1$s"%2$s />
81 <link rel="icon" href="%1$s"%2$s />';
83 // static inline code blocks
84 protected $jsInline = array();
85 protected $jsFooterInline = array();
86 protected $extOnReadyCode = array();
87 protected $cssInline = array();
89 protected $bodyContent;
91 protected $templateFile;
93 protected $jsLibraryNames = array('prototype', 'scriptaculous', 'extjs');
95 const PART_COMPLETE
= 0;
96 const PART_HEADER
= 1;
97 const PART_FOOTER
= 2;
99 // paths to contibuted libraries
100 protected $prototypePath = 'contrib/prototype/';
101 protected $scriptaculousPath = 'contrib/scriptaculous/';
102 protected $extCorePath = 'contrib/extjs/';
103 protected $extJsPath = 'contrib/extjs/';
104 protected $svgPath = 'contrib/websvg/';
107 // internal flags for JS-libraries
108 protected $addPrototype = FALSE;
109 protected $addScriptaculous = FALSE;
110 protected $addScriptaculousModules = array('builder' => FALSE, 'effects' => FALSE, 'dragdrop' => FALSE, 'controls' => FALSE, 'slider' => FALSE);
111 protected $addExtJS = FALSE;
112 protected $addExtCore = FALSE;
113 protected $extJSadapter = 'ext/ext-base.js';
116 protected $enableExtJsDebug = FALSE;
117 protected $enableExtCoreDebug = FALSE;
119 // available adapters for extJs
120 const EXTJS_ADAPTER_JQUERY
= 'jquery';
121 const EXTJS_ADAPTER_PROTOTYPE
= 'prototype';
122 const EXTJS_ADAPTER_YUI
= 'yui';
124 protected $extJStheme = TRUE;
125 protected $extJScss = TRUE;
127 protected $enableExtJSQuickTips = FALSE;
129 protected $inlineLanguageLabels = array();
130 protected $inlineLanguageLabelFiles = array();
131 protected $inlineSettings = array();
133 protected $inlineJavascriptWrap = array();
135 // saves error messages generated during compression
136 protected $compressError = '';
139 protected $addSvg = FALSE;
140 protected $enableSvgDebug = FALSE;
143 // used by BE modules
149 * @param string $templateFile declare the used template file. Omit this parameter will use default template
150 * @param string $backPath relative path to typo3-folder. It varies for BE modules, in FE it will be typo3/
153 public function __construct($templateFile = '', $backPath = NULL) {
156 $this->csConvObj
= t3lib_div
::makeInstance('t3lib_cs');
158 if (strlen($templateFile)) {
159 $this->templateFile
= $templateFile;
161 $this->backPath
= isset($backPath) ?
$backPath : $GLOBALS['BACK_PATH'];
163 $this->inlineJavascriptWrap
= array(
164 '<script type="text/javascript">' . LF
. '/*<![CDATA[*/' . LF
. '<!-- ' . LF
,
165 '// -->' . LF
. '/*]]>*/' . LF
. '</script>' . LF
167 $this->inlineCssWrap
= array(
168 '<style type="text/css">' . LF
. '/*<![CDATA[*/' . LF
. '<!-- ' . LF
,
169 '-->' . LF
. '/*]]>*/' . LF
. '</style>' . LF
175 * reset all vars to initial values
179 protected function reset() {
180 $this->templateFile
= TYPO3_mainDir
. 'templates/template_page_backend.html';
181 $this->jsFiles
= array();
182 $this->jsFooterFiles
= array();
183 $this->jsInline
= array();
184 $this->jsFooterInline
= array();
185 $this->jsLibs
= array();
186 $this->cssFiles
= array();
187 $this->cssInline
= array();
188 $this->metaTags
= array();
189 $this->inlineComments
= array();
190 $this->headerData
= array();
191 $this->footerData
= array();
192 $this->extOnReadyCode
= array();
195 /*****************************************************/
200 /*****************************************************/
205 * @param string $title title of webpage
208 public function setTitle($title) {
209 $this->title
= $title;
214 * Enables/disables rendering of XHTML code
216 * @param boolean $enable Enable XHTML
219 public function setRenderXhtml($enable) {
220 $this->renderXhtml
= $enable;
224 * Sets xml prolog and docType
226 * @param string $xmlPrologAndDocType complete tags for xml prolog and docType
229 public function setXmlPrologAndDocType($xmlPrologAndDocType) {
230 $this->xmlPrologAndDocType
= $xmlPrologAndDocType;
236 * @param string $charSet used charset
239 public function setCharSet($charSet) {
240 $this->charSet
= $charSet;
246 * @param string $lang used language
249 public function setLanguage($lang) {
256 * @param string $htmlTag html tag
259 public function setHtmlTag($htmlTag) {
260 $this->htmlTag
= $htmlTag;
266 * @param string $tag head tag
269 public function setHeadTag($headTag) {
270 $this->headTag
= $headTag;
276 * @param string $favIcon
279 public function setFavIcon($favIcon) {
280 $this->favIcon
= $favIcon;
284 * Sets icon mime type
286 * @param string $iconMimeType
289 public function setIconMimeType($iconMimeType) {
290 $this->iconMimeType
= $iconMimeType;
299 public function setBaseUrl($baseUrl) {
300 $this->baseUrl
= $baseUrl;
306 * @param string $file
309 public function setTemplateFile($file) {
310 $this->templateFile
= $file;
316 * @param string $backPath
319 public function setBackPath($backPath) {
320 $this->backPath
= $backPath;
324 * Sets Content for Body
326 * @param string $content
329 public function setBodyContent($content) {
330 $this->bodyContent
= $content;
334 * Sets Path for prototype library (relative to typo3 directory)
339 public function setPrototypePath($path) {
340 $this->prototypePath
= $path;
344 * Sets Path for scriptaculous library (relative to typo3 directory)
346 * @param string $path
349 public function setScriptaculousPath($path) {
350 $this->scriptaculousPath
= $path;
354 * Sets Path for Ext Core library (relative to typo3 directory)
356 * @param string $path
359 public function setExtCorePath($path) {
360 $this->extCorePath
= $path;
364 * Sets Path for ExtJs library (relative to typo3 directory)
366 * @param string $path
369 public function setExtJsPath($path) {
370 $this->extJsPath
= $path;
374 * Sets Path for SVG library (websvg)
376 * @param string $path
379 public function setSvgPath($path) {
380 $this->svgPath
= $path;
383 /*****************************************************/
385 /* Public Enablers / Disablers */
388 /*****************************************************/
391 * Enables MoveJsFromHeaderToFooter
396 public function enableMoveJsFromHeaderToFooter() {
397 $this->moveJsFromHeaderToFooter
= TRUE;
401 * Disables MoveJsFromHeaderToFooter
406 public function disableMoveJsFromHeaderToFooter() {
407 $this->moveJsFromHeaderToFooter
= FALSE;
411 * Enables compression of javascript
416 public function enableCompressJavascript() {
417 $this->compressJavascript
= TRUE;
421 * Disables compression of javascript
426 public function disableCompressJavascript() {
427 $this->compressJavascript
= FALSE;
431 * Enables compression of css
436 public function enableCompressCss() {
437 $this->compressCss
= TRUE;
441 * Disables compression of css
446 public function disableCompressCss() {
447 $this->compressCss
= FALSE;
451 * Enables concatenation of js/css files
456 public function enableConcatenateFiles() {
457 $this->concatenateFiles
= TRUE;
461 * Disables concatenation of js/css files
466 public function disableConcatenateFiles() {
467 $this->concatenateFiles
= FALSE;
471 * Sets removal of all line breaks in template
476 public function enableRemoveLineBreaksFromTemplate() {
477 $this->removeLineBreaksFromTemplate
= TRUE;
481 * Unsets removal of all line breaks in template
486 public function disableRemoveLineBreaksFromTemplate() {
487 $this->removeLineBreaksFromTemplate
= FALSE;
492 * This is a shortcut to switch off all compress/concatenate features to enable easier debug
497 public function enableDebugMode() {
498 $this->compressJavascript
= FALSE;
499 $this->compressCss
= FALSE;
500 $this->concatenateFiles
= FALSE;
501 $this->removeLineBreaksFromTemplate
= FALSE;
502 $this->enableExtCoreDebug
= TRUE;
503 $this->enableExtJsDebug
= TRUE;
504 $this->enableSvgDebug
= TRUE;
507 /*****************************************************/
512 /*****************************************************/
517 * @return string $title title of webpage
519 public function getTitle() {
526 * @return string $charSet
528 public function getCharSet() {
529 return $this->charSet
;
535 * @return string $lang
537 public function getLanguage() {
542 * Returns rendering mode XHTML or HTML
544 * @return boolean TRUE if XHTML, FALSE if HTML
546 public function getRenderXhtml() {
547 return $this->renderXhtml
;
553 * @return string $htmlTag html tag
555 public function getHtmlTag() {
556 return $this->htmlTag
;
562 * @return string $tag head tag
564 public function getHeadTag() {
565 return $this->headTag
;
571 * @return string $favIcon
573 public function getFavIcon() {
574 return $this->favIcon
;
578 * Gets icon mime type
580 * @return string $iconMimeType
582 public function getIconMimeType() {
583 return $this->iconMimeType
;
589 * @return string $url
591 public function getBaseUrl() {
592 return $this->baseUrl
;
598 * @return string $file
600 public function getTemplateFile($file) {
601 return $this->templateFile
;
605 * Gets MoveJsFromHeaderToFooter
609 public function getMoveJsFromHeaderToFooter() {
610 return $this->moveJsFromHeaderToFooter
;
614 * Gets compress of javascript
618 public function getCompressJavascript() {
619 return $this->compressJavascript
;
623 * Gets compress of css
627 public function getCompressCss() {
628 return $this->compressCss
;
632 * Gets concatenate of files
636 public function getConcatenateFiles() {
637 return $this->concatenateFiles
;
641 * Gets remove of empty lines from template
645 public function getRemoveLineBreaksFromTemplate() {
646 return $this->removeLineBreaksFromTemplate
;
650 * Gets content for body
654 public function getBodyContent() {
655 return $this->bodyContent
;
659 * Gets Path for prototype library (relative to typo3 directory)
663 public function getPrototypePath() {
664 return $this->prototypePath
;
668 * Gets Path for scriptaculous library (relative to typo3 directory)
672 public function getScriptaculousPath() {
673 return $this->scriptaculousPath
;
677 * Gets Path for Ext Core library (relative to typo3 directory)
681 public function getExtCorePath() {
682 return $this->extCorePath
;
686 * Gets Path for ExtJs library (relative to typo3 directory)
690 public function getExtJsPath() {
691 return $this->extJsPath
;
695 * Gets Path for SVG library (relative to typo3 directory)
699 public function getSvgPath() {
700 return $this->svgPath
;
704 * Gets the inline language labels.
706 * @return array The inline language labels
708 public function getInlineLanguageLabels() {
709 return $this->inlineLanguageLabels
;
713 * Gets the inline language files
717 public function getInlineLanguageLabelFiles() {
718 return $this->inlineLanguageLabelFiles
;
721 /*****************************************************/
723 /* Public Function to add Data */
726 /*****************************************************/
731 * @param string $meta meta data (complete metatag)
734 public function addMetaTag($meta) {
735 if (!in_array($meta, $this->metaTags
)) {
736 $this->metaTags
[] = $meta;
741 * Adds inline HTML comment
743 * @param string $comment
746 public function addInlineComment($comment) {
747 if (!in_array($comment, $this->inlineComments
)) {
748 $this->inlineComments
[] = $comment;
755 * @param string $data free header data for HTML header
758 public function addHeaderData($data) {
759 if (!in_array($data, $this->headerData
)) {
760 $this->headerData
[] = $data;
767 * @param string $data free header data for HTML header
770 public function addFooterData($data) {
771 if (!in_array($data, $this->footerData
)) {
772 $this->footerData
[] = $data;
776 /* Javascript Files */
779 * Adds JS Library. JS Library block is rendered on top of the JS files.
781 * @param string $name
782 * @param string $file
783 * @param string $type
784 * @param boolean $compress flag if library should be compressed
785 * @param boolean $forceOnTop flag if added library should be inserted at begin of this block
786 * @param string $allWrap
789 public function addJsLibrary($name, $file, $type = 'text/javascript', $compress = FALSE, $forceOnTop = FALSE, $allWrap = '') {
791 $type = 'text/javascript';
793 if (!in_array(strtolower($name), $this->jsLibs
)) {
794 $this->jsLibs
[strtolower($name)] = array(
797 'section' => self
::PART_HEADER
,
798 'compress' => $compress,
799 'forceOnTop' => $forceOnTop,
800 'allWrap' => $allWrap
807 * Adds JS Library to Footer. JS Library block is rendered on top of the Footer JS files.
809 * @param string $name
810 * @param string $file
811 * @param string $type
812 * @param boolean $compress flag if library should be compressed
813 * @param boolean $forceOnTop flag if added library should be inserted at begin of this block
814 * @param string $allWrap
817 public function addJsFooterLibrary($name, $file, $type = 'text/javascript', $compress = FALSE, $forceOnTop = FALSE, $allWrap = '') {
819 $type = 'text/javascript';
821 if (!in_array(strtolower($name), $this->jsLibs
)) {
822 $this->jsLibs
[strtolower($name)] = array(
825 'section' => self
::PART_FOOTER
,
826 'compress' => $compress,
827 'forceOnTop' => $forceOnTop,
828 'allWrap' => $allWrap
837 * @param string $file
838 * @param string $type
839 * @param boolean $compress
840 * @param boolean $forceOnTop
841 * @param string $allWrap
844 public function addJsFile($file, $type = 'text/javascript', $compress = TRUE, $forceOnTop = FALSE, $allWrap = '') {
846 $type = 'text/javascript';
848 if (!isset($this->jsFiles
[$file])) {
849 $this->jsFiles
[$file] = array(
851 'section' => self
::PART_HEADER
,
852 'compress' => $compress,
853 'forceOnTop' => $forceOnTop,
854 'allWrap' => $allWrap
860 * Adds JS file to footer
862 * @param string $file
863 * @param string $type
864 * @param boolean $compress
865 * @param boolean $forceOnTop
868 public function addJsFooterFile($file, $type = 'text/javascript', $compress = TRUE, $forceOnTop = FALSE, $allWrap = '') {
870 $type = 'text/javascript';
872 if (!isset($this->jsFiles
[$file])) {
873 $this->jsFiles
[$file] = array(
875 'section' => self
::PART_FOOTER
,
876 'compress' => $compress,
877 'forceOnTop' => $forceOnTop,
878 'allWrap' => $allWrap
883 /*Javascript Inline Blocks */
886 * Adds JS inline code
888 * @param string $name
889 * @param string $block
890 * @param boolean $compress
891 * @param boolean $forceOnTop
894 public function addJsInlineCode($name, $block, $compress = TRUE, $forceOnTop = FALSE) {
895 if (!isset($this->jsInline
[$name]) && !empty($block)) {
896 $this->jsInline
[$name] = array(
897 'code' => $block . LF
,
898 'section' => self
::PART_HEADER
,
899 'compress' => $compress,
900 'forceOnTop' => $forceOnTop
906 * Adds JS inline code to footer
908 * @param string $name
909 * @param string $block
910 * @param boolean $compress
911 * @param boolean $forceOnTop
914 public function addJsFooterInlineCode($name, $block, $compress = TRUE, $forceOnTop = FALSE) {
915 if (!isset($this->jsInline
[$name]) && !empty($block)) {
916 $this->jsInline
[$name] = array(
917 'code' => $block . LF
,
918 'section' => self
::PART_FOOTER
,
919 'compress' => $compress,
920 'forceOnTop' => $forceOnTop
926 * Adds Ext.onready code, which will be wrapped in Ext.onReady(function() {...});
928 * @param string $block javascript code
929 * @param boolean $forceOnTop position of the javascript code (TRUE for putting it on top, default is FALSE = bottom)
932 public function addExtOnReadyCode($block, $forceOnTop = FALSE) {
933 if (!in_array($block, $this->extOnReadyCode
)) {
935 array_unshift($this->extOnReadyCode
, $block);
937 $this->extOnReadyCode
[] = $block;
943 * Adds the ExtDirect code
947 public function addExtDirectCode() {
948 // Note: we need to iterate thru the object, because the addProvider method
949 // does this only with multiple arguments
950 $this->addExtOnReadyCode(
951 'for (var api in Ext.app.ExtDirectAPI) {
952 Ext.Direct.addProvider(Ext.app.ExtDirectAPI[api]);
955 var extDirectDebug = function(message, header, group) {
956 var TYPO3ViewportInstance = null;
958 if (top && top.TYPO3 && typeof top.TYPO3.Backend === "object") {
959 TYPO3ViewportInstance = top.TYPO3.Backend;
960 } else if (typeof TYPO3 === "object" && typeof TYPO3.Backend === "object") {
961 TYPO3ViewportInstance = TYPO3.Backend;
964 if (TYPO3ViewportInstance !== null) {
965 TYPO3ViewportInstance.DebugConsole.addTab(message, header, group);
966 } else if (typeof console === "object") {
967 console.log(message);
969 document.write(message);
973 Ext.Direct.on("exception", function(event) {
976 backtrace = "<p style=\"margin-top: 20px;\">" +
977 "<strong>Backtrace:<\/strong><br \/>" +
978 event.where.replace(/#/g, "<br \/>#") +
983 "<p>" + event.message + "<\/p>" + backtrace,
985 "ExtDirect - Exception"
989 Ext.Direct.on("event", function(event, provider) {
990 if (typeof event.debug !== "undefined" && event.debug !== "") {
991 extDirectDebug(event.debug, event.method, "ExtDirect - Debug");
1004 * @param string $file
1005 * @param string $rel
1006 * @param string $media
1007 * @param string $title
1008 * @param boolean $compress
1009 * @param boolean $forceOnTop
1012 public function addCssFile($file, $rel = 'stylesheet', $media = 'all', $title = '', $compress = TRUE, $forceOnTop = FALSE, $allWrap = '') {
1013 if (!isset($this->cssFiles
[$file])) {
1014 $this->cssFiles
[$file] = array(
1018 'compress' => $compress,
1019 'forceOnTop' => $forceOnTop,
1020 'allWrap' => $allWrap
1025 /*CSS Inline Blocks */
1028 * Adds CSS inline code
1030 * @param string $name
1031 * @param string $block
1032 * @param boolean $compress
1033 * @param boolean $forceOnTop
1036 public function addCssInlineBlock($name, $block, $compress = FALSE, $forceOnTop = FALSE) {
1037 if (!isset($this->cssInline
[$name]) && !empty($block)) {
1038 $this->cssInline
[$name] = array(
1040 'compress' => $compress,
1041 'forceOnTop' => $forceOnTop
1049 * call function if you need the prototype library
1053 public function loadPrototype() {
1054 $this->addPrototype
= TRUE;
1058 * call function if you need the Scriptaculous library
1060 * @param string $modules add modules you need. use "all" if you need complete modules
1063 public function loadScriptaculous($modules = 'all') {
1064 // Scriptaculous require prototype, so load prototype too.
1065 $this->addPrototype
= TRUE;
1066 $this->addScriptaculous
= TRUE;
1068 if ($modules == 'all') {
1069 foreach ($this->addScriptaculousModules
as $key => $value) {
1070 $this->addScriptaculousModules
[$key] = TRUE;
1073 $mods = t3lib_div
::trimExplode(',', $modules);
1074 foreach ($mods as $mod) {
1075 if (isset($this->addScriptaculousModules
[strtolower($mod)])) {
1076 $this->addScriptaculousModules
[strtolower($mod)] = TRUE;
1084 * call this function if you need the extJS library
1086 * @param boolean $css flag, if set the ext-css will be loaded
1087 * @param boolean $theme flag, if set the ext-theme "grey" will be loaded
1088 * @param string $adapter choose alternative adapter, possible values: yui, prototype, jquery
1091 public function loadExtJS($css = TRUE, $theme = TRUE, $adapter = '') {
1093 // empty $adapter will always load the ext adapter
1094 switch (t3lib_div
::strtolower(trim($adapter))) {
1095 case self
::EXTJS_ADAPTER_YUI
:
1096 $this->extJSadapter
= 'yui/ext-yui-adapter.js';
1098 case self
::EXTJS_ADAPTER_PROTOTYPE
:
1099 $this->extJSadapter
= 'prototype/ext-prototype-adapter.js';
1101 case self
::EXTJS_ADAPTER_JQUERY
:
1102 $this->extJSadapter
= 'jquery/ext-jquery-adapter.js';
1106 $this->addExtJS
= TRUE;
1107 $this->extJStheme
= $theme;
1108 $this->extJScss
= $css;
1113 * Enables ExtJs QuickTips
1119 public function enableExtJSQuickTips() {
1120 $this->enableExtJSQuickTips
= TRUE;
1125 * call function if you need the ExtCore library
1129 public function loadExtCore() {
1130 $this->addExtCore
= TRUE;
1134 * call function if you need the SVG library
1138 public function loadSvg() {
1139 $this->addSvg
= TRUE;
1143 * call this function to load debug version of ExtJS. Use this for development only
1146 public function enableSvgDebug() {
1147 $this->enableSvgDebug
= TRUE;
1151 * call this function to force flash usage with SVG library
1154 public function svgForceFlash() {
1155 $this->addMetaTag('<meta name="svg.render.forceflash" content="true" />');
1159 * call this function to load debug version of ExtJS. Use this for development only
1162 public function enableExtJsDebug() {
1163 $this->enableExtJsDebug
= TRUE;
1167 * call this function to load debug version of ExtCore. Use this for development only
1171 public function enableExtCoreDebug() {
1172 $this->enableExtCoreDebug
= TRUE;
1176 * Adds Javascript Inline Label. This will occur in TYPO3.lang - object
1177 * The label can be used in scripts with TYPO3.lang.<key>
1180 * @param string $key
1181 * @param string $value
1184 public function addInlineLanguageLabel($key, $value) {
1185 $this->inlineLanguageLabels
[$key] = $value;
1189 * Adds Javascript Inline Label Array. This will occur in TYPO3.lang - object
1190 * The label can be used in scripts with TYPO3.lang.<key>
1191 * Array will be merged with existing array.
1194 * @param array $array
1197 public function addInlineLanguageLabelArray(array $array) {
1198 $this->inlineLanguageLabels
= array_merge($this->inlineLanguageLabels
, $array);
1202 * Gets labels to be used in JavaScript fetched from a locallang file.
1204 * @param string Input is a file-reference (see t3lib_div::getFileAbsFileName). That file is expected to be a 'locallang.xml' file containing a valid XML TYPO3 language structure.
1205 * @param string $selectionPrefix: Prefix to select the correct labels (default: '')
1206 * @param string $stripFromSelectionName: Sub-prefix to be removed from label names in the result (default: '')
1207 * @param integer Error mode (when file could not be found): 0 - syslog entry, 1 - do nothing, 2 - throw an exception
1210 public function addInlineLanguageLabelFile($fileRef, $selectionPrefix = '', $stripFromSelectionName = '', $errorMode = 0) {
1211 $index = md5($fileRef . $selectionPrefix . $stripFromSelectionName);
1212 if ($fileRef && !isset($this->inlineLanguageLabelFiles
[$index])) {
1213 $this->inlineLanguageLabelFiles
[$index] = array(
1214 'fileRef' => $fileRef,
1215 'selectionPrefix' => $selectionPrefix,
1216 'stripFromSelectionName' => $stripFromSelectionName,
1217 'errorMode' => $errorMode
1224 * Adds Javascript Inline Setting. This will occur in TYPO3.settings - object
1225 * The label can be used in scripts with TYPO3.setting.<key>
1228 * @param string $namespace
1229 * @param string $key
1230 * @param string $value
1233 public function addInlineSetting($namespace, $key, $value) {
1235 if (strpos($namespace, '.')) {
1236 $parts = explode('.', $namespace);
1237 $a = &$this->inlineSettings
;
1238 foreach ($parts as $part) {
1243 $this->inlineSettings
[$namespace][$key] = $value;
1246 $this->inlineSettings
[$key] = $value;
1251 * Adds Javascript Inline Setting. This will occur in TYPO3.settings - object
1252 * The label can be used in scripts with TYPO3.setting.<key>
1253 * Array will be merged with existing array.
1256 * @param string $namespace
1257 * @param array $array
1260 public function addInlineSettingArray($namespace, array $array) {
1262 if (strpos($namespace, '.')) {
1263 $parts = explode('.', $namespace);
1264 $a = &$this->inlineSettings
;
1265 foreach ($parts as $part) {
1268 $a = array_merge((array) $a, $array);
1270 $this->inlineSettings
[$namespace] = array_merge((array) $this->inlineSettings
[$namespace], $array);
1273 $this->inlineSettings
= array_merge($this->inlineSettings
, $array);
1278 * Adds content to body content
1280 * @param string $content
1283 public function addBodyContent($content) {
1284 $this->bodyContent
.= $content;
1287 /*****************************************************/
1289 /* Render Functions */
1292 /*****************************************************/
1295 * render the section (Header or Footer)
1297 * @param int $part section which should be rendered: self::PART_COMPLETE, self::PART_HEADER or self::PART_FOOTER
1298 * @return string content of rendered section
1300 public function render($part = self
::PART_COMPLETE
) {
1306 $jsFooterInline = '';
1308 $jsFooterFiles = '';
1310 // preRenderHook for possible manuipulation
1311 if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-preProcess'])) {
1313 'jsLibs' => &$this->jsLibs
,
1314 'jsFiles' => &$this->jsFiles
,
1315 'jsFooterFiles' => &$this->jsFooterFiles
,
1316 'cssFiles' => &$this->cssFiles
,
1317 'headerData' => &$this->headerData
,
1318 'footerData' => &$this->footerData
,
1319 'jsInline' => &$this->jsInline
,
1320 'cssInline' => &$this->cssInline
,
1322 foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-preProcess'] as $hook) {
1323 t3lib_div
::callUserFunction($hook, $params, $this);
1327 $jsLibs = $this->renderJsLibraries();
1329 if ($this->concatenateFiles
) {
1330 // do the file concatenation
1331 $this->doConcatenate();
1333 if ($this->compressCss ||
$this->compressJavascript
) {
1334 // do the file compression
1335 $this->doCompress();
1338 $metaTags = implode(LF
, $this->metaTags
);
1340 // remove ending slashes from static header block
1341 // if the page is beeing rendered as html (not xhtml)
1342 // and define variable $endingSlash for further use
1343 if ($this->getRenderXhtml()) {
1344 $endingSlash = ' /';
1346 $this->metaCharsetTag
= str_replace(' />', '>', $this->metaCharsetTag
);
1347 $this->baseUrlTag
= str_replace(' />', '>', $this->baseUrlTag
);
1348 $this->shortcutTag
= str_replace(' />', '>', $this->shortcutTag
);
1352 if (count($this->cssFiles
)) {
1353 foreach ($this->cssFiles
as $file => $properties) {
1354 $file = t3lib_div
::resolveBackPath($file);
1355 $file = t3lib_div
::createVersionNumberedFilename($file);
1356 $tag = '<link rel="' . htmlspecialchars($properties['rel']) . '" type="text/css" href="' .
1357 htmlspecialchars($file) . '" media="' . htmlspecialchars($properties['media']) . '"' .
1358 ($properties['title'] ?
' title="' . htmlspecialchars($properties['title']) . '"' : '') .
1360 if ($properties['allWrap'] && strpos($properties['allWrap'], '|') !== FALSE) {
1361 $tag = str_replace('|', $tag, $properties['allWrap']);
1363 if ($properties['forceOnTop']) {
1364 $cssFiles = $tag . LF
. $cssFiles;
1366 $cssFiles .= LF
. $tag;
1371 if (count($this->cssInline
)) {
1372 foreach ($this->cssInline
as $name => $properties) {
1373 if ($properties['forceOnTop']) {
1374 $cssInline = '/*' . htmlspecialchars($name) . '*/' . LF
. $properties['code'] . LF
. $cssInline;
1376 $cssInline .= '/*' . htmlspecialchars($name) . '*/' . LF
. $properties['code'] . LF
;
1379 $cssInline = $this->inlineCssWrap
[0] . $cssInline . $this->inlineCssWrap
[1];
1382 if (count($this->jsLibs
)) {
1383 foreach ($this->jsLibs
as $name => $properties) {
1384 $properties['file'] = t3lib_div
::resolveBackPath($properties['file']);
1385 $properties['file'] = t3lib_div
::createVersionNumberedFilename($properties['file']);
1386 $tag = '<script src="' . htmlspecialchars($properties['file']) . '" type="' . htmlspecialchars($properties['type']) . '"></script>';
1387 if ($properties['allWrap'] && strpos($properties['allWrap'], '|') !== FALSE) {
1388 $tag = str_replace('|', $tag, $properties['allWrap']);
1390 if ($properties['forceOnTop']) {
1391 if ($properties['section'] === self
::PART_HEADER
) {
1392 $jsLibs = $tag . LF
. $jsLibs;
1394 $jsFooterLibs = $tag . LF
. $jsFooterLibs;
1397 if ($properties['section'] === self
::PART_HEADER
) {
1398 $jsLibs .= LF
. $tag;
1400 $jsFooterLibs .= LF
. $tag;
1406 if (count($this->jsFiles
)) {
1407 foreach ($this->jsFiles
as $file => $properties) {
1408 $file = t3lib_div
::resolveBackPath($file);
1409 $file = t3lib_div
::createVersionNumberedFilename($file);
1410 $tag = '<script src="' . htmlspecialchars($file) . '" type="' . htmlspecialchars($properties['type']) . '"></script>';
1411 if ($properties['allWrap'] && strpos($properties['allWrap'], '|') !== FALSE) {
1412 $tag = str_replace('|', $tag, $properties['allWrap']);
1414 if ($properties['forceOnTop']) {
1415 if ($properties['section'] === self
::PART_HEADER
) {
1416 $jsFiles = $tag . LF
. $jsFiles;
1418 $jsFooterFiles = $tag . LF
. $jsFooterFiles;
1421 if ($properties['section'] === self
::PART_HEADER
) {
1422 $jsFiles .= LF
. $tag;
1424 $jsFooterFiles .= LF
. $tag;
1430 if (count($this->jsInline
)) {
1431 foreach ($this->jsInline
as $name => $properties) {
1432 if ($properties['forceOnTop']) {
1433 if ($properties['section'] === self
::PART_HEADER
) {
1434 $jsInline = '/*' . htmlspecialchars($name) . '*/' . LF
. $properties['code'] . LF
. $jsInline;
1436 $jsFooterInline = '/*' . htmlspecialchars($name) . '*/' . LF
. $properties['code'] . LF
. $jsFooterInline;
1439 if ($properties['section'] === self
::PART_HEADER
) {
1440 $jsInline .= '/*' . htmlspecialchars($name) . '*/' . LF
. $properties['code'] . LF
;
1442 $jsFooterInline .= '/*' . htmlspecialchars($name) . '*/' . LF
. $properties['code'] . LF
;
1450 $jsInline = $this->inlineJavascriptWrap
[0] . $jsInline . $this->inlineJavascriptWrap
[1];
1453 if ($jsFooterInline) {
1454 $jsFooterInline = $this->inlineJavascriptWrap
[0] . $jsFooterInline . $this->inlineJavascriptWrap
[1];
1459 $templateFile = t3lib_div
::getFileAbsFileName($this->templateFile
, TRUE);
1460 $template = t3lib_div
::getURL($templateFile);
1462 if ($this->removeLineBreaksFromTemplate
) {
1463 $template = strtr($template, array(LF
=> '', CR
=> ''));
1465 if ($part != self
::PART_COMPLETE
) {
1466 $templatePart = explode('###BODY###', $template);
1467 $template = $templatePart[$part - 1];
1470 if ($this->moveJsFromHeaderToFooter
) {
1471 $jsFooterLibs = $jsLibs . LF
. $jsFooterLibs;
1473 $jsFooterFiles = $jsFiles . LF
. $jsFooterFiles;
1475 $jsFooterInline = $jsInline . LF
. $jsFooterInline;
1479 $markerArray = array(
1480 'XMLPROLOG_DOCTYPE' => $this->xmlPrologAndDocType
,
1481 'HTMLTAG' => $this->htmlTag
,
1482 'HEADTAG' => $this->headTag
,
1483 'METACHARSET' => $this->charSet ?
str_replace('|', htmlspecialchars($this->charSet
), $this->metaCharsetTag
) : '',
1484 'INLINECOMMENT' => $this->inlineComments ? LF
. LF
. '<!-- ' . LF
. implode(LF
, $this->inlineComments
) . '-->' . LF
. LF
: '',
1485 'BASEURL' => $this->baseUrl ?
str_replace('|', $this->baseUrl
, $this->baseUrlTag
) : '',
1486 'SHORTCUT' => $this->favIcon ?
sprintf($this->shortcutTag
, htmlspecialchars($this->favIcon
), $this->iconMimeType
) : '',
1487 'CSS_INCLUDE' => $cssFiles,
1488 'CSS_INLINE' => $cssInline,
1489 'JS_INLINE' => $jsInline,
1490 'JS_INCLUDE' => $jsFiles,
1491 'JS_LIBS' => $jsLibs,
1492 'TITLE' => $this->title ?
str_replace('|', htmlspecialchars($this->title
), $this->titleTag
) : '',
1493 'META' => $metaTags,
1494 'HEADERDATA' => $this->headerData ?
implode(LF
, $this->headerData
) : '',
1495 'FOOTERDATA' => $this->footerData ?
implode(LF
, $this->footerData
) : '',
1496 'JS_LIBS_FOOTER' => $jsFooterLibs,
1497 'JS_INCLUDE_FOOTER' => $jsFooterFiles,
1498 'JS_INLINE_FOOTER' => $jsFooterInline,
1499 'BODY' => $this->bodyContent
,
1502 $markerArray = array_map('trim', $markerArray);
1505 return trim(t3lib_parsehtml
::substituteMarkerArray($template, $markerArray, '###|###'));
1509 * helper function for render the javascript libraries
1511 * @return string content with javascript libraries
1513 protected function renderJsLibraries() {
1516 if ($this->addSvg
) {
1517 $out .= '<script src="' . $this->processJsFile($this->backPath
. $this->svgPath
. 'svg.js') .
1518 '" data-path="' . $this->backPath
. $this->svgPath
.
1519 '"' . ($this->enableSvgDebug ?
' data-debug="true"' : '') . '></script>';
1522 if ($this->addPrototype
) {
1523 $out .= '<script src="' . $this->processJsFile($this->backPath
. $this->prototypePath
. 'prototype.js') .
1524 '" type="text/javascript"></script>' . LF
;
1525 unset($this->jsFiles
[$this->backPath
. $this->prototypePath
. 'prototype.js']);
1528 if ($this->addScriptaculous
) {
1530 foreach ($this->addScriptaculousModules
as $key => $value) {
1531 if ($this->addScriptaculousModules
[$key]) {
1535 // resolve dependencies
1536 if (in_array('dragdrop', $mods) ||
in_array('controls', $mods)) {
1537 $mods = array_merge(array('effects'), $mods);
1541 foreach ($mods as $module) {
1542 $out .= '<script src="' . $this->processJsFile($this->backPath
.
1543 $this->scriptaculousPath
. $module . '.js') . '" type="text/javascript"></script>' . LF
;
1544 unset($this->jsFiles
[$this->backPath
. $this->scriptaculousPath
. $module . '.js']);
1547 $out .= '<script src="' . $this->processJsFile($this->backPath
. $this->scriptaculousPath
.
1548 'scriptaculous.js') . '" type="text/javascript"></script>' . LF
;
1549 unset($this->jsFiles
[$this->backPath
. $this->scriptaculousPath
. 'scriptaculous.js']);
1553 if ($this->addExtCore
) {
1554 $out .= '<script src="' . $this->processJsFile($this->backPath
.
1555 $this->extCorePath
. 'ext-core' . ($this->enableExtCoreDebug ?
'-debug' : '') . '.js') .
1556 '" type="text/javascript"></script>' . LF
;
1557 unset($this->jsFiles
[$this->backPath
. $this->extCorePath
. 'ext-core' . ($this->enableExtCoreDebug ?
'-debug' : '') . '.js']);
1561 if ($this->addExtJS
) {
1562 // use the base adapter all the time
1563 $out .= '<script src="' . $this->processJsFile($this->backPath
. $this->extJsPath
.
1564 'adapter/' . ($this->enableExtJsDebug ?
1565 str_replace('.js', '-debug.js', $this->extJSadapter
) : $this->extJSadapter
)) .
1566 '" type="text/javascript"></script>' . LF
;
1567 $out .= '<script src="' . $this->processJsFile($this->backPath
. $this->extJsPath
.
1568 'ext-all' . ($this->enableExtJsDebug ?
'-debug' : '') . '.js') .
1569 '" type="text/javascript"></script>' . LF
;
1571 // add extJS localization
1572 $localeMap = $this->csConvObj
->isoArray
; // load standard ISO mapping and modify for use with ExtJS
1573 $localeMap[''] = 'en';
1574 $localeMap['default'] = 'en';
1575 $localeMap['gr'] = 'el_GR'; // Greek
1576 $localeMap['no'] = 'no_BO'; // Norwegian Bokmaal
1577 $localeMap['se'] = 'se_SV'; // Swedish
1580 $extJsLang = isset($localeMap[$this->lang
]) ?
$localeMap[$this->lang
] : $this->lang
;
1581 // TODO autoconvert file from UTF8 to current BE charset if necessary!!!!
1582 $extJsLocaleFile = $this->extJsPath
. 'locale/ext-lang-' . $extJsLang . '.js';
1583 if (file_exists(PATH_typo3
. $extJsLocaleFile)) {
1584 $out .= '<script src="' . $this->processJsFile($this->backPath
.
1585 $extJsLocaleFile) . '" type="text/javascript" charset="utf-8"></script>' . LF
;
1589 // remove extjs from JScodeLibArray
1591 $this->jsFiles
[$this->backPath
. $this->extJsPath
. 'ext-all.js'],
1592 $this->jsFiles
[$this->backPath
. $this->extJsPath
. 'ext-all-debug.js']
1596 if (count($this->inlineLanguageLabelFiles
)) {
1597 foreach ($this->inlineLanguageLabelFiles
as $languageLabelFile) {
1598 $this->includeLanguageFileForInline(
1599 $languageLabelFile['fileRef'],
1600 $languageLabelFile['selectionPrefix'],
1601 $languageLabelFile['stripFromSelectionName'],
1602 $languageLabelFile['$errorMode']
1606 unset($this->inlineLanguageLabelFiles
);
1608 // Convert labels/settings back to UTF-8 since json_encode() only works with UTF-8:
1609 if ($this->getCharSet() !== 'utf-8') {
1610 if ($this->inlineLanguageLabels
) {
1611 $this->csConvObj
->convArray($this->inlineLanguageLabels
, $this->getCharSet(), 'utf-8');
1613 if ($this->inlineSettings
) {
1614 $this->csConvObj
->convArray($this->inlineSettings
, $this->getCharSet(), 'utf-8');
1618 $inlineSettings = $this->inlineLanguageLabels ?
'TYPO3.lang = ' . json_encode($this->inlineLanguageLabels
) . ';' : '';
1619 $inlineSettings .= $this->inlineSettings ?
'TYPO3.settings = ' . json_encode($this->inlineSettings
) . ';' : '';
1621 if ($this->addExtCore ||
$this->addExtJS
) {
1622 // set clear.gif, move it on top, add handler code
1624 if (count($this->extOnReadyCode
)) {
1625 foreach ($this->extOnReadyCode
as $block) {
1630 $out .= $this->inlineJavascriptWrap
[0] . '
1632 Ext.BLANK_IMAGE_URL = "' . htmlspecialchars(t3lib_div
::locationHeaderUrl($this->backPath
. 'gfx/clear.gif')) . '";' . LF
.
1634 'Ext.onReady(function() {' .
1635 ($this->enableExtJSQuickTips ?
'Ext.QuickTips.init();' . LF
: '') . $code .
1636 ' });' . $this->inlineJavascriptWrap
[1];
1637 unset ($this->extOnReadyCode
);
1639 if ($this->extJStheme
) {
1640 if (isset($GLOBALS['TBE_STYLES']['extJS']['theme'])) {
1641 $this->addCssFile($this->backPath
. $GLOBALS['TBE_STYLES']['extJS']['theme'], 'stylesheet', 'all', '', TRUE, TRUE);
1643 $this->addCssFile($this->backPath
. $this->extJsPath
. 'resources/css/xtheme-blue.css', 'stylesheet', 'all', '', TRUE, TRUE);
1646 if ($this->extJScss
) {
1647 if (isset($GLOBALS['TBE_STYLES']['extJS']['all'])) {
1648 $this->addCssFile($this->backPath
. $GLOBALS['TBE_STYLES']['extJS']['all'], 'stylesheet', 'all', '', TRUE, TRUE);
1650 $this->addCssFile($this->backPath
. $this->extJsPath
. 'resources/css/ext-all-notheme.css', 'stylesheet', 'all', '', TRUE, TRUE);
1654 if ($inlineSettings) {
1655 $out .= $this->inlineJavascriptWrap
[0] . $inlineSettings . $this->inlineJavascriptWrap
[1];
1662 protected function includeLanguageFileForInline($fileRef, $selectionPrefix = '', $stripFromSelectionName = '', $errorMode = 0) {
1663 if (!isset($this->lang
) ||
!isset($this->charSet
)) {
1664 throw new RuntimeException('Language and character encoding are not set.', 1284906026);
1667 $labelsFromFile = array();
1668 $allLabels = t3lib_div
::readLLfile($fileRef, $this->lang
, $this->charSet
, $errorMode);
1670 // Regular expression to strip the selection prefix and possibly something from the label name:
1671 $labelPattern = '#^' . preg_quote($selectionPrefix, '#') . '(' . preg_quote($stripFromSelectionName, '#') . ')?#';
1673 if ($allLabels !== FALSE) {
1674 // Merge language specific translations:
1675 if ($this->lang
!== 'default' && isset($allLabels[$this->lang
])) {
1676 $labels = array_merge($allLabels['default'], $allLabels[$this->lang
]);
1678 $labels = $allLabels['default'];
1681 // Iterate through all locallang labels:
1682 foreach ($labels as $label => $value) {
1683 if ($selectionPrefix === '') {
1684 $labelsFromFile[$label] = $value;
1685 } elseif (strpos($label, $selectionPrefix) === 0) {
1686 $key = preg_replace($labelPattern, '', $label);
1687 $labelsFromFile[$label] = $value;
1691 $this->inlineLanguageLabels
= array_merge($this->inlineLanguageLabels
, $labelsFromFile);
1695 /*****************************************************/
1700 /*****************************************************/
1703 * concatenate files into one file
1704 * registered handler
1708 protected function doConcatenate() {
1709 // traverse the arrays, concatenate in one file
1710 // then remove concatenated files from array and add the concatenated file
1712 if ($this->concatenateFiles
) {
1714 'jsLibs' => &$this->jsLibs
,
1715 'jsFiles' => &$this->jsFiles
,
1716 'jsFooterFiles' => &$this->jsFooterFiles
,
1717 'cssFiles' => &$this->cssFiles
,
1718 'headerData' => &$this->headerData
,
1719 'footerData' => &$this->footerData
,
1722 if ($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE
]['concatenateHandler']) {
1723 // use extern concatenate routine
1724 t3lib_div
::callUserFunction($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE
]['concatenateHandler'], $params, $this);
1725 } elseif (TYPO3_MODE
=== 'BE') {
1726 $cssOptions = array('baseDirectories' => $GLOBALS['TBE_TEMPLATE']->getSkinStylesheetDirectories());
1727 $this->cssFiles
= $this->getCompressor()->concatenateCssFiles($this->cssFiles
, $cssOptions);
1733 * compress inline code
1737 protected function doCompress() {
1739 if ($this->compressJavascript
&& $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE
]['jsCompressHandler']) {
1740 // use extern compress routine
1742 'jsInline' => &$this->jsInline
,
1743 'jsFooterInline' => &$this->jsFooterInline
,
1744 'jsLibs' => &$this->jsLibs
,
1745 'jsFiles' => &$this->jsFiles
,
1746 'jsFooterFiles' => &$this->jsFooterFiles
,
1747 'headerData' => &$this->headerData
,
1748 'footerData' => &$this->footerData
,
1750 t3lib_div
::callUserFunction($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE
]['jsCompressHandler'], $params, $this);
1752 // traverse the arrays, compress files
1754 if ($this->compressJavascript
) {
1755 if (count($this->jsInline
)) {
1756 foreach ($this->jsInline
as $name => $properties) {
1757 if ($properties['compress']) {
1759 $this->jsInline
[$name]['code'] = t3lib_div
::minifyJavaScript($properties['code'], $error);
1761 $this->compressError
.= 'Error with minify JS Inline Block "' . $name . '": ' . $error . LF
;
1766 if (TYPO3_MODE
=== 'BE') {
1767 $this->jsFiles
= $this->getCompressor()->compressJsFiles($this->jsFiles
);
1768 $this->jsFooterFiles
= $this->getCompressor()->compressJsFiles($this->jsFooterFiles
);
1772 if ($this->compressCss
) {
1773 // use extern compress routine
1775 'cssInline' => &$this->cssInline
,
1776 'cssFiles' => &$this->cssFiles
,
1777 'headerData' => &$this->headerData
,
1778 'footerData' => &$this->footerData
,
1781 if ($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE
]['cssCompressHandler']) {
1782 // use extern concatenate routine
1783 t3lib_div
::callUserFunction($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE
]['cssCompressHandler'], $params, $this);
1784 } elseif (TYPO3_MODE
=== 'BE') {
1785 $this->cssFiles
= $this->getCompressor()->compressCssFiles($this->cssFiles
);
1791 * Returns instance of t3lib_Compressor
1793 * @return t3lib_Compressor Instance of t3lib_Compressor
1795 protected function getCompressor() {
1796 if ($this->compressor
=== NULL) {
1797 $this->compressor
= t3lib_div
::makeInstance('t3lib_Compressor');
1799 return $this->compressor
;
1803 * Processes a Javascript file dependent on the current context
1805 * Adds the version number for Frontend, compresses the file for Backend
1807 * @param string $filename Filename
1808 * @return string new filename
1810 protected function processJsFile($filename) {
1811 switch (TYPO3_MODE
) {
1813 $filename = t3lib_div
::createVersionNumberedFilename($filename);
1816 if ($this->compressJavascript
) {
1817 $filename = $this->getCompressor()->compressJsFile($filename);
1826 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE
]['XCLASS']['t3lib/class.t3lib_pagerenderer.php']) {
1827 include_once ($TYPO3_CONF_VARS[TYPO3_MODE
]['XCLASS']['t3lib/class.t3lib_pagerenderer.php']);