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 ();
194 /*****************************************************/
199 /*****************************************************/
204 * @param string $title title of webpage
207 public function setTitle($title) {
208 $this->title
= $title;
213 * Enables/disables rendering of XHTML code
215 * @param boolean $enable Enable XHTML
218 public function setRenderXhtml($enable) {
219 $this->renderXhtml
= $enable;
223 * Sets xml prolog and docType
225 * @param string $xmlPrologAndDocType complete tags for xml prolog and docType
228 public function setXmlPrologAndDocType($xmlPrologAndDocType) {
229 $this->xmlPrologAndDocType
= $xmlPrologAndDocType;
235 * @param string $charSet used charset
238 public function setCharSet($charSet) {
239 $this->charSet
= $charSet;
245 * @param string $lang used language
248 public function setLanguage($lang) {
255 * @param string $htmlTag html tag
258 public function setHtmlTag($htmlTag) {
259 $this->htmlTag
= $htmlTag;
265 * @param string $tag head tag
268 public function setHeadTag($headTag) {
269 $this->headTag
= $headTag;
275 * @param string $favIcon
278 public function setFavIcon($favIcon) {
279 $this->favIcon
= $favIcon;
283 * Sets icon mime type
285 * @param string $iconMimeType
288 public function setIconMimeType($iconMimeType) {
289 $this->iconMimeType
= $iconMimeType;
298 public function setBaseUrl($baseUrl) {
299 $this->baseUrl
= $baseUrl;
305 * @param string $file
308 public function setTemplateFile($file) {
309 $this->templateFile
= $file;
315 * @param string $backPath
318 public function setBackPath($backPath) {
319 $this->backPath
= $backPath;
323 * Sets Content for Body
325 * @param string $content
328 public function setBodyContent($content) {
329 $this->bodyContent
= $content;
333 * Sets Path for prototype library (relative to typo3 directory)
338 public function setPrototypePath($path) {
339 $this->prototypePath
= $path;
343 * Sets Path for scriptaculous library (relative to typo3 directory)
345 * @param string $path
348 public function setScriptaculousPath($path) {
349 $this->scriptaculousPath
= $path;
353 * Sets Path for Ext Core library (relative to typo3 directory)
355 * @param string $path
358 public function setExtCorePath($path) {
359 $this->extCorePath
= $path;
363 * Sets Path for ExtJs library (relative to typo3 directory)
365 * @param string $path
368 public function setExtJsPath($path) {
369 $this->extJsPath
= $path;
373 * Sets Path for SVG library (websvg)
375 * @param string $path
378 public function setSvgPath($path) {
379 $this->svgPath
= $path;
382 /*****************************************************/
384 /* Public Enablers / Disablers */
387 /*****************************************************/
390 * Enables MoveJsFromHeaderToFooter
395 public function enableMoveJsFromHeaderToFooter() {
396 $this->moveJsFromHeaderToFooter
= TRUE;
400 * Disables MoveJsFromHeaderToFooter
405 public function disableMoveJsFromHeaderToFooter() {
406 $this->moveJsFromHeaderToFooter
= FALSE;
410 * Enables compression of javascript
415 public function enableCompressJavascript() {
416 $this->compressJavascript
= TRUE;
420 * Disables compression of javascript
425 public function disableCompressJavascript() {
426 $this->compressJavascript
= FALSE;
430 * Enables compression of css
435 public function enableCompressCss() {
436 $this->compressCss
= TRUE;
440 * Disables compression of css
445 public function disableCompressCss() {
446 $this->compressCss
= FALSE;
450 * Enables concatenation of js/css files
455 public function enableConcatenateFiles() {
456 $this->concatenateFiles
= TRUE;
460 * Disables concatenation of js/css files
465 public function disableConcatenateFiles() {
466 $this->concatenateFiles
= FALSE;
470 * Sets removal of all line breaks in template
475 public function enableRemoveLineBreaksFromTemplate() {
476 $this->removeLineBreaksFromTemplate
= TRUE;
480 * Unsets removal of all line breaks in template
485 public function disableRemoveLineBreaksFromTemplate() {
486 $this->removeLineBreaksFromTemplate
= FALSE;
491 * This is a shortcut to switch off all compress/concatenate features to enable easier debug
496 public function enableDebugMode() {
497 $this->compressJavascript
= FALSE;
498 $this->compressCss
= FALSE;
499 $this->concatenateFiles
= FALSE;
500 $this->removeLineBreaksFromTemplate
= FALSE;
501 $this->enableExtCoreDebug
= TRUE;
502 $this->enableExtJsDebug
= TRUE;
503 $this->enableSvgDebug
= TRUE;
506 /*****************************************************/
511 /*****************************************************/
516 * @return string $title title of webpage
518 public function getTitle() {
525 * @return string $charSet
527 public function getCharSet() {
528 return $this->charSet
;
534 * @return string $lang
536 public function getLanguage() {
541 * Returns rendering mode XHTML or HTML
543 * @return boolean TRUE if XHTML, FALSE if HTML
545 public function getRenderXhtml() {
546 return $this->renderXhtml
;
552 * @return string $htmlTag html tag
554 public function getHtmlTag() {
555 return $this->htmlTag
;
561 * @return string $tag head tag
563 public function getHeadTag() {
564 return $this->headTag
;
570 * @return string $favIcon
572 public function getFavIcon() {
573 return $this->favIcon
;
577 * Gets icon mime type
579 * @return string $iconMimeType
581 public function getIconMimeType() {
582 return $this->iconMimeType
;
588 * @return string $url
590 public function getBaseUrl() {
591 return $this->baseUrl
;
597 * @return string $file
599 public function getTemplateFile($file) {
600 return $this->templateFile
;
604 * Gets MoveJsFromHeaderToFooter
608 public function getMoveJsFromHeaderToFooter() {
609 return $this->moveJsFromHeaderToFooter
;
613 * Gets compress of javascript
617 public function getCompressJavascript() {
618 return $this->compressJavascript
;
622 * Gets compress of css
626 public function getCompressCss() {
627 return $this->compressCss
;
631 * Gets concatenate of files
635 public function getConcatenateFiles() {
636 return $this->concatenateFiles
;
640 * Gets remove of empty lines from template
644 public function getRemoveLineBreaksFromTemplate() {
645 return $this->removeLineBreaksFromTemplate
;
649 * Gets content for body
653 public function getBodyContent() {
654 return $this->bodyContent
;
658 * Gets Path for prototype library (relative to typo3 directory)
662 public function getPrototypePath() {
663 return $this->prototypePath
;
667 * Gets Path for scriptaculous library (relative to typo3 directory)
671 public function getScriptaculousPath() {
672 return $this->scriptaculousPath
;
676 * Gets Path for Ext Core library (relative to typo3 directory)
680 public function getExtCorePath() {
681 return $this->extCorePath
;
685 * Gets Path for ExtJs library (relative to typo3 directory)
689 public function getExtJsPath() {
690 return $this->extJsPath
;
694 * Gets Path for SVG library (relative to typo3 directory)
698 public function getSvgPath() {
699 return $this->svgPath
;
703 * Gets the inline language labels.
705 * @return array The inline language labels
707 public function getInlineLanguageLabels() {
708 return $this->inlineLanguageLabels
;
712 * Gets the inline language files
716 public function getInlineLanguageLabelFiles() {
717 return $this->inlineLanguageLabelFiles
;
720 /*****************************************************/
722 /* Public Function to add Data */
725 /*****************************************************/
730 * @param string $meta meta data (complete metatag)
733 public function addMetaTag($meta) {
734 if (!in_array($meta, $this->metaTags
)) {
735 $this->metaTags
[] = $meta;
740 * Adds inline HTML comment
742 * @param string $comment
745 public function addInlineComment($comment) {
746 if (!in_array($comment, $this->inlineComments
)) {
747 $this->inlineComments
[] = $comment;
754 * @param string $data free header data for HTML header
757 public function addHeaderData($data) {
758 if (!in_array($data, $this->headerData
)) {
759 $this->headerData
[] = $data;
766 * @param string $data free header data for HTML header
769 public function addFooterData($data) {
770 if (!in_array($data, $this->footerData
)) {
771 $this->footerData
[] = $data;
775 /* Javascript Files */
778 * Adds JS Library. JS Library block is rendered on top of the JS files.
780 * @param string $name
781 * @param string $file
782 * @param string $type
783 * @param boolean $compress flag if library should be compressed
784 * @param boolean $forceOnTop flag if added library should be inserted at begin of this block
785 * @param string $allWrap
788 public function addJsLibrary($name, $file, $type = 'text/javascript', $compress = FALSE, $forceOnTop = FALSE, $allWrap = '') {
790 $type = 'text/javascript';
792 if (!in_array(strtolower($name), $this->jsLibs
)) {
793 $this->jsLibs
[strtolower($name)] = array (
796 'section' => self
::PART_HEADER
,
797 'compress' => $compress,
798 'forceOnTop' => $forceOnTop,
799 'allWrap' => $allWrap
806 * Adds JS Library to Footer. JS Library block is rendered on top of the Footer JS files.
808 * @param string $name
809 * @param string $file
810 * @param string $type
811 * @param boolean $compress flag if library should be compressed
812 * @param boolean $forceOnTop flag if added library should be inserted at begin of this block
813 * @param string $allWrap
816 public function addJsFooterLibrary($name, $file, $type = 'text/javascript', $compress = FALSE, $forceOnTop = FALSE, $allWrap = '') {
818 $type = 'text/javascript';
820 if (!in_array(strtolower($name), $this->jsLibs
)) {
821 $this->jsLibs
[strtolower($name)] = array (
824 'section' => self
::PART_FOOTER
,
825 'compress' => $compress,
826 'forceOnTop' => $forceOnTop,
827 'allWrap' => $allWrap
836 * @param string $file
837 * @param string $type
838 * @param boolean $compress
839 * @param boolean $forceOnTop
840 * @param string $allWrap
843 public function addJsFile($file, $type = 'text/javascript', $compress = TRUE, $forceOnTop = FALSE, $allWrap = '') {
845 $type = 'text/javascript';
847 if (!isset($this->jsFiles
[$file])) {
848 $this->jsFiles
[$file] = array (
850 'section' => self
::PART_HEADER
,
851 'compress' => $compress,
852 'forceOnTop' => $forceOnTop,
853 'allWrap' => $allWrap
859 * Adds JS file to footer
861 * @param string $file
862 * @param string $type
863 * @param boolean $compress
864 * @param boolean $forceOnTop
867 public function addJsFooterFile($file, $type = 'text/javascript', $compress = TRUE, $forceOnTop = FALSE, $allWrap = '') {
869 $type = 'text/javascript';
871 if (!isset($this->jsFiles
[$file])) {
872 $this->jsFiles
[$file] = array (
874 'section' => self
::PART_FOOTER
,
875 'compress' => $compress,
876 'forceOnTop' => $forceOnTop,
877 'allWrap' => $allWrap
882 /*Javascript Inline Blocks */
885 * Adds JS inline code
887 * @param string $name
888 * @param string $block
889 * @param boolean $compress
890 * @param boolean $forceOnTop
893 public function addJsInlineCode($name, $block, $compress = TRUE, $forceOnTop = FALSE) {
894 if (!isset($this->jsInline
[$name]) && !empty($block)) {
895 $this->jsInline
[$name] = array (
896 'code' => $block . LF
,
897 'section' => self
::PART_HEADER
,
898 'compress' => $compress,
899 'forceOnTop' => $forceOnTop
905 * Adds JS inline code to footer
907 * @param string $name
908 * @param string $block
909 * @param boolean $compress
910 * @param boolean $forceOnTop
913 public function addJsFooterInlineCode($name, $block, $compress = TRUE, $forceOnTop = FALSE) {
914 if (!isset($this->jsInline
[$name]) && !empty($block)) {
915 $this->jsInline
[$name] = array (
916 'code' => $block . LF
,
917 'section' => self
::PART_FOOTER
,
918 'compress' => $compress,
919 'forceOnTop' => $forceOnTop
925 * Adds Ext.onready code, which will be wrapped in Ext.onReady(function() {...});
927 * @param string $block javascript code
928 * @param boolean $forceOnTop position of the javascript code (TRUE for putting it on top, default is FALSE = bottom)
931 public function addExtOnReadyCode($block, $forceOnTop = FALSE) {
932 if (!in_array($block, $this->extOnReadyCode
)) {
934 array_unshift($this->extOnReadyCode
, $block);
936 $this->extOnReadyCode
[] = $block;
942 * Adds the ExtDirect code
946 public function addExtDirectCode() {
947 // Note: we need to iterate thru the object, because the addProvider method
948 // does this only with multiple arguments
949 $this->addExtOnReadyCode(
950 'for (var api in Ext.app.ExtDirectAPI) {
951 Ext.Direct.addProvider(Ext.app.ExtDirectAPI[api]);
954 var extDirectDebug = function(message, header, group) {
955 var TYPO3ViewportInstance = null;
957 if (top && top.TYPO3 && typeof top.TYPO3.Backend === "object") {
958 TYPO3ViewportInstance = top.TYPO3.Backend;
959 } else if (typeof TYPO3 === "object" && typeof TYPO3.Backend === "object") {
960 TYPO3ViewportInstance = TYPO3.Backend;
963 if (TYPO3ViewportInstance !== null) {
964 TYPO3ViewportInstance.DebugConsole.addTab(message, header, group);
965 } else if (typeof console === "object") {
966 console.log(message);
968 document.write(message);
972 Ext.Direct.on("exception", function(event) {
975 backtrace = "<p style=\"margin-top: 20px;\">" +
976 "<strong>Backtrace:<\/strong><br \/>" +
977 event.where.replace(/#/g, "<br \/>#") +
982 "<p>" + event.message + "<\/p>" + backtrace,
984 "ExtDirect - Exception"
988 Ext.Direct.on("event", function(event, provider) {
989 if (typeof event.debug !== "undefined" && event.debug !== "") {
990 extDirectDebug(event.debug, event.method, "ExtDirect - Debug");
1003 * @param string $file
1004 * @param string $rel
1005 * @param string $media
1006 * @param string $title
1007 * @param boolean $compress
1008 * @param boolean $forceOnTop
1011 public function addCssFile($file, $rel = 'stylesheet', $media = 'all', $title = '', $compress = TRUE, $forceOnTop = FALSE, $allWrap = '') {
1012 if (!isset($this->cssFiles
[$file])) {
1013 $this->cssFiles
[$file] = array (
1017 'compress' => $compress,
1018 'forceOnTop' => $forceOnTop,
1019 'allWrap' => $allWrap
1024 /*CSS Inline Blocks */
1027 * Adds CSS inline code
1029 * @param string $name
1030 * @param string $block
1031 * @param boolean $compress
1032 * @param boolean $forceOnTop
1035 public function addCssInlineBlock($name, $block, $compress = FALSE, $forceOnTop = FALSE) {
1036 if (!isset($this->cssInline
[$name]) && !empty($block)) {
1037 $this->cssInline
[$name] = array (
1039 'compress' => $compress,
1040 'forceOnTop' => $forceOnTop
1048 * call function if you need the prototype library
1052 public function loadPrototype() {
1053 $this->addPrototype
= TRUE;
1057 * call function if you need the Scriptaculous library
1059 * @param string $modules add modules you need. use "all" if you need complete modules
1062 public function loadScriptaculous($modules = 'all') {
1063 // Scriptaculous require prototype, so load prototype too.
1064 $this->addPrototype
= TRUE;
1065 $this->addScriptaculous
= TRUE;
1067 if ($modules == 'all') {
1068 foreach ($this->addScriptaculousModules
as $key => $value) {
1069 $this->addScriptaculousModules
[$key] = TRUE;
1072 $mods = t3lib_div
::trimExplode(',', $modules);
1073 foreach ($mods as $mod) {
1074 if (isset($this->addScriptaculousModules
[strtolower($mod)])) {
1075 $this->addScriptaculousModules
[strtolower($mod)] = TRUE;
1083 * call this function if you need the extJS library
1085 * @param boolean $css flag, if set the ext-css will be loaded
1086 * @param boolean $theme flag, if set the ext-theme "grey" will be loaded
1087 * @param string $adapter choose alternative adapter, possible values: yui, prototype, jquery
1090 public function loadExtJS($css = TRUE, $theme = TRUE, $adapter = '') {
1092 // empty $adapter will always load the ext adapter
1093 switch (t3lib_div
::strtolower(trim($adapter))) {
1094 case self
::EXTJS_ADAPTER_YUI
:
1095 $this->extJSadapter
= 'yui/ext-yui-adapter.js';
1097 case self
::EXTJS_ADAPTER_PROTOTYPE
:
1098 $this->extJSadapter
= 'prototype/ext-prototype-adapter.js';
1100 case self
::EXTJS_ADAPTER_JQUERY
:
1101 $this->extJSadapter
= 'jquery/ext-jquery-adapter.js';
1105 $this->addExtJS
= TRUE;
1106 $this->extJStheme
= $theme;
1107 $this->extJScss
= $css;
1112 * Enables ExtJs QuickTips
1118 public function enableExtJSQuickTips() {
1119 $this->enableExtJSQuickTips
= TRUE;
1124 * call function if you need the ExtCore library
1128 public function loadExtCore() {
1129 $this->addExtCore
= TRUE;
1133 * call function if you need the SVG library
1137 public function loadSvg() {
1138 $this->addSvg
= TRUE;
1142 * call this function to load debug version of ExtJS. Use this for development only
1145 public function enableSvgDebug() {
1146 $this->enableSvgDebug
= TRUE;
1150 * call this function to force flash usage with SVG library
1153 public function svgForceFlash() {
1154 $this->addMetaTag('<meta name="svg.render.forceflash" content="true" />');
1158 * call this function to load debug version of ExtJS. Use this for development only
1161 public function enableExtJsDebug() {
1162 $this->enableExtJsDebug
= TRUE;
1166 * call this function to load debug version of ExtCore. Use this for development only
1170 public function enableExtCoreDebug() {
1171 $this->enableExtCoreDebug
= TRUE;
1175 * Adds Javascript Inline Label. This will occur in TYPO3.lang - object
1176 * The label can be used in scripts with TYPO3.lang.<key>
1179 * @param string $key
1180 * @param string $value
1183 public function addInlineLanguageLabel($key, $value) {
1184 $this->inlineLanguageLabels
[$key] = $value;
1188 * Adds Javascript Inline Label Array. This will occur in TYPO3.lang - object
1189 * The label can be used in scripts with TYPO3.lang.<key>
1190 * Array will be merged with existing array.
1193 * @param array $array
1196 public function addInlineLanguageLabelArray(array $array) {
1197 $this->inlineLanguageLabels
= array_merge($this->inlineLanguageLabels
, $array);
1201 * Gets labels to be used in JavaScript fetched from a locallang file.
1203 * @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.
1204 * @param string $selectionPrefix: Prefix to select the correct labels (default: '')
1205 * @param string $stripFromSelectionName: Sub-prefix to be removed from label names in the result (default: '')
1206 * @param integer Error mode (when file could not be found): 0 - syslog entry, 1 - do nothing, 2 - throw an exception
1209 public function addInlineLanguageLabelFile($fileRef, $selectionPrefix = '', $stripFromSelectionName = '', $errorMode = 0) {
1210 $index = md5($fileRef . $selectionPrefix . $stripFromSelectionName);
1211 if ($fileRef && !isset($this->inlineLanguageLabelFiles
[$index])) {
1212 $this->inlineLanguageLabelFiles
[$index] = array(
1213 'fileRef' => $fileRef,
1214 'selectionPrefix' => $selectionPrefix,
1215 'stripFromSelectionName' => $stripFromSelectionName,
1216 'errorMode' => $errorMode
1223 * Adds Javascript Inline Setting. This will occur in TYPO3.settings - object
1224 * The label can be used in scripts with TYPO3.setting.<key>
1227 * @param string $namespace
1228 * @param string $key
1229 * @param string $value
1232 public function addInlineSetting($namespace, $key, $value) {
1234 if (strpos($namespace, '.')) {
1235 $parts = explode('.', $namespace);
1236 $a = &$this->inlineSettings
;
1237 foreach ($parts as $part) {
1242 $this->inlineSettings
[$namespace][$key] = $value;
1245 $this->inlineSettings
[$key] = $value;
1250 * Adds Javascript Inline Setting. This will occur in TYPO3.settings - object
1251 * The label can be used in scripts with TYPO3.setting.<key>
1252 * Array will be merged with existing array.
1255 * @param string $namespace
1256 * @param array $array
1259 public function addInlineSettingArray($namespace, array $array) {
1261 if (strpos($namespace, '.')) {
1262 $parts = explode('.', $namespace);
1263 $a = &$this->inlineSettings
;
1264 foreach ($parts as $part) {
1267 $a = array_merge((array) $a, $array);
1269 $this->inlineSettings
[$namespace] = array_merge((array) $this->inlineSettings
[$namespace], $array);
1272 $this->inlineSettings
= array_merge($this->inlineSettings
, $array);
1277 * Adds content to body content
1279 * @param string $content
1282 public function addBodyContent($content) {
1283 $this->bodyContent
.= $content;
1286 /*****************************************************/
1288 /* Render Functions */
1291 /*****************************************************/
1294 * render the section (Header or Footer)
1296 * @param int $part section which should be rendered: self::PART_COMPLETE, self::PART_HEADER or self::PART_FOOTER
1297 * @return string content of rendered section
1299 public function render($part = self
::PART_COMPLETE
) {
1305 $jsFooterInline = '';
1307 $jsFooterFiles = '';
1309 // preRenderHook for possible manuipulation
1310 if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-preProcess'])) {
1312 'jsLibs' => &$this->jsLibs
,
1313 'jsFiles' => &$this->jsFiles
,
1314 'jsFooterFiles' => &$this->jsFooterFiles
,
1315 'cssFiles' => &$this->cssFiles
,
1316 'headerData' => &$this->headerData
,
1317 'footerData' => &$this->footerData
,
1318 'jsInline' => &$this->jsInline
,
1319 'cssInline' => &$this->cssInline
,
1321 foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-preProcess'] as $hook) {
1322 t3lib_div
::callUserFunction($hook, $params, $this);
1326 $jsLibs = $this->renderJsLibraries();
1328 if ($this->concatenateFiles
) {
1329 // do the file concatenation
1330 $this->doConcatenate();
1332 if ($this->compressCss ||
$this->compressJavascript
) {
1333 // do the file compression
1334 $this->doCompress();
1337 $metaTags = implode(LF
, $this->metaTags
);
1339 // remove ending slashes from static header block
1340 // if the page is beeing rendered as html (not xhtml)
1341 // and define variable $endingSlash for further use
1342 if ($this->getRenderXhtml()) {
1343 $endingSlash = ' /';
1345 $this->metaCharsetTag
= str_replace(' />', '>', $this->metaCharsetTag
);
1346 $this->baseUrlTag
= str_replace(' />', '>', $this->baseUrlTag
);
1347 $this->shortcutTag
= str_replace(' />', '>', $this->shortcutTag
);
1351 if (count($this->cssFiles
)) {
1352 foreach ($this->cssFiles
as $file => $properties) {
1353 $file = t3lib_div
::resolveBackPath($file);
1354 $file = t3lib_div
::createVersionNumberedFilename($file);
1355 $tag = '<link rel="' . htmlspecialchars($properties['rel']) . '" type="text/css" href="' .
1356 htmlspecialchars($file) . '" media="' . htmlspecialchars($properties['media']) . '"' .
1357 ($properties['title'] ?
' title="' . htmlspecialchars($properties['title']) . '"' : '') .
1359 if ($properties['allWrap'] && strpos($properties['allWrap'], '|') !== FALSE) {
1360 $tag = str_replace('|', $tag, $properties['allWrap']);
1362 if ($properties['forceOnTop']) {
1363 $cssFiles = $tag . LF
. $cssFiles;
1365 $cssFiles .= LF
. $tag;
1370 if (count($this->cssInline
)) {
1371 foreach ($this->cssInline
as $name => $properties) {
1372 if ($properties['forceOnTop']) {
1373 $cssInline = '/*' . htmlspecialchars($name) . '*/' . LF
. $properties['code'] . LF
. $cssInline;
1375 $cssInline .= '/*' . htmlspecialchars($name) . '*/' . LF
. $properties['code'] . LF
;
1378 $cssInline = $this->inlineCssWrap
[0] . $cssInline . $this->inlineCssWrap
[1];
1381 if (count($this->jsLibs
)) {
1382 foreach ($this->jsLibs
as $name => $properties) {
1383 $properties['file'] = t3lib_div
::resolveBackPath($properties['file']);
1384 $properties['file'] = t3lib_div
::createVersionNumberedFilename($properties['file']);
1385 $tag = '<script src="' . htmlspecialchars($properties['file']) . '" type="' . htmlspecialchars($properties['type']) . '"></script>';
1386 if ($properties['allWrap'] && strpos($properties['allWrap'], '|') !== FALSE) {
1387 $tag = str_replace('|', $tag, $properties['allWrap']);
1389 if ($properties['forceOnTop']) {
1390 if ($properties['section'] === self
::PART_HEADER
) {
1391 $jsLibs = $tag . LF
. $jsLibs;
1393 $jsFooterLibs = $tag . LF
. $jsFooterLibs;
1396 if ($properties['section'] === self
::PART_HEADER
) {
1397 $jsLibs .= LF
. $tag;
1399 $jsFooterLibs .= LF
. $tag;
1405 if (count($this->jsFiles
)) {
1406 foreach ($this->jsFiles
as $file => $properties) {
1407 $file = t3lib_div
::resolveBackPath($file);
1408 $file = t3lib_div
::createVersionNumberedFilename($file);
1409 $tag = '<script src="' . htmlspecialchars($file) . '" type="' . htmlspecialchars($properties['type']) . '"></script>';
1410 if ($properties['allWrap'] && strpos($properties['allWrap'], '|') !== FALSE) {
1411 $tag = str_replace('|', $tag, $properties['allWrap']);
1413 if ($properties['forceOnTop']) {
1414 if ($properties['section'] === self
::PART_HEADER
) {
1415 $jsFiles = $tag . LF
. $jsFiles;
1417 $jsFooterFiles = $tag . LF
. $jsFooterFiles;
1420 if ($properties['section'] === self
::PART_HEADER
) {
1421 $jsFiles .= LF
. $tag;
1423 $jsFooterFiles .= LF
. $tag;
1429 if (count($this->jsInline
)) {
1430 foreach ($this->jsInline
as $name => $properties) {
1431 if ($properties['forceOnTop']) {
1432 if ($properties['section'] === self
::PART_HEADER
) {
1433 $jsInline = '/*' . htmlspecialchars($name) . '*/' . LF
. $properties['code'] . LF
. $jsInline;
1435 $jsFooterInline = '/*' . htmlspecialchars($name) . '*/' . LF
. $properties['code'] . LF
. $jsFooterInline;
1438 if ($properties['section'] === self
::PART_HEADER
) {
1439 $jsInline .= '/*' . htmlspecialchars($name) . '*/' . LF
. $properties['code'] . LF
;
1441 $jsFooterInline .= '/*' . htmlspecialchars($name) . '*/' . LF
. $properties['code'] . LF
;
1449 $jsInline = $this->inlineJavascriptWrap
[0] . $jsInline . $this->inlineJavascriptWrap
[1];
1452 if ($jsFooterInline) {
1453 $jsFooterInline = $this->inlineJavascriptWrap
[0] . $jsFooterInline . $this->inlineJavascriptWrap
[1];
1458 $templateFile = t3lib_div
::getFileAbsFileName($this->templateFile
, TRUE);
1459 $template = t3lib_div
::getURL($templateFile);
1461 if ($this->removeLineBreaksFromTemplate
) {
1462 $template = strtr($template, array(LF
=> '', CR
=> ''));
1464 if ($part != self
::PART_COMPLETE
) {
1465 $templatePart = explode('###BODY###', $template);
1466 $template = $templatePart[$part - 1];
1469 if ($this->moveJsFromHeaderToFooter
) {
1470 $jsFooterLibs = $jsLibs . LF
. $jsFooterLibs;
1472 $jsFooterFiles = $jsFiles . LF
. $jsFooterFiles;
1474 $jsFooterInline = $jsInline . LF
. $jsFooterInline;
1478 $markerArray = array(
1479 'XMLPROLOG_DOCTYPE' => $this->xmlPrologAndDocType
,
1480 'HTMLTAG' => $this->htmlTag
,
1481 'HEADTAG' => $this->headTag
,
1482 'METACHARSET' => $this->charSet ?
str_replace('|', htmlspecialchars($this->charSet
), $this->metaCharsetTag
) : '',
1483 'INLINECOMMENT' => $this->inlineComments ? LF
. LF
. '<!-- ' . LF
. implode(LF
, $this->inlineComments
) . '-->' . LF
. LF
: '',
1484 'BASEURL' => $this->baseUrl ?
str_replace('|', $this->baseUrl
, $this->baseUrlTag
) : '',
1485 'SHORTCUT' => $this->favIcon ?
sprintf($this->shortcutTag
, htmlspecialchars($this->favIcon
), $this->iconMimeType
) : '',
1486 'CSS_INCLUDE' => $cssFiles,
1487 'CSS_INLINE' => $cssInline,
1488 'JS_INLINE' => $jsInline,
1489 'JS_INCLUDE' => $jsFiles,
1490 'JS_LIBS' => $jsLibs,
1491 'TITLE' => $this->title ?
str_replace('|', htmlspecialchars($this->title
), $this->titleTag
) : '',
1492 'META' => $metaTags,
1493 'HEADERDATA' => $this->headerData ?
implode(LF
, $this->headerData
) : '',
1494 'FOOTERDATA' => $this->footerData ?
implode(LF
, $this->footerData
) : '',
1495 'JS_LIBS_FOOTER' => $jsFooterLibs,
1496 'JS_INCLUDE_FOOTER' => $jsFooterFiles,
1497 'JS_INLINE_FOOTER' => $jsFooterInline,
1498 'BODY' => $this->bodyContent
,
1501 $markerArray = array_map('trim', $markerArray);
1504 return trim(t3lib_parsehtml
::substituteMarkerArray($template, $markerArray, '###|###'));
1508 * helper function for render the javascript libraries
1510 * @return string content with javascript libraries
1512 protected function renderJsLibraries() {
1515 if ($this->addSvg
) {
1516 $out .= '<script src="' . $this->processJsFile($this->backPath
. $this->svgPath
. 'svg.js') .
1517 '" data-path="' . $this->backPath
. $this->svgPath
.
1518 '"' . ($this->enableSvgDebug ?
' data-debug="true"' : '') . '></script>';
1521 if ($this->addPrototype
) {
1522 $out .= '<script src="' . $this->processJsFile($this->backPath
. $this->prototypePath
. 'prototype.js') .
1523 '" type="text/javascript"></script>' . LF
;
1524 unset($this->jsFiles
[$this->backPath
. $this->prototypePath
.'prototype.js']);
1527 if ($this->addScriptaculous
) {
1529 foreach ($this->addScriptaculousModules
as $key => $value) {
1530 if ($this->addScriptaculousModules
[$key]) {
1534 // resolve dependencies
1535 if (in_array('dragdrop', $mods) ||
in_array('controls', $mods)) {
1536 $mods = array_merge(array('effects'), $mods);
1540 foreach ($mods as $module) {
1541 $out .= '<script src="' . $this->processJsFile($this->backPath
.
1542 $this->scriptaculousPath
. $module . '.js') . '" type="text/javascript"></script>' . LF
;
1543 unset($this->jsFiles
[$this->backPath
. $this->scriptaculousPath
. $module . '.js']);
1546 $out .= '<script src="' . $this->processJsFile($this->backPath
. $this->scriptaculousPath
.
1547 'scriptaculous.js') . '" type="text/javascript"></script>' . LF
;
1548 unset($this->jsFiles
[$this->backPath
. $this->scriptaculousPath
. 'scriptaculous.js']);
1552 if ($this->addExtCore
) {
1553 $out .= '<script src="' . $this->processJsFile($this->backPath
.
1554 $this->extCorePath
. 'ext-core' . ($this->enableExtCoreDebug ?
'-debug' : '') . '.js') .
1555 '" type="text/javascript"></script>' . LF
;
1556 unset($this->jsFiles
[$this->backPath
. $this->extCorePath
. 'ext-core' . ($this->enableExtCoreDebug ?
'-debug' : '') . '.js']);
1560 if ($this->addExtJS
) {
1561 // use the base adapter all the time
1562 $out .= '<script src="' . $this->processJsFile($this->backPath
. $this->extJsPath
.
1563 'adapter/' . ($this->enableExtJsDebug ?
1564 str_replace('.js', '-debug.js', $this->extJSadapter
) : $this->extJSadapter
)) .
1565 '" type="text/javascript"></script>' . LF
;
1566 $out .= '<script src="' . $this->processJsFile($this->backPath
. $this->extJsPath
.
1567 'ext-all' . ($this->enableExtJsDebug ?
'-debug' : '') . '.js') .
1568 '" type="text/javascript"></script>' . LF
;
1570 // add extJS localization
1571 $localeMap = $this->csConvObj
->isoArray
; // load standard ISO mapping and modify for use with ExtJS
1572 $localeMap[''] = 'en';
1573 $localeMap['default'] = 'en';
1574 $localeMap['gr'] = 'el_GR'; // Greek
1575 $localeMap['no'] = 'no_BO'; // Norwegian Bokmaal
1576 $localeMap['se'] = 'se_SV'; // Swedish
1579 $extJsLang = isset($localeMap[$this->lang
]) ?
$localeMap[$this->lang
] : $this->lang
;
1580 // TODO autoconvert file from UTF8 to current BE charset if necessary!!!!
1581 $extJsLocaleFile = $this->extJsPath
. 'locale/ext-lang-' . $extJsLang . '.js';
1582 if (file_exists(PATH_typo3
. $extJsLocaleFile)) {
1583 $out .= '<script src="' . $this->processJsFile($this->backPath
.
1584 $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);
1694 /*****************************************************/
1699 /*****************************************************/
1702 * concatenate files into one file
1703 * registered handler
1707 protected function doConcatenate() {
1708 // traverse the arrays, concatenate in one file
1709 // then remove concatenated files from array and add the concatenated file
1711 if ($this->concatenateFiles
) {
1713 'jsLibs' => &$this->jsLibs
,
1714 'jsFiles' => &$this->jsFiles
,
1715 'jsFooterFiles' => &$this->jsFooterFiles
,
1716 'cssFiles' => &$this->cssFiles
,
1717 'headerData' => &$this->headerData
,
1718 'footerData' => &$this->footerData
,
1721 if ($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE
]['concatenateHandler']) {
1722 // use extern concatenate routine
1723 t3lib_div
::callUserFunction($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE
]['concatenateHandler'], $params, $this);
1724 } elseif (TYPO3_MODE
=== 'BE') {
1725 $cssOptions = array('baseDirectories' => $GLOBALS['TBE_TEMPLATE']->getSkinStylesheetDirectories());
1726 $this->cssFiles
= $this->getCompressor()->concatenateCssFiles($this->cssFiles
, $cssOptions);
1732 * compress inline code
1736 protected function doCompress() {
1738 if ($this->compressJavascript
&& $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE
]['jsCompressHandler']) {
1739 // use extern compress routine
1741 'jsInline' => &$this->jsInline
,
1742 'jsFooterInline' => &$this->jsFooterInline
,
1743 'jsLibs' => &$this->jsLibs
,
1744 'jsFiles' => &$this->jsFiles
,
1745 'jsFooterFiles' => &$this->jsFooterFiles
,
1746 'headerData' => &$this->headerData
,
1747 'footerData' => &$this->footerData
,
1749 t3lib_div
::callUserFunction($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE
]['jsCompressHandler'], $params, $this);
1751 // traverse the arrays, compress files
1753 if ($this->compressJavascript
) {
1754 if (count($this->jsInline
)) {
1755 foreach ($this->jsInline
as $name => $properties) {
1756 if ($properties['compress']) {
1758 $this->jsInline
[$name]['code'] = t3lib_div
::minifyJavaScript($properties['code'], $error);
1760 $this->compressError
.= 'Error with minify JS Inline Block "' . $name . '": ' . $error . LF
;
1765 if (TYPO3_MODE
=== 'BE') {
1766 $this->jsFiles
= $this->getCompressor()->compressJsFiles($this->jsFiles
);
1767 $this->jsFooterFiles
= $this->getCompressor()->compressJsFiles($this->jsFooterFiles
);
1771 if ($this->compressCss
) {
1772 // use extern compress routine
1774 'cssInline' => &$this->cssInline
,
1775 'cssFiles' => &$this->cssFiles
,
1776 'headerData' => &$this->headerData
,
1777 'footerData' => &$this->footerData
,
1780 if ($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE
]['cssCompressHandler']) {
1781 // use extern concatenate routine
1782 t3lib_div
::callUserFunction($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE
]['cssCompressHandler'], $params, $this);
1783 } elseif (TYPO3_MODE
=== 'BE') {
1784 $this->cssFiles
= $this->getCompressor()->compressCssFiles($this->cssFiles
);
1790 * Returns instance of t3lib_Compressor
1792 * @return t3lib_Compressor Instance of t3lib_Compressor
1794 protected function getCompressor() {
1795 if ($this->compressor
=== NULL) {
1796 $this->compressor
= t3lib_div
::makeInstance('t3lib_Compressor');
1798 return $this->compressor
;
1802 * Processes a Javascript file dependent on the current context
1804 * Adds the version number for Frontend, compresses the file for Backend
1806 * @param string $filename Filename
1807 * @return string new filename
1809 protected function processJsFile($filename) {
1810 switch (TYPO3_MODE
) {
1812 $filename = t3lib_div
::createVersionNumberedFilename($filename);
1815 if ($this->compressJavascript
) {
1816 $filename = $this->getCompressor()->compressJsFile($filename);
1825 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE
]['XCLASS']['t3lib/class.t3lib_pagerenderer.php']) {
1826 include_once ($TYPO3_CONF_VARS[TYPO3_MODE
]['XCLASS']['t3lib/class.t3lib_pagerenderer.php']);