‪TYPO3CMS  9.5
PageRenderer.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
24 use TYPO3\CMS\Core\Package\PackageManager;
29 
35 {
36  // Constants for the part to be rendered
37  const ‪PART_COMPLETE = 0;
38  const ‪PART_HEADER = 1;
39  const ‪PART_FOOTER = 2;
40  // @deprecated will be removed in TYPO3 v10.0.
41  // jQuery Core version that is shipped with TYPO3
42  const ‪JQUERY_VERSION_LATEST = '3.3.1';
43  // jQuery namespace options
44  // @deprecated will be removed in TYPO3 v10.0.
45  const ‪JQUERY_NAMESPACE_NONE = 'none';
46 
47  const ‪REQUIREJS_SCOPE_CONFIG = 'config';
48  const ‪REQUIREJS_SCOPE_RESOLVE = 'resolve';
49 
53  protected ‪$compressJavascript = false;
54 
58  protected ‪$compressCss = false;
59 
63  protected ‪$removeLineBreaksFromTemplate = false;
64 
69  protected ‪$concatenateFiles = false;
70 
74  protected ‪$concatenateJavascript = false;
75 
79  protected ‪$concatenateCss = false;
80 
84  protected ‪$moveJsFromHeaderToFooter = false;
85 
89  protected ‪$locales;
90 
97  protected ‪$lang;
98 
105  protected ‪$languageDependencies = [];
106 
110  protected ‪$compressor;
111 
112  // Arrays containing associative array for the included files
116  protected ‪$jsFiles = [];
117 
121  protected ‪$jsFooterFiles = [];
122 
126  protected ‪$jsLibs = [];
127 
131  protected ‪$jsFooterLibs = [];
132 
136  protected ‪$cssFiles = [];
137 
141  protected ‪$cssLibs = [];
142 
148  protected ‪$title;
149 
155  protected ‪$charSet;
156 
160  protected ‪$favIcon;
161 
165  protected ‪$baseUrl;
166 
170  protected ‪$renderXhtml = true;
171 
172  // Static header blocks
176  protected ‪$xmlPrologAndDocType = '';
177 
181  protected ‪$metaTags = [];
182 
186  protected ‪$inlineComments = [];
187 
191  protected ‪$headerData = [];
192 
196  protected ‪$footerData = [];
197 
201  protected ‪$titleTag = '<title>|</title>';
202 
206  protected ‪$metaCharsetTag = '<meta http-equiv="Content-Type" content="text/html; charset=|" />';
207 
211  protected ‪$htmlTag = '<html>';
212 
216  protected ‪$headTag = '<head>';
217 
221  protected ‪$baseUrlTag = '<base href="|" />';
222 
226  protected ‪$iconMimeType = '';
227 
231  protected ‪$shortcutTag = '<link rel="shortcut icon" href="%1$s"%2$s />';
232 
233  // Static inline code blocks
237  protected ‪$jsInline = [];
238 
242  protected ‪$jsFooterInline = [];
243 
247  protected ‪$extOnReadyCode = [];
248 
252  protected ‪$cssInline = [];
253 
257  protected ‪$bodyContent;
258 
262  protected ‪$templateFile;
263 
264  // Paths to contributed libraries
265 
270  protected ‪$requireJsPath = 'EXT:core/Resources/Public/JavaScript/Contrib/';
271 
278  protected ‪$jQueryPath = 'EXT:core/Resources/Public/JavaScript/Contrib/jquery/';
279 
280  // Internal flags for JS-libraries
299  protected ‪$jQueryVersions = [];
300 
309  ];
310 
316  protected ‪$jQueryCdnUrls = [
317  'google' => 'https://ajax.googleapis.com/ajax/libs/jquery/%1$s/jquery%2$s.js',
318  'msn' => 'https://ajax.aspnetcdn.com/ajax/jQuery/jquery-%1$s%2$s.js',
319  'jquery' => 'https://code.jquery.com/jquery-%1$s%2$s.js',
320  'cloudflare' => 'https://cdnjs.cloudflare.com/ajax/libs/jquery/%1$s/jquery%2$s.js'
321  ];
322 
327  protected ‪$addRequireJs = false;
328 
333  protected ‪$requireJsConfig = [];
334 
340 
346 
350  protected ‪$enableJqueryDebug = false;
351 
355  protected ‪$inlineLanguageLabels = [];
356 
360  protected ‪$inlineLanguageLabelFiles = [];
361 
365  protected ‪$inlineSettings = [];
366 
370  protected ‪$inlineJavascriptWrap = [];
371 
375  protected ‪$inlineCssWrap = [];
376 
382  protected ‪$compressError = '';
383 
389  protected ‪$endingSlash = '';
390 
394  protected ‪$metaTagRegistry;
395 
399  protected static ‪$cache = null;
400 
404  public function ‪__construct(‪$templateFile = '')
405  {
406  $this->‪reset();
407  $this->locales = GeneralUtility::makeInstance(\‪TYPO3\CMS\Core\Localization\Locales::class);
408  if (‪$templateFile !== '') {
409  $this->templateFile = ‪$templateFile;
410  }
411  $this->inlineJavascriptWrap = [
412  '<script type="text/javascript">' . LF . '/*<![CDATA[*/' . LF,
413  '/*]]>*/' . LF . '</script>' . LF
414  ];
415  $this->inlineCssWrap = [
416  '<style type="text/css">' . LF . '/*<![CDATA[*/' . LF . '<!-- ' . LF,
417  '-->' . LF . '/*]]>*/' . LF . '</style>' . LF
418  ];
419 
420  $this->metaTagRegistry = GeneralUtility::makeInstance(MetaTagManagerRegistry::class);
421  $this->‪setMetaTag('name', 'generator', 'TYPO3 CMS');
422  }
423 
428  public function ‪__wakeup()
429  {
430  GeneralUtility::setSingletonInstance(get_class($this->metaTagRegistry), $this->metaTagRegistry);
431  }
432 
436  public static function ‪setCache(FrontendInterface ‪$cache)
437  {
438  static::$cache = ‪$cache;
439  }
440 
444  protected function ‪reset()
445  {
446  $this->templateFile = 'EXT:core/Resources/Private/Templates/PageRenderer.html';
447  $this->jsFiles = [];
448  $this->jsFooterFiles = [];
449  $this->jsInline = [];
450  $this->jsFooterInline = [];
451  $this->jsLibs = [];
452  $this->cssFiles = [];
453  $this->cssInline = [];
454  $this->metaTags = [];
455  $this->inlineComments = [];
456  $this->headerData = [];
457  $this->footerData = [];
458  $this->extOnReadyCode = [];
459  $this->jQueryVersions = [];
460  }
461 
462  /*****************************************************/
463  /* */
464  /* Public Setters */
465  /* */
466  /* */
467  /*****************************************************/
473  public function ‪setTitle(‪$title)
474  {
475  $this->title = ‪$title;
476  }
477 
483  public function ‪setRenderXhtml($enable)
484  {
485  $this->renderXhtml = $enable;
486  }
487 
494  {
495  $this->xmlPrologAndDocType = ‪$xmlPrologAndDocType;
496  }
497 
503  public function ‪setCharSet(‪$charSet)
504  {
505  $this->charSet = ‪$charSet;
506  }
507 
513  public function ‪setLanguage(‪$lang)
514  {
515  $this->lang = ‪$lang;
516  $this->languageDependencies = [];
517 
518  // Language is found. Configure it:
519  if (in_array($this->lang, $this->locales->getLocales())) {
520  $this->languageDependencies[] = ‪$this->lang;
521  foreach ($this->locales->getLocaleDependencies($this->lang) as $language) {
522  $this->languageDependencies[] = $language;
523  }
524  }
525  }
526 
533  {
534  $this->metaCharsetTag = ‪$metaCharsetTag;
535  }
536 
542  public function ‪setHtmlTag(‪$htmlTag)
543  {
544  $this->htmlTag = ‪$htmlTag;
545  }
546 
552  public function ‪setHeadTag(‪$headTag)
553  {
554  $this->headTag = ‪$headTag;
555  }
556 
562  public function ‪setFavIcon(‪$favIcon)
563  {
564  $this->favIcon = ‪$favIcon;
565  }
566 
572  public function ‪setIconMimeType(‪$iconMimeType)
573  {
574  $this->iconMimeType = ‪$iconMimeType;
575  }
576 
582  public function ‪setBaseUrl(‪$baseUrl)
583  {
584  $this->baseUrl = ‪$baseUrl;
585  }
586 
592  public function ‪setTemplateFile($file)
593  {
594  $this->templateFile = $file;
595  }
596 
602  public function ‪setBodyContent($content)
603  {
604  $this->bodyContent = $content;
605  }
606 
612  public function ‪setRequireJsPath($path)
613  {
614  $this->requireJsPath = $path;
615  }
616 
621  public function ‪getRequireJsConfig(string $scope = null): array
622  {
623  // return basic RequireJS configuration without shim, paths and packages
624  if ($scope === static::REQUIREJS_SCOPE_CONFIG) {
625  return array_replace_recursive(
626  $this->publicRequireJsConfig,
628  $this->requireJsConfig,
629  ['shim', 'paths', 'packages'],
630  false
631  )
632  );
633  }
634  // return RequireJS configuration for resolving only shim, paths and packages
635  if ($scope === static::REQUIREJS_SCOPE_RESOLVE) {
636  return $this->‪filterArrayKeys(
637  $this->requireJsConfig,
638  ['shim', 'paths', 'packages'],
639  true
640  );
641  }
642  return [];
643  }
644 
645  /*****************************************************/
646  /* */
647  /* Public Enablers / Disablers */
648  /* */
649  /* */
650  /*****************************************************/
655  {
656  $this->moveJsFromHeaderToFooter = true;
657  }
658 
662  public function ‪disableMoveJsFromHeaderToFooter()
663  {
664  $this->moveJsFromHeaderToFooter = false;
665  }
666 
670  public function ‪enableCompressJavascript()
671  {
672  $this->compressJavascript = true;
673  }
674 
678  public function ‪disableCompressJavascript()
679  {
680  $this->compressJavascript = false;
681  }
682 
686  public function ‪enableCompressCss()
687  {
688  $this->compressCss = true;
689  }
690 
694  public function ‪disableCompressCss()
695  {
696  $this->compressCss = false;
697  }
698 
703  public function ‪enableConcatenateFiles()
704  {
705  trigger_error('This method will be removed in TYPO3 v10.0. Use concatenateCss() and concatenateJavascript() instead.', E_USER_DEPRECATED);
706  $this->concatenateFiles = true;
707  }
708 
713  public function ‪disableConcatenateFiles()
714  {
715  trigger_error('This method will be removed in TYPO3 v10.0. Use concatenateCss() and concatenateJavascript() instead.', E_USER_DEPRECATED);
716  $this->concatenateFiles = false;
717  }
718 
722  public function ‪enableConcatenateJavascript()
723  {
724  $this->concatenateJavascript = true;
725  }
726 
730  public function ‪disableConcatenateJavascript()
731  {
732  $this->concatenateJavascript = false;
733  }
734 
738  public function ‪enableConcatenateCss()
739  {
740  $this->concatenateCss = true;
741  }
742 
746  public function ‪disableConcatenateCss()
747  {
748  $this->concatenateCss = false;
749  }
750 
754  public function ‪enableRemoveLineBreaksFromTemplate()
755  {
756  $this->removeLineBreaksFromTemplate = true;
757  }
758 
763  {
764  $this->removeLineBreaksFromTemplate = false;
765  }
766 
771  public function ‪enableDebugMode()
772  {
773  $this->compressJavascript = false;
774  $this->compressCss = false;
775  $this->concatenateCss = false;
776  $this->concatenateJavascript = false;
777  $this->removeLineBreaksFromTemplate = false;
778  $this->enableJqueryDebug = true;
779  }
780 
781  /*****************************************************/
782  /* */
783  /* Public Getters */
784  /* */
785  /* */
786  /*****************************************************/
792  public function ‪getTitle()
793  {
794  return ‪$this->title;
795  }
796 
802  public function ‪getCharSet()
803  {
804  return ‪$this->charSet;
805  }
806 
812  public function ‪getLanguage()
813  {
814  return ‪$this->lang;
815  }
816 
822  public function ‪getRenderXhtml()
823  {
824  return ‪$this->renderXhtml;
825  }
826 
832  public function ‪getHtmlTag()
833  {
834  return ‪$this->htmlTag;
835  }
836 
842  public function ‪getMetaCharsetTag()
843  {
845  }
846 
852  public function ‪getHeadTag()
853  {
854  return ‪$this->headTag;
855  }
856 
862  public function ‪getFavIcon()
863  {
864  return ‪$this->favIcon;
865  }
866 
872  public function ‪getIconMimeType()
873  {
875  }
876 
882  public function ‪getBaseUrl()
883  {
884  return ‪$this->baseUrl;
885  }
886 
892  public function ‪getTemplateFile()
893  {
894  return ‪$this->templateFile;
895  }
896 
902  public function ‪getMoveJsFromHeaderToFooter()
903  {
905  }
906 
912  public function ‪getCompressJavascript()
913  {
915  }
916 
922  public function ‪getCompressCss()
923  {
924  return ‪$this->compressCss;
925  }
926 
933  public function ‪getConcatenateFiles()
934  {
935  trigger_error('This method will be removed in TYPO3 v10.0. Use concatenateCss() and concatenateJavascript() instead.', E_USER_DEPRECATED);
937  }
938 
944  public function ‪getConcatenateJavascript()
945  {
947  }
948 
954  public function ‪getConcatenateCss()
955  {
957  }
958 
964  public function ‪getRemoveLineBreaksFromTemplate()
965  {
967  }
968 
974  public function ‪getBodyContent()
975  {
976  return ‪$this->bodyContent;
977  }
978 
984  public function ‪getInlineLanguageLabels()
985  {
987  }
988 
994  public function ‪getInlineLanguageLabelFiles()
995  {
997  }
998 
999  /*****************************************************/
1000  /* */
1001  /* Public Functions to add Data */
1002  /* */
1003  /* */
1004  /*****************************************************/
1010  public function ‪addMetaTag($meta)
1011  {
1012  trigger_error('Method pageRenderer->addMetaTag will be removed with TYPO3 v10.0. Use pageRenderer->setMetaTag instead.', E_USER_DEPRECATED);
1013  if (!in_array($meta, $this->metaTags)) {
1014  $this->metaTags[] = $meta;
1015  }
1016  }
1028  public function ‪setMetaTag(string $type, string $name, string $content, array $subProperties = [], $replace = true)
1029  {
1030  // Lowercase all the things
1031  $type = strtolower($type);
1032  $name = strtolower($name);
1033  if (!in_array($type, ['property', 'name', 'http-equiv'], true)) {
1034  throw new \InvalidArgumentException(
1035  'When setting a meta tag the only types allowed are property, name or http-equiv. "' . $type . '" given.',
1036  1496402460
1037  );
1038  }
1039  $manager = $this->metaTagRegistry->getManagerForProperty($name);
1040  $manager->addProperty($name, $content, $subProperties, $replace, $type);
1041  }
1042 
1051  public function ‪getMetaTag(string $type, string $name): array
1052  {
1053  // Lowercase all the things
1054  $type = strtolower($type);
1055  $name = strtolower($name);
1057  $manager = $this->metaTagRegistry->getManagerForProperty($name);
1058  $propertyContent = $manager->getProperty($name, $type);
1059 
1060  if (!empty($propertyContent[0])) {
1061  return [
1062  'type' => $type,
1063  'name' => $name,
1064  'content' => $propertyContent[0]['content']
1065  ];
1066  }
1067  return [];
1068  }
1069 
1076  public function ‪removeMetaTag(string $type, string $name)
1077  {
1078  // Lowercase all the things
1079  $type = strtolower($type);
1080  $name = strtolower($name);
1081 
1082  $manager = $this->metaTagRegistry->getManagerForProperty($name);
1083  $manager->removeProperty($name, $type);
1084  }
1085 
1091  public function ‪addInlineComment($comment)
1092  {
1093  if (!in_array($comment, $this->inlineComments)) {
1094  $this->inlineComments[] = $comment;
1095  }
1096  }
1097 
1103  public function ‪addHeaderData($data)
1104  {
1105  if (!in_array($data, $this->headerData)) {
1106  $this->headerData[] = $data;
1107  }
1108  }
1109 
1115  public function ‪addFooterData($data)
1116  {
1117  if (!in_array($data, $this->footerData)) {
1118  $this->footerData[] = $data;
1119  }
1120  }
1121 
1138  public function ‪addJsLibrary($name, $file, $type = 'text/javascript', $compress = false, $forceOnTop = false, $allWrap = '', $excludeFromConcatenation = false, $splitChar = '|', $async = false, $integrity = '', $defer = false, $crossorigin = '')
1139  {
1140  if (!$type) {
1141  $type = 'text/javascript';
1142  }
1143  if (!in_array(strtolower($name), $this->jsLibs)) {
1144  $this->jsLibs[strtolower($name)] = [
1145  'file' => $file,
1146  'type' => $type,
1147  'section' => ‪self::PART_HEADER,
1148  'compress' => $compress,
1149  'forceOnTop' => $forceOnTop,
1150  'allWrap' => $allWrap,
1151  'excludeFromConcatenation' => $excludeFromConcatenation,
1152  'splitChar' => $splitChar,
1153  'async' => $async,
1154  'integrity' => $integrity,
1155  'defer' => $defer,
1156  'crossorigin' => $crossorigin,
1157  ];
1158  }
1159  }
1160 
1177  public function ‪addJsFooterLibrary($name, $file, $type = 'text/javascript', $compress = false, $forceOnTop = false, $allWrap = '', $excludeFromConcatenation = false, $splitChar = '|', $async = false, $integrity = '', $defer = false, $crossorigin = '')
1178  {
1179  if (!$type) {
1180  $type = 'text/javascript';
1181  }
1182  $name .= '_jsFooterLibrary';
1183  if (!in_array(strtolower($name), $this->jsLibs)) {
1184  $this->jsLibs[strtolower($name)] = [
1185  'file' => $file,
1186  'type' => $type,
1187  'section' => ‪self::PART_FOOTER,
1188  'compress' => $compress,
1189  'forceOnTop' => $forceOnTop,
1190  'allWrap' => $allWrap,
1191  'excludeFromConcatenation' => $excludeFromConcatenation,
1192  'splitChar' => $splitChar,
1193  'async' => $async,
1194  'integrity' => $integrity,
1195  'defer' => $defer,
1196  'crossorigin' => $crossorigin,
1197  ];
1198  }
1199  }
1200 
1216  public function ‪addJsFile($file, $type = 'text/javascript', $compress = true, $forceOnTop = false, $allWrap = '', $excludeFromConcatenation = false, $splitChar = '|', $async = false, $integrity = '', $defer = false, $crossorigin = '')
1217  {
1218  if (!$type) {
1219  $type = 'text/javascript';
1220  }
1221  if (!isset($this->jsFiles[$file])) {
1222  $this->jsFiles[$file] = [
1223  'file' => $file,
1224  'type' => $type,
1225  'section' => ‪self::PART_HEADER,
1226  'compress' => $compress,
1227  'forceOnTop' => $forceOnTop,
1228  'allWrap' => $allWrap,
1229  'excludeFromConcatenation' => $excludeFromConcatenation,
1230  'splitChar' => $splitChar,
1231  'async' => $async,
1232  'integrity' => $integrity,
1233  'defer' => $defer,
1234  'crossorigin' => $crossorigin,
1235  ];
1236  }
1237  }
1238 
1254  public function ‪addJsFooterFile($file, $type = 'text/javascript', $compress = true, $forceOnTop = false, $allWrap = '', $excludeFromConcatenation = false, $splitChar = '|', $async = false, $integrity = '', $defer = false, $crossorigin = '')
1255  {
1256  if (!$type) {
1257  $type = 'text/javascript';
1258  }
1259  if (!isset($this->jsFiles[$file])) {
1260  $this->jsFiles[$file] = [
1261  'file' => $file,
1262  'type' => $type,
1263  'section' => ‪self::PART_FOOTER,
1264  'compress' => $compress,
1265  'forceOnTop' => $forceOnTop,
1266  'allWrap' => $allWrap,
1267  'excludeFromConcatenation' => $excludeFromConcatenation,
1268  'splitChar' => $splitChar,
1269  'async' => $async,
1270  'integrity' => $integrity,
1271  'defer' => $defer,
1272  'crossorigin' => $crossorigin,
1273  ];
1274  }
1275  }
1276 
1285  public function ‪addJsInlineCode($name, $block, $compress = true, $forceOnTop = false)
1286  {
1287  if (!isset($this->jsInline[$name]) && !empty($block)) {
1288  $this->jsInline[$name] = [
1289  'code' => $block . LF,
1290  'section' => ‪self::PART_HEADER,
1291  'compress' => $compress,
1292  'forceOnTop' => $forceOnTop
1293  ];
1294  }
1295  }
1296 
1305  public function ‪addJsFooterInlineCode($name, $block, $compress = true, $forceOnTop = false)
1306  {
1307  if (!isset($this->jsInline[$name]) && !empty($block)) {
1308  $this->jsInline[$name] = [
1309  'code' => $block . LF,
1310  'section' => ‪self::PART_FOOTER,
1311  'compress' => $compress,
1312  'forceOnTop' => $forceOnTop
1313  ];
1314  }
1315  }
1316 
1331  public function ‪addCssFile($file, $rel = 'stylesheet', $media = 'all', ‪$title = '', $compress = true, $forceOnTop = false, $allWrap = '', $excludeFromConcatenation = false, $splitChar = '|', $inline = false)
1332  {
1333  if (!isset($this->cssFiles[$file])) {
1334  $this->cssFiles[$file] = [
1335  'file' => $file,
1336  'rel' => $rel,
1337  'media' => $media,
1338  'title' => ‪$title,
1339  'compress' => $compress,
1340  'forceOnTop' => $forceOnTop,
1341  'allWrap' => $allWrap,
1342  'excludeFromConcatenation' => $excludeFromConcatenation,
1343  'splitChar' => $splitChar,
1344  'inline' => $inline
1345  ];
1346  }
1347  }
1348 
1363  public function ‪addCssLibrary($file, $rel = 'stylesheet', $media = 'all', ‪$title = '', $compress = true, $forceOnTop = false, $allWrap = '', $excludeFromConcatenation = false, $splitChar = '|', $inline = false)
1364  {
1365  if (!isset($this->cssLibs[$file])) {
1366  $this->cssLibs[$file] = [
1367  'file' => $file,
1368  'rel' => $rel,
1369  'media' => $media,
1370  'title' => ‪$title,
1371  'compress' => $compress,
1372  'forceOnTop' => $forceOnTop,
1373  'allWrap' => $allWrap,
1374  'excludeFromConcatenation' => $excludeFromConcatenation,
1375  'splitChar' => $splitChar,
1376  'inline' => $inline
1377  ];
1378  }
1379  }
1380 
1389  public function ‪addCssInlineBlock($name, $block, $compress = false, $forceOnTop = false)
1390  {
1391  if (!isset($this->cssInline[$name]) && !empty($block)) {
1392  $this->cssInline[$name] = [
1393  'code' => $block,
1394  'compress' => $compress,
1395  'forceOnTop' => $forceOnTop
1396  ];
1397  }
1398  }
1399 
1410  public function ‪loadJquery($version = null, $source = null, $namespace = self::JQUERY_NAMESPACE_NONE, bool $isCoreCall = false)
1411  {
1412  if (!$isCoreCall) {
1413  trigger_error('PageRenderer->loadJquery() will be removed in TYPO3 v10.0. Use a package manager for frontend or custom jQuery files instead.', E_USER_DEPRECATED);
1414  }
1415  // Set it to the version that is shipped with the TYPO3 core
1416  if ($version === null || $version === 'latest') {
1417  $version = ‪self::JQUERY_VERSION_LATEST;
1418  }
1419  // Check if the source is set, otherwise set it to "default"
1420  if ($source === null) {
1421  $source = 'local';
1422  }
1423  if ($source === 'local' && !in_array($version, $this->availableLocalJqueryVersions)) {
1424  throw new \UnexpectedValueException('The requested jQuery version is not available in the local filesystem.', 1341505305);
1425  }
1426  if (!preg_match('/^[a-zA-Z0-9]+$/', $namespace)) {
1427  throw new \UnexpectedValueException('The requested namespace contains non alphanumeric characters.', 1341571604);
1428  }
1429  $this->jQueryVersions[$namespace] = [
1430  'version' => $version,
1431  'source' => $source
1432  ];
1433  }
1434 
1441  public function ‪loadRequireJs()
1442  {
1443  $this->addRequireJs = true;
1444  if (!empty($this->requireJsConfig) && !empty($this->publicRequireJsConfig)) {
1445  return;
1446  }
1447 
1448  $packages = GeneralUtility::makeInstance(PackageManager::class)->getActivePackages();
1449  $isDevelopment = GeneralUtility::getApplicationContext()->isDevelopment();
1450  $cacheIdentifier = 'requireJS_' . md5(implode(',', array_keys($packages)) . ($isDevelopment ? ':dev' : '') . GeneralUtility::getIndpEnv('TYPO3_REQUEST_SCRIPT'));
1452  ‪$cache = static::$cache ?? GeneralUtility::makeInstance(CacheManager::class)->getCache('assets');
1453  ‪$requireJsConfig = ‪$cache->‪get($cacheIdentifier);
1454 
1455  // if we did not get a configuration from the cache, compute and store it in the cache
1456  if (!isset(‪$requireJsConfig['internal']) || !isset(‪$requireJsConfig['public'])) {
1457  ‪$requireJsConfig = $this->‪computeRequireJsConfig($isDevelopment, $packages);
1458  ‪$cache->‪set($cacheIdentifier, ‪$requireJsConfig);
1459  }
1460 
1461  $this->requireJsConfig = ‪$requireJsConfig['internal'];
1462  $this->publicRequireJsConfig = ‪$requireJsConfig['public'];
1463  $this->internalRequireJsPathModuleNames = ‪$requireJsConfig['internalNames'];
1464  }
1465 
1474  protected function ‪computeRequireJsConfig($isDevelopment, array $packages)
1475  {
1476  // load all paths to map to package names / namespaces
1478  'public' => [],
1479  'internal' => [],
1480  'internalNames' => [],
1481  ];
1482 
1483  $corePath = $packages['core']->getPackagePath() . 'Resources/Public/JavaScript/Contrib/';
1484  $corePath = ‪PathUtility::getAbsoluteWebPath($corePath);
1485  // first, load all paths for the namespaces, and configure contrib libs.
1486  ‪$requireJsConfig['public']['paths'] = [
1487  'jquery' => $corePath . '/jquery/jquery',
1488  'jquery-ui' => $corePath . 'jquery-ui',
1489  'datatables' => $corePath . 'jquery.dataTables',
1490  'nprogress' => $corePath . 'nprogress',
1491  'moment' => $corePath . 'moment',
1492  'cropper' => $corePath . 'cropper.min',
1493  'imagesloaded' => $corePath . 'imagesloaded.pkgd.min',
1494  'bootstrap' => $corePath . 'bootstrap/bootstrap',
1495  'twbs/bootstrap-datetimepicker' => $corePath . 'bootstrap-datetimepicker',
1496  'autosize' => $corePath . 'autosize',
1497  'taboverride' => $corePath . 'taboverride.min',
1498  'twbs/bootstrap-slider' => $corePath . 'bootstrap-slider.min',
1499  'jquery/autocomplete' => $corePath . 'jquery.autocomplete',
1500  'd3' => $corePath . 'd3/d3',
1501  'intersection-observer' => $corePath . '/intersection-observer',
1502  ];
1503  ‪$requireJsConfig['public']['waitSeconds'] = 30;
1504  ‪$requireJsConfig['public']['typo3BaseUrl'] = false;
1505  $publicPackageNames = ['core', 'frontend', 'backend'];
1506  $requireJsExtensionVersions = [];
1507  foreach ($packages as $packageName => $package) {
1508  $absoluteJsPath = $package->getPackagePath() . 'Resources/Public/JavaScript/';
1509  $fullJsPath = ‪PathUtility::getAbsoluteWebPath($absoluteJsPath);
1510  $fullJsPath = rtrim($fullJsPath, '/');
1511  if (!empty($fullJsPath) && file_exists($absoluteJsPath)) {
1512  $type = in_array($packageName, $publicPackageNames, true) ? 'public' : 'internal';
1513  ‪$requireJsConfig[$type]['paths']['TYPO3/CMS/' . GeneralUtility::underscoredToUpperCamelCase($packageName)] = $fullJsPath;
1514  $requireJsExtensionVersions[] = $package->getPackageKey() . ':' . $package->getPackageMetadata()->getVersion();
1515  }
1516  }
1517  // sanitize module names in internal 'paths'
1518  $internalPathModuleNames = array_keys(‪$requireJsConfig['internal']['paths'] ?? []);
1519  $sanitizedInternalPathModuleNames = array_map(
1520  function ($moduleName) {
1521  // trim spaces and slashes & add ending slash
1522  return trim($moduleName, ' /') . '/';
1523  },
1524  $internalPathModuleNames
1525  );
1526  ‪$requireJsConfig['internalNames'] = array_combine(
1527  $sanitizedInternalPathModuleNames,
1528  $internalPathModuleNames
1529  );
1530 
1531  // Add a GET parameter to the files loaded via requireJS in order to avoid browser caching of JS files
1532  if ($isDevelopment) {
1533  ‪$requireJsConfig['public']['urlArgs'] = 'bust=' . ‪$GLOBALS['EXEC_TIME'];
1534  } else {
1535  ‪$requireJsConfig['public']['urlArgs'] = 'bust=' . GeneralUtility::hmac(
1536  ‪Environment::getProjectPath() . implode('|', $requireJsExtensionVersions)
1537  );
1538  }
1539 
1540  // check if additional AMD modules need to be loaded if a single AMD module is initialized
1541  if (is_array(‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['RequireJS']['postInitializationModules'] ?? false)) {
1542  $this->‪addInlineSettingArray(
1543  'RequireJS.PostInitializationModules',
1544  ‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['RequireJS']['postInitializationModules']
1545  );
1546  }
1547 
1548  return ‪$requireJsConfig;
1549  }
1550 
1563  public function ‪addRequireJsConfiguration(array $configuration)
1564  {
1565  if (TYPO3_MODE === 'BE') {
1566  // Load RequireJS in backend context at first. Doing this in FE could break the output
1567  $this->‪loadRequireJs();
1568  }
1569  $this->requireJsConfig = array_merge_recursive($this->requireJsConfig, $configuration);
1570  }
1571 
1578  protected function ‪getRequireJsLoader(): string
1579  {
1580  $html = '';
1581  $backendRequest = TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_BE;
1582  $backendUserLoggedIn = !empty(‪$GLOBALS['BE_USER']->user['uid']);
1583 
1584  // no backend request - basically frontend
1585  if (!$backendRequest) {
1586  ‪$requireJsConfig = $this->‪getRequireJsConfig(static::REQUIREJS_SCOPE_CONFIG);
1587  ‪$requireJsConfig['typo3BaseUrl'] = GeneralUtility::getIndpEnv('TYPO3_SITE_PATH') . '?eID=requirejs';
1588  // backend request, but no backend user logged in
1589  } elseif (!$backendUserLoggedIn) {
1590  $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
1591  ‪$requireJsConfig = $this->‪getRequireJsConfig(static::REQUIREJS_SCOPE_CONFIG);
1592  ‪$requireJsConfig['typo3BaseUrl'] = (string)$uriBuilder->buildUriFromRoute('ajax_core_requirejs');
1593  // backend request, having backend user logged in
1594  } else {
1595  ‪$requireJsConfig = array_replace_recursive(
1596  $this->publicRequireJsConfig,
1597  $this->requireJsConfig
1598  );
1599  }
1600 
1601  // add (probably filtered) RequireJS configuration
1602  $html .= GeneralUtility::wrapJS('var require = ' . json_encode(‪$requireJsConfig)) . LF;
1603  // directly after that, include the require.js file
1604  $html .= '<script src="'
1605  . $this->‪processJsFile($this->requireJsPath . 'require.js')
1606  . '" type="text/javascript"></script>' . LF;
1607 
1608  if (!empty(‪$requireJsConfig['typo3BaseUrl'])) {
1609  $html .= '<script src="'
1610  . $this->‪processJsFile(
1611  'EXT:core/Resources/Public/JavaScript/requirejs-loader.js'
1612  )
1613  . '" type="text/javascript"></script>' . LF;
1614  }
1615 
1616  return $html;
1617  }
1618 
1625  protected function ‪filterArrayKeys(array $array, array $keys, bool $keep = true): array
1626  {
1627  return array_filter(
1628  $array,
1629  function (string $key) use ($keys, $keep) {
1630  return in_array($key, $keys, true) === $keep;
1631  },
1632  ARRAY_FILTER_USE_KEY
1633  );
1634  }
1635 
1652  public function ‪loadRequireJsModule($mainModuleName, $callBackFunction = null)
1653  {
1654  $inlineCodeKey = $mainModuleName;
1655  // make sure requireJS is initialized
1656  $this->‪loadRequireJs();
1657  // move internal module path definition to public module definition
1658  // (since loading a module ends up disclosing the existence anyway)
1659  $baseModuleName = $this->‪findRequireJsBaseModuleName($mainModuleName);
1660  if ($baseModuleName !== null && isset($this->requireJsConfig['paths'][$baseModuleName])) {
1661  $this->publicRequireJsConfig['paths'][$baseModuleName] = $this->requireJsConfig['paths'][$baseModuleName];
1662  unset($this->requireJsConfig['paths'][$baseModuleName]);
1663  }
1664  // execute the main module, and load a possible callback function
1665  $javaScriptCode = 'require([' . GeneralUtility::quoteJSvalue($mainModuleName) . ']';
1666  if ($callBackFunction !== null) {
1667  $inlineCodeKey .= sha1($callBackFunction);
1668  $javaScriptCode .= ', ' . $callBackFunction;
1669  }
1670  $javaScriptCode .= ');';
1671  $this->‪addJsInlineCode('RequireJS-Module-' . $inlineCodeKey, $javaScriptCode);
1672  }
1673 
1680  protected function ‪findRequireJsBaseModuleName(string $moduleName)
1681  {
1682  // trim spaces and slashes & add ending slash
1683  $sanitizedModuleName = trim($moduleName, ' /') . '/';
1684  foreach ($this->internalRequireJsPathModuleNames as $sanitizedBaseModuleName => $baseModuleName) {
1685  if (strpos($sanitizedModuleName, $sanitizedBaseModuleName) === 0) {
1686  return $baseModuleName;
1687  }
1688  }
1689  return null;
1690  }
1691 
1699  public function ‪addInlineLanguageLabel($key, $value)
1700  {
1701  $this->inlineLanguageLabels[$key] = $value;
1702  }
1703 
1712  public function ‪addInlineLanguageLabelArray(array $array, $parseWithLanguageService = null)
1713  {
1714  if ($parseWithLanguageService === true) {
1715  trigger_error('PageRenderer::addInlineLanguageLabelArray() second method argument set to true will not be supported anymore in TYPO3 v10.0.', E_USER_DEPRECATED);
1716  foreach ($array as $key => $value) {
1717  if (TYPO3_MODE === 'FE') {
1718  $array[$key] = $this->‪getTypoScriptFrontendController()->‪sL($value);
1719  } else {
1720  $array[$key] = $this->‪getLanguageService()->sL($value);
1721  }
1722  }
1723  } elseif ($parseWithLanguageService !== null) {
1724  trigger_error('PageRenderer::addInlineLanguageLabelArray() does not need a second method argument anymore, and will be removed in TYPO3 v10.0.', E_USER_DEPRECATED);
1725  }
1726 
1727  $this->inlineLanguageLabels = array_merge($this->inlineLanguageLabels, $array);
1728  }
1729 
1737  public function ‪addInlineLanguageLabelFile($fileRef, $selectionPrefix = '', $stripFromSelectionName = '')
1738  {
1739  $index = md5($fileRef . $selectionPrefix . $stripFromSelectionName);
1740  if ($fileRef && !isset($this->inlineLanguageLabelFiles[$index])) {
1741  $this->inlineLanguageLabelFiles[$index] = [
1742  'fileRef' => $fileRef,
1743  'selectionPrefix' => $selectionPrefix,
1744  'stripFromSelectionName' => $stripFromSelectionName
1745  ];
1746  }
1747  }
1748 
1757  public function ‪addInlineSetting($namespace, $key, $value)
1758  {
1759  if ($namespace) {
1760  if (strpos($namespace, '.')) {
1761  $parts = explode('.', $namespace);
1763  foreach ($parts as $part) {
1764  $a = &$a[$part];
1765  }
1766  $a[$key] = $value;
1767  } else {
1768  $this->inlineSettings[$namespace][$key] = $value;
1769  }
1770  } else {
1771  $this->inlineSettings[$key] = $value;
1772  }
1773  }
1774 
1783  public function ‪addInlineSettingArray($namespace, array $array)
1784  {
1785  if ($namespace) {
1786  if (strpos($namespace, '.')) {
1787  $parts = explode('.', $namespace);
1789  foreach ($parts as $part) {
1790  $a = &$a[$part];
1791  }
1792  $a = array_merge((array)$a, $array);
1793  } else {
1794  $this->inlineSettings[$namespace] = array_merge((array)$this->inlineSettings[$namespace], $array);
1795  }
1796  } else {
1797  $this->inlineSettings = array_merge($this->inlineSettings, $array);
1798  }
1799  }
1800 
1806  public function ‪addBodyContent($content)
1807  {
1808  $this->bodyContent .= $content;
1809  }
1810 
1811  /*****************************************************/
1812  /* */
1813  /* Render Functions */
1814  /* */
1815  /*****************************************************/
1822  public function ‪render($part = self::PART_COMPLETE)
1823  {
1824  $this->‪prepareRendering();
1826  ‪$metaTags = implode(LF, array_merge($this->metaTags, $this->‪renderMetaTagsFromAPI()));
1828  $template = $this->‪getTemplateForPart($part);
1829 
1830  // The page renderer needs a full reset, even when only rendering one part of the page
1831  // This means that you can only register footer files *after* the header has been already rendered.
1832  // In case you render the footer part first, header files can only be added *after* the footer has been rendered
1833  $this->‪reset();
1834  $templateService = GeneralUtility::makeInstance(MarkerBasedTemplateService::class);
1835  return trim($templateService->substituteMarkerArray($template, $markerArray, '###|###'));
1836  }
1837 
1843  protected function ‪renderMetaTagsFromAPI()
1844  {
1845  ‪$metaTags = [];
1846  $metaTagManagers = $this->metaTagRegistry->getAllManagers();
1847 
1848  foreach ($metaTagManagers as $manager => $managerObject) {
1849  $properties = $managerObject->renderAllProperties();
1850  if (!empty($properties)) {
1851  ‪$metaTags[] = $properties;
1852  }
1853  }
1854  return ‪$metaTags;
1855  }
1856 
1864  public function ‪renderPageWithUncachedObjects($substituteHash)
1865  {
1866  $this->‪prepareRendering();
1867  $markerArray = $this->‪getPreparedMarkerArrayForPageWithUncachedObjects($substituteHash);
1868  $template = $this->‪getTemplateForPart(self::PART_COMPLETE);
1869  $templateService = GeneralUtility::makeInstance(MarkerBasedTemplateService::class);
1870  return trim($templateService->substituteMarkerArray($template, $markerArray, '###|###'));
1871  }
1882  public function ‪renderJavaScriptAndCssForProcessingOfUncachedContentObjects($cachedPageContent, $substituteHash)
1883  {
1884  $this->‪prepareRendering();
1886  ‪$title = $this->title ? str_replace('|', htmlspecialchars($this->title), $this->titleTag) : '';
1887  $markerArray = [
1888  '<!-- ###TITLE' . $substituteHash . '### -->' => ‪$title,
1889  '<!-- ###CSS_LIBS' . $substituteHash . '### -->' => ‪$cssLibs,
1890  '<!-- ###CSS_INCLUDE' . $substituteHash . '### -->' => ‪$cssFiles,
1891  '<!-- ###CSS_INLINE' . $substituteHash . '### -->' => ‪$cssInline,
1892  '<!-- ###JS_INLINE' . $substituteHash . '### -->' => ‪$jsInline,
1893  '<!-- ###JS_INCLUDE' . $substituteHash . '### -->' => ‪$jsFiles,
1894  '<!-- ###JS_LIBS' . $substituteHash . '### -->' => ‪$jsLibs,
1895  '<!-- ###META' . $substituteHash . '### -->' => implode(LF, array_merge($this->metaTags, $this->‪renderMetaTagsFromAPI())),
1896  '<!-- ###HEADERDATA' . $substituteHash . '### -->' => implode(LF, $this->headerData),
1897  '<!-- ###FOOTERDATA' . $substituteHash . '### -->' => implode(LF, $this->footerData),
1898  '<!-- ###JS_LIBS_FOOTER' . $substituteHash . '### -->' => ‪$jsFooterLibs,
1899  '<!-- ###JS_INCLUDE_FOOTER' . $substituteHash . '### -->' => ‪$jsFooterFiles,
1900  '<!-- ###JS_INLINE_FOOTER' . $substituteHash . '### -->' => ‪$jsFooterInline
1901  ];
1902  foreach ($markerArray as $placeHolder => $content) {
1903  $cachedPageContent = str_replace($placeHolder, $content, $cachedPageContent);
1904  }
1905  $this->‪reset();
1906  return $cachedPageContent;
1907  }
1908 
1914  protected function ‪prepareRendering()
1915  {
1916  if ($this->‪getRenderXhtml()) {
1917  $this->endingSlash = ' /';
1918  } else {
1919  $this->metaCharsetTag = str_replace(' />', '>', $this->metaCharsetTag);
1920  $this->baseUrlTag = str_replace(' />', '>', $this->baseUrlTag);
1921  $this->shortcutTag = str_replace(' />', '>', $this->shortcutTag);
1922  $this->endingSlash = '';
1923  }
1924  }
1925 
1931  protected function ‪renderJavaScriptAndCss()
1932  {
1933  $this->‪executePreRenderHook();
1934  $mainJsLibs = $this->‪renderMainJavaScriptLibraries();
1935  if ($this->concatenateFiles || $this->concatenateJavascript || $this->concatenateCss) {
1936  // Do the file concatenation
1937  $this->‪doConcatenate();
1938  }
1939  if ($this->compressCss || $this->compressJavascript) {
1940  // Do the file compression
1941  $this->‪doCompress();
1942  }
1945  ‪$cssFiles = $this->‪renderCssFiles();
1946  ‪$cssInline = $this->‪renderCssInline();
1950  ‪$jsLibs = $mainJsLibs . ‪$jsLibs;
1951  if ($this->moveJsFromHeaderToFooter) {
1953  ‪$jsLibs = '';
1955  ‪$jsFiles = '';
1957  ‪$jsInline = '';
1958  }
1961  }
1962 
1979  {
1980  $markerArray = [
1981  'XMLPROLOG_DOCTYPE' => ‪$this->xmlPrologAndDocType,
1982  'HTMLTAG' => ‪$this->htmlTag,
1983  'HEADTAG' => ‪$this->headTag,
1984  'METACHARSET' => $this->charSet ? str_replace('|', htmlspecialchars($this->charSet), $this->metaCharsetTag) : '',
1985  'INLINECOMMENT' => $this->inlineComments ? LF . LF . '<!-- ' . LF . implode(LF, $this->inlineComments) . '-->' . LF . LF : '',
1986  'BASEURL' => $this->baseUrl ? str_replace('|', $this->baseUrl, $this->baseUrlTag) : '',
1987  'SHORTCUT' => $this->favIcon ? sprintf($this->shortcutTag, htmlspecialchars($this->favIcon), $this->iconMimeType) : '',
1988  'CSS_LIBS' => ‪$cssLibs,
1989  'CSS_INCLUDE' => ‪$cssFiles,
1990  'CSS_INLINE' => ‪$cssInline,
1991  'JS_INLINE' => ‪$jsInline,
1992  'JS_INCLUDE' => ‪$jsFiles,
1993  'JS_LIBS' => ‪$jsLibs,
1994  'TITLE' => $this->title ? str_replace('|', htmlspecialchars($this->title), $this->titleTag) : '',
1995  'META' => ‪$metaTags,
1996  'HEADERDATA' => $this->headerData ? implode(LF, $this->headerData) : '',
1997  'FOOTERDATA' => $this->footerData ? implode(LF, $this->footerData) : '',
1998  'JS_LIBS_FOOTER' => ‪$jsFooterLibs,
1999  'JS_INCLUDE_FOOTER' => ‪$jsFooterFiles,
2000  'JS_INLINE_FOOTER' => ‪$jsFooterInline,
2001  'BODY' => $this->bodyContent
2002  ];
2003  $markerArray = array_map('trim', $markerArray);
2004  return $markerArray;
2005  }
2006 
2013  protected function ‪getPreparedMarkerArrayForPageWithUncachedObjects($substituteHash)
2014  {
2015  $markerArray = [
2016  'XMLPROLOG_DOCTYPE' => ‪$this->xmlPrologAndDocType,
2017  'HTMLTAG' => ‪$this->htmlTag,
2018  'HEADTAG' => ‪$this->headTag,
2019  'METACHARSET' => $this->charSet ? str_replace('|', htmlspecialchars($this->charSet), $this->metaCharsetTag) : '',
2020  'INLINECOMMENT' => $this->inlineComments ? LF . LF . '<!-- ' . LF . implode(LF, $this->inlineComments) . '-->' . LF . LF : '',
2021  'BASEURL' => $this->baseUrl ? str_replace('|', $this->baseUrl, $this->baseUrlTag) : '',
2022  'SHORTCUT' => $this->favIcon ? sprintf($this->shortcutTag, htmlspecialchars($this->favIcon), $this->iconMimeType) : '',
2023  'META' => '<!-- ###META' . $substituteHash . '### -->',
2024  'BODY' => ‪$this->bodyContent,
2025  'TITLE' => '<!-- ###TITLE' . $substituteHash . '### -->',
2026  'CSS_LIBS' => '<!-- ###CSS_LIBS' . $substituteHash . '### -->',
2027  'CSS_INCLUDE' => '<!-- ###CSS_INCLUDE' . $substituteHash . '### -->',
2028  'CSS_INLINE' => '<!-- ###CSS_INLINE' . $substituteHash . '### -->',
2029  'JS_INLINE' => '<!-- ###JS_INLINE' . $substituteHash . '### -->',
2030  'JS_INCLUDE' => '<!-- ###JS_INCLUDE' . $substituteHash . '### -->',
2031  'JS_LIBS' => '<!-- ###JS_LIBS' . $substituteHash . '### -->',
2032  'HEADERDATA' => '<!-- ###HEADERDATA' . $substituteHash . '### -->',
2033  'FOOTERDATA' => '<!-- ###FOOTERDATA' . $substituteHash . '### -->',
2034  'JS_LIBS_FOOTER' => '<!-- ###JS_LIBS_FOOTER' . $substituteHash . '### -->',
2035  'JS_INCLUDE_FOOTER' => '<!-- ###JS_INCLUDE_FOOTER' . $substituteHash . '### -->',
2036  'JS_INLINE_FOOTER' => '<!-- ###JS_INLINE_FOOTER' . $substituteHash . '### -->'
2037  ];
2038  $markerArray = array_map('trim', $markerArray);
2039  return $markerArray;
2040  }
2041 
2048  protected function ‪getTemplateForPart($part)
2049  {
2050  ‪$templateFile = GeneralUtility::getFileAbsFileName($this->templateFile);
2051  if (is_file(‪$templateFile)) {
2052  $template = file_get_contents(‪$templateFile);
2053  if ($this->removeLineBreaksFromTemplate) {
2054  $template = strtr($template, [LF => '', CR => '']);
2055  }
2056  if ($part !== self::PART_COMPLETE) {
2057  $templatePart = explode('###BODY###', $template);
2058  $template = $templatePart[$part - 1];
2059  }
2060  } else {
2061  $template = '';
2062  }
2063  return $template;
2064  }
2065 
2072  protected function ‪renderMainJavaScriptLibraries()
2073  {
2074  $out = '';
2075 
2076  // Include RequireJS
2077  if ($this->addRequireJs) {
2078  $out .= $this->‪getRequireJsLoader();
2079  }
2080 
2081  // Include jQuery Core for each namespace, depending on the version and source
2082  if (!empty($this->jQueryVersions)) {
2083  foreach ($this->jQueryVersions as $namespace => $jQueryVersion) {
2084  $out .= $this->‪renderJqueryScriptTag($jQueryVersion['version'], $jQueryVersion['source'], $namespace);
2085  }
2086  }
2087 
2089  if (TYPO3_MODE === 'BE') {
2090  $noBackendUserLoggedIn = empty(‪$GLOBALS['BE_USER']->user['uid']);
2091  $this->‪addAjaxUrlsToInlineSettings($noBackendUserLoggedIn);
2092  }
2093  ‪$inlineSettings = '';
2094  $languageLabels = $this->‪parseLanguageLabelsForJavaScript();
2095  if (!empty($languageLabels)) {
2096  ‪$inlineSettings .= 'TYPO3.lang = ' . json_encode($languageLabels) . ';';
2097  }
2098  ‪$inlineSettings .= $this->inlineSettings ? 'TYPO3.settings = ' . json_encode($this->inlineSettings) . ';' : '';
2099 
2100  if (‪$inlineSettings !== '') {
2101  // make sure the global TYPO3 is available
2102  ‪$inlineSettings = 'var TYPO3 = TYPO3 || {};' . CRLF . ‪$inlineSettings;
2103  $out .= $this->inlineJavascriptWrap[0] . ‪$inlineSettings . $this->inlineJavascriptWrap[1];
2104  }
2105 
2106  return $out;
2107  }
2108 
2114  protected function ‪parseLanguageLabelsForJavaScript(): array
2115  {
2116  if (empty($this->inlineLanguageLabels)) {
2117  return [];
2118  }
2119 
2120  $labels = [];
2121  foreach ($this->inlineLanguageLabels as $key => $translationUnit) {
2122  if (is_array($translationUnit)) {
2123  $translationUnit = current($translationUnit);
2124  $labels[$key] = $translationUnit['target'] ?? $translationUnit['source'];
2125  } else {
2126  $labels[$key] = $translationUnit;
2127  }
2128  }
2129 
2130  return $labels;
2131  }
2132 
2136  protected function ‪loadJavaScriptLanguageStrings()
2137  {
2138  if (!empty($this->inlineLanguageLabelFiles)) {
2139  foreach ($this->inlineLanguageLabelFiles as $languageLabelFile) {
2140  $this->‪includeLanguageFileForInline($languageLabelFile['fileRef'], $languageLabelFile['selectionPrefix'], $languageLabelFile['stripFromSelectionName']);
2141  }
2142  }
2143  $this->inlineLanguageLabelFiles = [];
2144  // Convert settings back to UTF-8 since json_encode() only works with UTF-8:
2145  if ($this->‪getCharSet() && $this->‪getCharSet() !== 'utf-8' && is_array($this->inlineSettings)) {
2146  $this->‪convertCharsetRecursivelyToUtf8($this->inlineSettings, $this->‪getCharSet());
2147  }
2148  }
2149 
2156  protected function ‪convertCharsetRecursivelyToUtf8(&$data, string $fromCharset)
2157  {
2158  foreach ($data as $key => $value) {
2159  if (is_array($data[$key])) {
2160  $this->‪convertCharsetRecursivelyToUtf8($data[$key], $fromCharset);
2161  } elseif (is_string($data[$key])) {
2162  $data[$key] = mb_convert_encoding($data[$key], 'utf-8', $fromCharset);
2163  }
2164  }
2165  }
2166 
2172  protected function ‪addAjaxUrlsToInlineSettings(bool $publicRoutesOnly = false)
2173  {
2174  $ajaxUrls = [];
2175  // Add the ajax-based routes
2177  $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
2179  $router = GeneralUtility::makeInstance(Router::class);
2180  $routes = $router->getRoutes();
2181  foreach ($routes as $routeIdentifier => $route) {
2182  if ($publicRoutesOnly && $route->getOption('access') !== 'public') {
2183  continue;
2184  }
2185  if ($route->getOption('ajax')) {
2186  $uri = (string)$uriBuilder->buildUriFromRoute($routeIdentifier);
2187  // use the shortened value in order to use this in JavaScript
2188  $routeIdentifier = str_replace('ajax_', '', $routeIdentifier);
2189  $ajaxUrls[$routeIdentifier] = $uri;
2190  }
2191  }
2192 
2193  $this->inlineSettings['ajaxUrls'] = $ajaxUrls;
2194  }
2195 
2204  protected function ‪renderJqueryScriptTag($version, $source, $namespace)
2205  {
2206  switch (true) {
2207  case isset($this->jQueryCdnUrls[$source]):
2208  if ($this->enableJqueryDebug) {
2209  $minifyPart = '';
2210  } else {
2211  $minifyPart = '.min';
2212  }
2213  $jQueryFileName = sprintf($this->jQueryCdnUrls[$source], $version, $minifyPart);
2214  break;
2215  case $source === 'local':
2216  $jQueryFileName = $this->jQueryPath . 'jquery';
2217  if ($this->enableJqueryDebug) {
2218  $jQueryFileName .= '.js';
2219  } else {
2220  $jQueryFileName .= '.min.js';
2221  }
2222  $jQueryFileName = $this->‪processJsFile($jQueryFileName);
2223  break;
2224  default:
2225  $jQueryFileName = $source;
2226  }
2227  $scriptTag = '<script src="' . htmlspecialchars($jQueryFileName) . '" type="text/javascript"></script>' . LF;
2228  // Set the noConflict mode to be globally available via "jQuery"
2229  if ($namespace !== self::JQUERY_NAMESPACE_NONE) {
2230  $scriptTag .= GeneralUtility::wrapJS('jQuery.noConflict();') . LF;
2231  }
2232  return $scriptTag;
2233  }
2234 
2240  protected function ‪renderCssLibraries()
2241  {
2242  ‪$cssFiles = '';
2243  if (!empty($this->cssLibs)) {
2244  foreach ($this->cssLibs as $file => $properties) {
2245  $tag = $this->‪createCssTag($properties, $file);
2246  if ($properties['forceOnTop']) {
2247  ‪$cssFiles = $tag . ‪$cssFiles;
2248  } else {
2249  ‪$cssFiles .= $tag;
2250  }
2251  }
2252  }
2253  return ‪$cssFiles;
2254  }
2255 
2261  protected function ‪renderCssFiles()
2262  {
2263  ‪$cssFiles = '';
2264  if (!empty($this->cssFiles)) {
2265  foreach ($this->cssFiles as $file => $properties) {
2266  $tag = $this->‪createCssTag($properties, $file);
2267  if ($properties['forceOnTop']) {
2268  ‪$cssFiles = $tag . ‪$cssFiles;
2269  } else {
2270  ‪$cssFiles .= $tag;
2271  }
2272  }
2273  }
2274  return ‪$cssFiles;
2275  }
2276 
2284  private function ‪createCssTag(array $properties, string $file): string
2285  {
2286  if ($properties['inline'] && @is_file($file)) {
2287  $tag = $this->‪createInlineCssTagFromFile($file, $properties);
2288  } else {
2289  $href = $this->‪getStreamlinedFileName($file);
2290  $tag = '<link rel="' . htmlspecialchars($properties['rel'])
2291  . '" type="text/css" href="' . htmlspecialchars($href)
2292  . '" media="' . htmlspecialchars($properties['media']) . '"'
2293  . ($properties['title'] ? ' title="' . htmlspecialchars($properties['title']) . '"' : '')
2294  . $this->endingSlash . '>';
2295  }
2296  if ($properties['allWrap']) {
2297  $wrapArr = explode($properties['splitChar'] ?: '|', $properties['allWrap'], 2);
2298  $tag = $wrapArr[0] . $tag . $wrapArr[1];
2299  }
2300  $tag .= LF;
2301 
2302  return $tag;
2303  }
2304 
2310  protected function ‪renderCssInline()
2311  {
2312  ‪$cssInline = '';
2313  if (!empty($this->cssInline)) {
2314  foreach ($this->cssInline as $name => $properties) {
2315  $cssCode = '/*' . htmlspecialchars($name) . '*/' . LF . $properties['code'] . LF;
2316  if ($properties['forceOnTop']) {
2318  } else {
2319  ‪$cssInline .= $cssCode;
2320  }
2321  }
2322  ‪$cssInline = $this->inlineCssWrap[0] . ‪$cssInline . $this->inlineCssWrap[1];
2323  }
2324  return ‪$cssInline;
2325  }
2326 
2332  protected function ‪renderAdditionalJavaScriptLibraries()
2333  {
2334  ‪$jsLibs = '';
2335  ‪$jsFooterLibs = '';
2336  if (!empty($this->jsLibs)) {
2337  foreach ($this->jsLibs as $properties) {
2338  $properties['file'] = $this->‪getStreamlinedFileName($properties['file']);
2339  $async = $properties['async'] ? ' async="async"' : '';
2340  $defer = $properties['defer'] ? ' defer="defer"' : '';
2341  $integrity = $properties['integrity'] ? ' integrity="' . htmlspecialchars($properties['integrity']) . '"' : '';
2342  $crossorigin = $properties['crossorigin'] ? ' crossorigin="' . htmlspecialchars($properties['crossorigin']) . '"' : '';
2343  $tag = '<script src="' . htmlspecialchars($properties['file']) . '" type="' . htmlspecialchars($properties['type']) . '"' . $async . $defer . $integrity . $crossorigin . '></script>';
2344  if ($properties['allWrap']) {
2345  $wrapArr = explode($properties['splitChar'] ?: '|', $properties['allWrap'], 2);
2346  $tag = $wrapArr[0] . $tag . $wrapArr[1];
2347  }
2348  $tag .= LF;
2349  if ($properties['forceOnTop']) {
2350  if ($properties['section'] === self::PART_HEADER) {
2351  ‪$jsLibs = $tag . ‪$jsLibs;
2352  } else {
2354  }
2355  } else {
2356  if ($properties['section'] === self::PART_HEADER) {
2357  ‪$jsLibs .= $tag;
2358  } else {
2359  ‪$jsFooterLibs .= $tag;
2360  }
2361  }
2362  }
2363  }
2364  if ($this->moveJsFromHeaderToFooter) {
2366  ‪$jsLibs = '';
2367  }
2368  return [‪$jsLibs, ‪$jsFooterLibs];
2369  }
2370 
2376  protected function ‪renderJavaScriptFiles()
2377  {
2378  ‪$jsFiles = '';
2379  ‪$jsFooterFiles = '';
2380  if (!empty($this->jsFiles)) {
2381  foreach ($this->jsFiles as $file => $properties) {
2382  $file = $this->‪getStreamlinedFileName($file);
2383  $async = $properties['async'] ? ' async="async"' : '';
2384  $defer = $properties['defer'] ? ' defer="defer"' : '';
2385  $integrity = $properties['integrity'] ? ' integrity="' . htmlspecialchars($properties['integrity']) . '"' : '';
2386  $crossorigin = $properties['crossorigin'] ? ' crossorigin="' . htmlspecialchars($properties['crossorigin']) . '"' : '';
2387  $tag = '<script src="' . htmlspecialchars($file) . '" type="' . htmlspecialchars($properties['type']) . '"' . $async . $defer . $integrity . $crossorigin . '></script>';
2388  if ($properties['allWrap']) {
2389  $wrapArr = explode($properties['splitChar'] ?: '|', $properties['allWrap'], 2);
2390  $tag = $wrapArr[0] . $tag . $wrapArr[1];
2391  }
2392  $tag .= LF;
2393  if ($properties['forceOnTop']) {
2394  if ($properties['section'] === self::PART_HEADER) {
2395  ‪$jsFiles = $tag . ‪$jsFiles;
2396  } else {
2398  }
2399  } else {
2400  if ($properties['section'] === self::PART_HEADER) {
2401  ‪$jsFiles .= $tag;
2402  } else {
2403  ‪$jsFooterFiles .= $tag;
2404  }
2405  }
2406  }
2407  }
2408  if ($this->moveJsFromHeaderToFooter) {
2410  ‪$jsFiles = '';
2411  }
2412  return [‪$jsFiles, ‪$jsFooterFiles];
2413  }
2414 
2420  protected function ‪renderInlineJavaScript()
2421  {
2422  ‪$jsInline = '';
2423  ‪$jsFooterInline = '';
2424  if (!empty($this->jsInline)) {
2425  foreach ($this->jsInline as $name => $properties) {
2426  $jsCode = '/*' . htmlspecialchars($name) . '*/' . LF . $properties['code'] . LF;
2427  if ($properties['forceOnTop']) {
2428  if ($properties['section'] === self::PART_HEADER) {
2429  ‪$jsInline = $jsCode . ‪$jsInline;
2430  } else {
2432  }
2433  } else {
2434  if ($properties['section'] === self::PART_HEADER) {
2435  ‪$jsInline .= $jsCode;
2436  } else {
2438  }
2439  }
2440  }
2441  }
2442  if (‪$jsInline) {
2443  ‪$jsInline = $this->inlineJavascriptWrap[0] . ‪$jsInline . $this->inlineJavascriptWrap[1];
2444  }
2445  if (‪$jsFooterInline) {
2446  ‪$jsFooterInline = $this->inlineJavascriptWrap[0] . ‪$jsFooterInline . $this->inlineJavascriptWrap[1];
2447  }
2448  if ($this->moveJsFromHeaderToFooter) {
2450  ‪$jsInline = '';
2451  }
2452  return [‪$jsInline, ‪$jsFooterInline];
2453  }
2454 
2463  protected function ‪includeLanguageFileForInline($fileRef, $selectionPrefix = '', $stripFromSelectionName = '')
2464  {
2465  if (!isset($this->lang) || !isset($this->charSet)) {
2466  throw new \RuntimeException('Language and character encoding are not set.', 1284906026);
2467  }
2468  $labelsFromFile = [];
2469  $allLabels = $this->‪readLLfile($fileRef);
2470  if ($allLabels !== false) {
2471  // Merge language specific translations:
2472  if ($this->lang !== 'default' && isset($allLabels[$this->lang])) {
2473  $labels = array_merge($allLabels['default'], $allLabels[$this->lang]);
2474  } else {
2475  $labels = $allLabels['default'];
2476  }
2477  // Iterate through all locallang labels:
2478  foreach ($labels as $label => $value) {
2479  // If $selectionPrefix is set, only respect labels that start with $selectionPrefix
2480  if ($selectionPrefix === '' || strpos($label, $selectionPrefix) === 0) {
2481  // Remove substring $stripFromSelectionName from label
2482  $label = str_replace($stripFromSelectionName, '', $label);
2483  $labelsFromFile[$label] = $value;
2484  }
2485  }
2486  $this->inlineLanguageLabels = array_merge($this->inlineLanguageLabels, $labelsFromFile);
2487  }
2488  }
2489 
2496  protected function ‪readLLfile($fileRef)
2497  {
2499  $languageFactory = GeneralUtility::makeInstance(LocalizationFactory::class);
2500 
2501  if ($this->lang !== 'default') {
2502  $languages = array_reverse($this->languageDependencies);
2503  // At least we need to have English
2504  if (empty($languages)) {
2505  $languages[] = 'default';
2506  }
2507  } else {
2508  $languages = ['default'];
2509  }
2510 
2511  $localLanguage = [];
2512  foreach ($languages as $language) {
2513  $tempLL = $languageFactory->getParsedData($fileRef, $language);
2514 
2515  $localLanguage['default'] = $tempLL['default'];
2516  if (!isset($localLanguage[$this->lang])) {
2517  $localLanguage[‪$this->lang] = $localLanguage['default'];
2518  }
2519  if ($this->lang !== 'default' && isset($tempLL[$language])) {
2520  // Merge current language labels onto labels from previous language
2521  // This way we have a labels with fall back applied
2522  ‪\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($localLanguage[$this->lang], $tempLL[$language], true, false);
2523  }
2524  }
2525 
2526  return $localLanguage;
2527  }
2528 
2529  /*****************************************************/
2530  /* */
2531  /* Tools */
2532  /* */
2533  /*****************************************************/
2538  protected function ‪doConcatenate()
2539  {
2540  $this->‪doConcatenateCss();
2541  $this->‪doConcatenateJavaScript();
2542  }
2543 
2547  protected function ‪doConcatenateJavaScript()
2548  {
2549  if ($this->concatenateFiles || $this->concatenateJavascript) {
2550  if (!empty(‪$GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['jsConcatenateHandler'])) {
2551  // use external concatenation routine
2552  $params = [
2553  'jsLibs' => &‪$this->jsLibs,
2554  'jsFiles' => &‪$this->jsFiles,
2555  'jsFooterFiles' => &‪$this->jsFooterFiles,
2556  'headerData' => &‪$this->headerData,
2557  'footerData' => &‪$this->footerData
2558  ];
2559  GeneralUtility::callUserFunction(‪$GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['jsConcatenateHandler'], $params, $this);
2560  } else {
2561  $this->jsLibs = $this->‪getCompressor()->concatenateJsFiles($this->jsLibs);
2562  $this->jsFiles = $this->‪getCompressor()->concatenateJsFiles($this->jsFiles);
2563  $this->jsFooterFiles = $this->‪getCompressor()->concatenateJsFiles($this->jsFooterFiles);
2564  }
2565  }
2566  }
2567 
2571  protected function ‪doConcatenateCss()
2572  {
2573  if ($this->concatenateFiles || $this->concatenateCss) {
2574  if (!empty(‪$GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['cssConcatenateHandler'])) {
2575  // use external concatenation routine
2576  $params = [
2577  'cssFiles' => &‪$this->cssFiles,
2578  'cssLibs' => &‪$this->cssLibs,
2579  'headerData' => &‪$this->headerData,
2580  'footerData' => &‪$this->footerData
2581  ];
2582  GeneralUtility::callUserFunction(‪$GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['cssConcatenateHandler'], $params, $this);
2583  } else {
2584  $cssOptions = [];
2585  if (TYPO3_MODE === 'BE') {
2586  $cssOptions = ['baseDirectories' => ‪$GLOBALS['TBE_TEMPLATE']->getSkinStylesheetDirectories()];
2587  }
2588  $this->cssLibs = $this->‪getCompressor()->concatenateCssFiles($this->cssLibs, $cssOptions);
2589  $this->cssFiles = $this->‪getCompressor()->concatenateCssFiles($this->cssFiles, $cssOptions);
2590  }
2591  }
2592  }
2593 
2597  protected function ‪doCompress()
2598  {
2599  $this->‪doCompressJavaScript();
2600  $this->‪doCompressCss();
2601  }
2602 
2606  protected function ‪doCompressCss()
2607  {
2608  if ($this->compressCss) {
2609  if (!empty(‪$GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['cssCompressHandler'])) {
2610  // Use external compression routine
2611  $params = [
2612  'cssInline' => &‪$this->cssInline,
2613  'cssFiles' => &‪$this->cssFiles,
2614  'cssLibs' => &‪$this->cssLibs,
2615  'headerData' => &‪$this->headerData,
2616  'footerData' => &‪$this->footerData
2617  ];
2618  GeneralUtility::callUserFunction(‪$GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['cssCompressHandler'], $params, $this);
2619  } else {
2620  $this->cssLibs = $this->‪getCompressor()->compressCssFiles($this->cssLibs);
2621  $this->cssFiles = $this->‪getCompressor()->compressCssFiles($this->cssFiles);
2622  }
2623  }
2624  }
2625 
2629  protected function ‪doCompressJavaScript()
2630  {
2631  if ($this->compressJavascript) {
2632  if (!empty(‪$GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['jsCompressHandler'])) {
2633  // Use external compression routine
2634  $params = [
2635  'jsInline' => &‪$this->jsInline,
2636  'jsFooterInline' => &‪$this->jsFooterInline,
2637  'jsLibs' => &‪$this->jsLibs,
2638  'jsFiles' => &‪$this->jsFiles,
2639  'jsFooterFiles' => &‪$this->jsFooterFiles,
2640  'headerData' => &‪$this->headerData,
2641  'footerData' => &‪$this->footerData
2642  ];
2643  GeneralUtility::callUserFunction(‪$GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['jsCompressHandler'], $params, $this);
2644  } else {
2645  // Traverse the arrays, compress files
2646  if (!empty($this->jsInline)) {
2647  foreach ($this->jsInline as $name => $properties) {
2648  if ($properties['compress']) {
2649  $error = '';
2650  $this->jsInline[$name]['code'] = GeneralUtility::minifyJavaScript($properties['code'], $error);
2651  if ($error) {
2652  $this->compressError .= 'Error with minify JS Inline Block "' . $name . '": ' . $error . LF;
2653  }
2654  }
2655  }
2656  }
2657  $this->jsLibs = $this->‪getCompressor()->compressJsFiles($this->jsLibs);
2658  $this->jsFiles = $this->‪getCompressor()->compressJsFiles($this->jsFiles);
2659  $this->jsFooterFiles = $this->‪getCompressor()->compressJsFiles($this->jsFooterFiles);
2660  }
2661  }
2662  }
2663 
2669  protected function ‪getCompressor()
2670  {
2671  if ($this->compressor === null) {
2672  $this->compressor = GeneralUtility::makeInstance(\‪TYPO3\CMS\Core\Resource\ResourceCompressor::class);
2673  }
2674  return ‪$this->compressor;
2675  }
2676 
2685  protected function ‪processJsFile($filename)
2686  {
2687  $filename = $this->‪getStreamlinedFileName($filename, false);
2688  if ($this->compressJavascript) {
2689  $filename = $this->‪getCompressor()->compressJsFile($filename);
2690  } elseif (TYPO3_MODE === 'FE') {
2691  $filename = GeneralUtility::createVersionNumberedFilename($filename);
2692  }
2693  return $this->‪getAbsoluteWebPath($filename);
2694  }
2695 
2708  protected function ‪getStreamlinedFileName($file, $prepareForOutput = true)
2709  {
2710  if (strpos($file, 'EXT:') === 0) {
2711  $file = GeneralUtility::getFileAbsFileName($file);
2712  // as the path is now absolute, make it "relative" to the current script to stay compatible
2713  $file = ‪PathUtility::getRelativePathTo($file);
2714  $file = rtrim($file, '/');
2715  } else {
2716  $file = GeneralUtility::resolveBackPath($file);
2717  }
2718  if ($prepareForOutput) {
2719  $file = GeneralUtility::createVersionNumberedFilename($file);
2720  $file = $this->‪getAbsoluteWebPath($file);
2721  }
2722  return $file;
2723  }
2724 
2734  protected function ‪getAbsoluteWebPath(string $file): string
2735  {
2736  if (TYPO3_MODE === 'FE') {
2737  return $file;
2738  }
2739  return ‪PathUtility::getAbsoluteWebPath($file);
2740  }
2741 
2747  protected function ‪getTypoScriptFrontendController()
2748  {
2749  return ‪$GLOBALS['TSFE'];
2750  }
2751 
2757  protected function ‪getLanguageService()
2758  {
2759  return ‪$GLOBALS['LANG'];
2760  }
2761 
2762  /*****************************************************/
2763  /* */
2764  /* Hooks */
2765  /* */
2766  /*****************************************************/
2770  protected function ‪executePreRenderHook()
2771  {
2772  $hooks = ‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-preProcess'] ?? false;
2773  if (!$hooks) {
2774  return;
2775  }
2776  $params = [
2777  'jsLibs' => &‪$this->jsLibs,
2778  'jsFooterLibs' => &‪$this->jsFooterLibs,
2779  'jsFiles' => &‪$this->jsFiles,
2780  'jsFooterFiles' => &‪$this->jsFooterFiles,
2781  'cssLibs' => &‪$this->cssLibs,
2782  'cssFiles' => &‪$this->cssFiles,
2783  'headerData' => &‪$this->headerData,
2784  'footerData' => &‪$this->footerData,
2785  'jsInline' => &‪$this->jsInline,
2786  'jsFooterInline' => &‪$this->jsFooterInline,
2787  'cssInline' => &‪$this->cssInline
2788  ];
2789  foreach ($hooks as $hook) {
2790  GeneralUtility::callUserFunction($hook, $params, $this);
2791  }
2792  }
2793 
2797  protected function ‪executeRenderPostTransformHook()
2798  {
2799  $hooks = ‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-postTransform'] ?? false;
2800  if (!$hooks) {
2801  return;
2802  }
2803  $params = [
2804  'jsLibs' => &‪$this->jsLibs,
2805  'jsFooterLibs' => &‪$this->jsFooterLibs,
2806  'jsFiles' => &‪$this->jsFiles,
2807  'jsFooterFiles' => &‪$this->jsFooterFiles,
2808  'cssLibs' => &‪$this->cssLibs,
2809  'cssFiles' => &‪$this->cssFiles,
2810  'headerData' => &‪$this->headerData,
2811  'footerData' => &‪$this->footerData,
2812  'jsInline' => &‪$this->jsInline,
2813  'jsFooterInline' => &‪$this->jsFooterInline,
2814  'cssInline' => &‪$this->cssInline
2815  ];
2816  foreach ($hooks as $hook) {
2817  GeneralUtility::callUserFunction($hook, $params, $this);
2818  }
2819  }
2820 
2835  {
2836  $hooks = ‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-postProcess'] ?? false;
2837  if (!$hooks) {
2838  return;
2839  }
2840  $params = [
2841  'jsLibs' => &‪$jsLibs,
2842  'jsFiles' => &‪$jsFiles,
2843  'jsFooterFiles' => &‪$jsFooterFiles,
2844  'cssLibs' => &‪$cssLibs,
2845  'cssFiles' => &‪$cssFiles,
2846  'headerData' => &‪$this->headerData,
2847  'footerData' => &‪$this->footerData,
2848  'jsInline' => &‪$jsInline,
2849  'cssInline' => &‪$cssInline,
2850  'xmlPrologAndDocType' => &‪$this->xmlPrologAndDocType,
2851  'htmlTag' => &‪$this->htmlTag,
2852  'headTag' => &‪$this->headTag,
2853  'charSet' => &‪$this->charSet,
2854  'metaCharsetTag' => &‪$this->metaCharsetTag,
2855  'shortcutTag' => &‪$this->shortcutTag,
2856  'inlineComments' => &‪$this->inlineComments,
2857  'baseUrl' => &‪$this->baseUrl,
2858  'baseUrlTag' => &‪$this->baseUrlTag,
2859  'favIcon' => &‪$this->favIcon,
2860  'iconMimeType' => &‪$this->iconMimeType,
2861  'titleTag' => &‪$this->titleTag,
2862  'title' => &‪$this->title,
2863  'metaTags' => &‪$this->metaTags,
2864  'jsFooterInline' => &‪$jsFooterInline,
2865  'jsFooterLibs' => &‪$jsFooterLibs,
2866  'bodyContent' => &‪$this->bodyContent
2867  ];
2868  foreach ($hooks as $hook) {
2869  GeneralUtility::callUserFunction($hook, $params, $this);
2870  }
2871  }
2872 
2880  protected function ‪createInlineCssTagFromFile(string $file, array $properties): string
2881  {
2882  ‪$cssInline = file_get_contents($file);
2883 
2884  return '<style type="text/css"'
2885  . ' media="' . htmlspecialchars($properties['media']) . '"'
2886  . ($properties['title'] ? ' title="' . htmlspecialchars($properties['title']) . '"' : '')
2887  . '>' . LF
2888  . '/*<![CDATA[*/' . LF . '<!-- ' . LF
2889  . ‪$cssInline
2890  . '-->' . LF . '/*]]>*/' . LF . '</style>' . LF;
2891  }
2892 }
‪TYPO3\CMS\Core\Page\PageRenderer\JQUERY_VERSION_LATEST
‪const JQUERY_VERSION_LATEST
Definition: PageRenderer.php:42
‪TYPO3\CMS\Core\Page\PageRenderer\disableCompressJavascript
‪disableCompressJavascript()
Definition: PageRenderer.php:619
‪TYPO3\CMS\Core\Page\PageRenderer\$inlineLanguageLabels
‪array $inlineLanguageLabels
Definition: PageRenderer.php:304
‪TYPO3\CMS\Core\Page\PageRenderer\getRequireJsLoader
‪string getRequireJsLoader()
Definition: PageRenderer.php:1519
‪TYPO3\CMS\Core\Page\PageRenderer\addInlineLanguageLabelFile
‪addInlineLanguageLabelFile($fileRef, $selectionPrefix='', $stripFromSelectionName='')
Definition: PageRenderer.php:1678
‪TYPO3\CMS\Core\Page\PageRenderer\renderCssInline
‪string renderCssInline()
Definition: PageRenderer.php:2251
‪TYPO3\CMS\Core\Page\PageRenderer\disableConcatenateFiles
‪disableConcatenateFiles()
Definition: PageRenderer.php:654
‪TYPO3\CMS\Core\Page\PageRenderer\$locales
‪TYPO3 CMS Core Localization Locales $locales
Definition: PageRenderer.php:81
‪TYPO3\CMS\Core\Page\PageRenderer\enableConcatenateJavascript
‪enableConcatenateJavascript()
Definition: PageRenderer.php:663
‪TYPO3\CMS\Core\Page\PageRenderer\renderJavaScriptAndCssForProcessingOfUncachedContentObjects
‪string renderJavaScriptAndCssForProcessingOfUncachedContentObjects($cachedPageContent, $substituteHash)
Definition: PageRenderer.php:1823
‪TYPO3\CMS\Core\Utility\PathUtility
Definition: PathUtility.php:23
‪TYPO3\CMS\Core\Page\PageRenderer\$cssFiles
‪array $cssFiles
Definition: PageRenderer.php:120
‪TYPO3\CMS\Core\Page\PageRenderer\setFavIcon
‪setFavIcon($favIcon)
Definition: PageRenderer.php:503
‪TYPO3\CMS\Core\Page\PageRenderer\loadJavaScriptLanguageStrings
‪loadJavaScriptLanguageStrings()
Definition: PageRenderer.php:2077
‪TYPO3\CMS\Core\Page\PageRenderer\filterArrayKeys
‪array filterArrayKeys(array $array, array $keys, bool $keep=true)
Definition: PageRenderer.php:1566
‪TYPO3\CMS\Core\Page\PageRenderer\addMetaTag
‪addMetaTag($meta)
Definition: PageRenderer.php:951
‪TYPO3\CMS\Core\Page\PageRenderer\$headTag
‪string $headTag
Definition: PageRenderer.php:185
‪TYPO3\CMS\Core\Page\PageRenderer\addRequireJsConfiguration
‪addRequireJsConfiguration(array $configuration)
Definition: PageRenderer.php:1504
‪TYPO3\CMS\Core\Page\PageRenderer\$jsInline
‪array $jsInline
Definition: PageRenderer.php:202
‪TYPO3\CMS\Core\Page\PageRenderer\renderJavaScriptAndCss
‪array< string > renderJavaScriptAndCss()
Definition: PageRenderer.php:1872
‪TYPO3\CMS\Core\Page\PageRenderer\enableCompressJavascript
‪enableCompressJavascript()
Definition: PageRenderer.php:611
‪TYPO3\CMS\Core\Page\PageRenderer\renderInlineJavaScript
‪array< string > renderInlineJavaScript()
Definition: PageRenderer.php:2361
‪TYPO3\CMS\Core\Page\PageRenderer\doCompressCss
‪doCompressCss()
Definition: PageRenderer.php:2547
‪TYPO3\CMS\Core\Page\PageRenderer\__wakeup
‪__wakeup()
Definition: PageRenderer.php:369
‪TYPO3\CMS\Core\Page\PageRenderer\getConcatenateCss
‪bool getConcatenateCss()
Definition: PageRenderer.php:895
‪TYPO3\CMS\Core\Page\PageRenderer\$requireJsPath
‪string $requireJsPath
Definition: PageRenderer.php:229
‪TYPO3\CMS\Core\Page\PageRenderer\getIconMimeType
‪string getIconMimeType()
Definition: PageRenderer.php:813
‪TYPO3\CMS\Core\Page\PageRenderer\renderMainJavaScriptLibraries
‪string renderMainJavaScriptLibraries()
Definition: PageRenderer.php:2013
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\sL
‪string sL($input)
Definition: TypoScriptFrontendController.php:4530
‪TYPO3\CMS\Core\Page\PageRenderer\renderAdditionalJavaScriptLibraries
‪array< string > renderAdditionalJavaScriptLibraries()
Definition: PageRenderer.php:2273
‪TYPO3\CMS\Core\Page\PageRenderer\$templateFile
‪string $templateFile
Definition: PageRenderer.php:222
‪TYPO3\CMS\Core\Localization\LocalizationFactory
Definition: LocalizationFactory.php:25
‪TYPO3\CMS\Core\Page\PageRenderer\$removeLineBreaksFromTemplate
‪bool $removeLineBreaksFromTemplate
Definition: PageRenderer.php:60
‪TYPO3\CMS\Core\Page\PageRenderer\$title
‪string $title
Definition: PageRenderer.php:130
‪TYPO3\CMS\Core\Page\PageRenderer\getTemplateFile
‪string getTemplateFile()
Definition: PageRenderer.php:833
‪TYPO3
‪TYPO3\CMS\Core\Page\PageRenderer\loadRequireJs
‪loadRequireJs()
Definition: PageRenderer.php:1382
‪TYPO3\CMS\Core\Page\PageRenderer\$compressError
‪string $compressError
Definition: PageRenderer.php:326
‪TYPO3\CMS\Core\Page\PageRenderer\renderCssFiles
‪string renderCssFiles()
Definition: PageRenderer.php:2202
‪TYPO3\CMS\Core\Page\PageRenderer\enableConcatenateCss
‪enableConcatenateCss()
Definition: PageRenderer.php:679
‪TYPO3\CMS\Core\Page\PageRenderer\$concatenateCss
‪bool $concatenateCss
Definition: PageRenderer.php:73
‪TYPO3\CMS\Core\Page\PageRenderer\$metaTagRegistry
‪MetaTagManagerRegistry $metaTagRegistry
Definition: PageRenderer.php:336
‪TYPO3\CMS\Core\Page\PageRenderer\renderJqueryScriptTag
‪string renderJqueryScriptTag($version, $source, $namespace)
Definition: PageRenderer.php:2145
‪TYPO3\CMS\Core\Page\PageRenderer\getFavIcon
‪string getFavIcon()
Definition: PageRenderer.php:803
‪TYPO3\CMS\Core\Page\PageRenderer\addCssInlineBlock
‪addCssInlineBlock($name, $block, $compress=false, $forceOnTop=false)
Definition: PageRenderer.php:1330
‪TYPO3\CMS\Core\Page\PageRenderer\$bodyContent
‪string $bodyContent
Definition: PageRenderer.php:218
‪TYPO3\CMS\Core\Page\PageRenderer\PART_COMPLETE
‪const PART_COMPLETE
Definition: PageRenderer.php:37
‪TYPO3\CMS\Core\MetaTag\MetaTagManagerRegistry
Definition: MetaTagManagerRegistry.php:27
‪TYPO3\CMS\Core\Page\PageRenderer\setHeadTag
‪setHeadTag($headTag)
Definition: PageRenderer.php:493
‪TYPO3\CMS\Core\Page
Definition: PageRenderer.php:2
‪TYPO3\CMS\Core\Page\PageRenderer\$inlineComments
‪array $inlineComments
Definition: PageRenderer.php:161
‪TYPO3\CMS\Core\Page\PageRenderer\doConcatenate
‪doConcatenate()
Definition: PageRenderer.php:2479
‪TYPO3\CMS\Core\Page\PageRenderer\getInlineLanguageLabelFiles
‪array getInlineLanguageLabelFiles()
Definition: PageRenderer.php:935
‪TYPO3\CMS\Core\Page\PageRenderer\$favIcon
‪string $favIcon
Definition: PageRenderer.php:140
‪TYPO3\CMS\Core\Page\PageRenderer\addJsLibrary
‪addJsLibrary($name, $file, $type='text/javascript', $compress=false, $forceOnTop=false, $allWrap='', $excludeFromConcatenation=false, $splitChar='|', $async=false, $integrity='', $defer=false, $crossorigin='')
Definition: PageRenderer.php:1079
‪TYPO3\CMS\Core\Utility\ArrayUtility\mergeRecursiveWithOverrule
‪static mergeRecursiveWithOverrule(array &$original, array $overrule, $addKeys=true, $includeEmptyValues=true, $enableUnsetFeature=true)
Definition: ArrayUtility.php:614
‪TYPO3\CMS\Core\Page\PageRenderer\getMetaTag
‪array getMetaTag(string $type, string $name)
Definition: PageRenderer.php:992
‪TYPO3\CMS\Core\Page\PageRenderer\$requireJsConfig
‪array $requireJsConfig
Definition: PageRenderer.php:286
‪TYPO3\CMS\Core\Page\PageRenderer\$jsFooterLibs
‪array $jsFooterLibs
Definition: PageRenderer.php:116
‪TYPO3\CMS\Core\Page\PageRenderer\$jsFiles
‪array $jsFiles
Definition: PageRenderer.php:104
‪TYPO3\CMS\Core\Page\PageRenderer\getBodyContent
‪string getBodyContent()
Definition: PageRenderer.php:915
‪TYPO3\CMS\Core\Page\PageRenderer\disableConcatenateJavascript
‪disableConcatenateJavascript()
Definition: PageRenderer.php:671
‪TYPO3\CMS\Core\Page\PageRenderer\renderJavaScriptFiles
‪array< string > renderJavaScriptFiles()
Definition: PageRenderer.php:2317
‪TYPO3\CMS\Core\Page\PageRenderer\doCompress
‪doCompress()
Definition: PageRenderer.php:2538
‪TYPO3\CMS\Core\Page\PageRenderer\__construct
‪__construct($templateFile='')
Definition: PageRenderer.php:345
‪TYPO3\CMS\Core\Page\PageRenderer\getHtmlTag
‪string getHtmlTag()
Definition: PageRenderer.php:773
‪TYPO3\CMS\Core\Page\PageRenderer\$compressJavascript
‪bool $compressJavascript
Definition: PageRenderer.php:52
‪TYPO3\CMS\Core\Page\PageRenderer\loadRequireJsModule
‪loadRequireJsModule($mainModuleName, $callBackFunction=null)
Definition: PageRenderer.php:1593
‪TYPO3\CMS\Core\Page\PageRenderer\getPreparedMarkerArrayForPageWithUncachedObjects
‪array getPreparedMarkerArrayForPageWithUncachedObjects($substituteHash)
Definition: PageRenderer.php:1954
‪TYPO3\CMS\Core\Page\PageRenderer\getMetaCharsetTag
‪string getMetaCharsetTag()
Definition: PageRenderer.php:783
‪TYPO3\CMS\Core\Page\PageRenderer\renderPageWithUncachedObjects
‪string renderPageWithUncachedObjects($substituteHash)
Definition: PageRenderer.php:1805
‪TYPO3\CMS\Core\Page\PageRenderer\setXmlPrologAndDocType
‪setXmlPrologAndDocType($xmlPrologAndDocType)
Definition: PageRenderer.php:434
‪TYPO3\CMS\Core\Page\PageRenderer\$inlineJavascriptWrap
‪array $inlineJavascriptWrap
Definition: PageRenderer.php:316
‪TYPO3\CMS\Core\Page\PageRenderer\disableMoveJsFromHeaderToFooter
‪disableMoveJsFromHeaderToFooter()
Definition: PageRenderer.php:603
‪TYPO3\CMS\Core\Page\PageRenderer\addInlineSettingArray
‪addInlineSettingArray($namespace, array $array)
Definition: PageRenderer.php:1724
‪TYPO3\CMS\Core\Utility\PathUtility\getRelativePathTo
‪static string null getRelativePathTo($targetPath)
Definition: PathUtility.php:31
‪TYPO3\CMS\Core\Page\PageRenderer\renderCssLibraries
‪string renderCssLibraries()
Definition: PageRenderer.php:2181
‪TYPO3\CMS\Core\Page\PageRenderer\addInlineLanguageLabel
‪addInlineLanguageLabel($key, $value)
Definition: PageRenderer.php:1640
‪TYPO3\CMS\Core\Page\PageRenderer\setHtmlTag
‪setHtmlTag($htmlTag)
Definition: PageRenderer.php:483
‪TYPO3\CMS\Core\Page\PageRenderer\$inlineCssWrap
‪array $inlineCssWrap
Definition: PageRenderer.php:320
‪TYPO3\CMS\Core\Page\PageRenderer\executePreRenderHook
‪executePreRenderHook()
Definition: PageRenderer.php:2711
‪TYPO3\CMS\Core\Page\PageRenderer\getRenderXhtml
‪bool getRenderXhtml()
Definition: PageRenderer.php:763
‪TYPO3\CMS\Core\Page\PageRenderer\setBodyContent
‪setBodyContent($content)
Definition: PageRenderer.php:543
‪TYPO3\CMS\Core\Page\PageRenderer\$jQueryVersions
‪array $jQueryVersions
Definition: PageRenderer.php:256
‪TYPO3\CMS\Core\Page\PageRenderer
Definition: PageRenderer.php:35
‪TYPO3\CMS\Core\Page\PageRenderer\addCssFile
‪addCssFile($file, $rel='stylesheet', $media='all', $title='', $compress=true, $forceOnTop=false, $allWrap='', $excludeFromConcatenation=false, $splitChar='|', $inline=false)
Definition: PageRenderer.php:1272
‪TYPO3\CMS\Core\Page\PageRenderer\REQUIREJS_SCOPE_RESOLVE
‪const REQUIREJS_SCOPE_RESOLVE
Definition: PageRenderer.php:48
‪TYPO3\CMS\Core\Page\PageRenderer\$htmlTag
‪string $htmlTag
Definition: PageRenderer.php:181
‪TYPO3\CMS\Core\Page\PageRenderer\getCompressCss
‪bool getCompressCss()
Definition: PageRenderer.php:863
‪TYPO3\CMS\Core\Page\PageRenderer\$extOnReadyCode
‪array $extOnReadyCode
Definition: PageRenderer.php:210
‪TYPO3\CMS\Core\Page\PageRenderer\doCompressJavaScript
‪doCompressJavaScript()
Definition: PageRenderer.php:2570
‪TYPO3\CMS\Core\Page\PageRenderer\$baseUrlTag
‪string $baseUrlTag
Definition: PageRenderer.php:189
‪TYPO3\CMS\Core\Core\Environment\getProjectPath
‪static string getProjectPath()
Definition: Environment.php:142
‪TYPO3\CMS\Core\Page\PageRenderer\addJsFooterLibrary
‪addJsFooterLibrary($name, $file, $type='text/javascript', $compress=false, $forceOnTop=false, $allWrap='', $excludeFromConcatenation=false, $splitChar='|', $async=false, $integrity='', $defer=false, $crossorigin='')
Definition: PageRenderer.php:1118
‪TYPO3\CMS\Core\Page\PageRenderer\$jsFooterInline
‪array $jsFooterInline
Definition: PageRenderer.php:206
‪TYPO3\CMS\Core\Cache\Frontend\FrontendInterface\get
‪mixed get($entryIdentifier)
‪TYPO3\CMS\Core\Page\PageRenderer\setMetaCharsetTag
‪setMetaCharsetTag($metaCharsetTag)
Definition: PageRenderer.php:473
‪TYPO3\CMS\Core\Page\PageRenderer\$metaCharsetTag
‪string $metaCharsetTag
Definition: PageRenderer.php:177
‪TYPO3\CMS\Core\Page\PageRenderer\getTypoScriptFrontendController
‪TypoScriptFrontendController getTypoScriptFrontendController()
Definition: PageRenderer.php:2688
‪TYPO3\CMS\Core\Page\PageRenderer\$concatenateJavascript
‪bool $concatenateJavascript
Definition: PageRenderer.php:69
‪TYPO3\CMS\Core\Page\PageRenderer\getTitle
‪string getTitle()
Definition: PageRenderer.php:733
‪TYPO3\CMS\Core\Page\PageRenderer\setBaseUrl
‪setBaseUrl($baseUrl)
Definition: PageRenderer.php:523
‪TYPO3\CMS\Core\Page\PageRenderer\addCssLibrary
‪addCssLibrary($file, $rel='stylesheet', $media='all', $title='', $compress=true, $forceOnTop=false, $allWrap='', $excludeFromConcatenation=false, $splitChar='|', $inline=false)
Definition: PageRenderer.php:1304
‪TYPO3\CMS\Core\Page\PageRenderer\$endingSlash
‪string $endingSlash
Definition: PageRenderer.php:332
‪TYPO3\CMS\Backend\Routing\UriBuilder
Definition: UriBuilder.php:35
‪TYPO3\CMS\Core\Page\PageRenderer\REQUIREJS_SCOPE_CONFIG
‪const REQUIREJS_SCOPE_CONFIG
Definition: PageRenderer.php:47
‪TYPO3\CMS\Core\Page\PageRenderer\PART_FOOTER
‪const PART_FOOTER
Definition: PageRenderer.php:39
‪TYPO3\CMS\Core\Page\PageRenderer\getCharSet
‪string getCharSet()
Definition: PageRenderer.php:743
‪TYPO3\CMS\Core\Page\PageRenderer\render
‪string render($part=self::PART_COMPLETE)
Definition: PageRenderer.php:1763
‪TYPO3\CMS\Core\Page\PageRenderer\getConcatenateFiles
‪bool getConcatenateFiles()
Definition: PageRenderer.php:874
‪TYPO3\CMS\Core\Page\PageRenderer\setTitle
‪setTitle($title)
Definition: PageRenderer.php:414
‪TYPO3\CMS\Core\Page\PageRenderer\$compressor
‪TYPO3 CMS Core Resource ResourceCompressor $compressor
Definition: PageRenderer.php:99
‪TYPO3\CMS\Core\Page\PageRenderer\getInlineLanguageLabels
‪array getInlineLanguageLabels()
Definition: PageRenderer.php:925
‪TYPO3\CMS\Core\Page\PageRenderer\$xmlPrologAndDocType
‪string $xmlPrologAndDocType
Definition: PageRenderer.php:153
‪TYPO3\CMS\Core\Page\PageRenderer\$compressCss
‪bool $compressCss
Definition: PageRenderer.php:56
‪TYPO3\CMS\Core\Page\PageRenderer\setCache
‪static setCache(FrontendInterface $cache)
Definition: PageRenderer.php:377
‪TYPO3\CMS\Core\Page\PageRenderer\getStreamlinedFileName
‪string getStreamlinedFileName($file, $prepareForOutput=true)
Definition: PageRenderer.php:2649
‪TYPO3\CMS\Core\Cache\CacheManager
Definition: CacheManager.php:34
‪TYPO3\CMS\Core\Page\PageRenderer\$jsFooterFiles
‪array $jsFooterFiles
Definition: PageRenderer.php:108
‪TYPO3\CMS\Core\Page\PageRenderer\setLanguage
‪setLanguage($lang)
Definition: PageRenderer.php:454
‪TYPO3\CMS\Core\Page\PageRenderer\$enableJqueryDebug
‪bool $enableJqueryDebug
Definition: PageRenderer.php:300
‪TYPO3\CMS\Core\Page\PageRenderer\addInlineLanguageLabelArray
‪addInlineLanguageLabelArray(array $array, $parseWithLanguageService=null)
Definition: PageRenderer.php:1653
‪TYPO3\CMS\Core\Page\PageRenderer\$jQueryCdnUrls
‪array $jQueryCdnUrls
Definition: PageRenderer.php:271
‪TYPO3\CMS\Core\Page\PageRenderer\addInlineComment
‪addInlineComment($comment)
Definition: PageRenderer.php:1032
‪TYPO3\CMS\Core\Page\PageRenderer\setRequireJsPath
‪setRequireJsPath($path)
Definition: PageRenderer.php:553
‪TYPO3\CMS\Core\Page\PageRenderer\$titleTag
‪string $titleTag
Definition: PageRenderer.php:173
‪TYPO3\CMS\Core\Page\PageRenderer\$shortcutTag
‪string $shortcutTag
Definition: PageRenderer.php:197
‪TYPO3\CMS\Core\Page\PageRenderer\doConcatenateJavaScript
‪doConcatenateJavaScript()
Definition: PageRenderer.php:2488
‪TYPO3\CMS\Core\Page\PageRenderer\executePostRenderHook
‪executePostRenderHook(&$jsLibs, &$jsFiles, &$jsFooterFiles, &$cssLibs, &$cssFiles, &$jsInline, &$cssInline, &$jsFooterInline, &$jsFooterLibs)
Definition: PageRenderer.php:2775
‪TYPO3\CMS\Core\Page\PageRenderer\addJsFooterInlineCode
‪addJsFooterInlineCode($name, $block, $compress=true, $forceOnTop=false)
Definition: PageRenderer.php:1246
‪TYPO3\CMS\Core\Page\PageRenderer\enableMoveJsFromHeaderToFooter
‪enableMoveJsFromHeaderToFooter()
Definition: PageRenderer.php:595
‪TYPO3\CMS\Core\Page\PageRenderer\processJsFile
‪string processJsFile($filename)
Definition: PageRenderer.php:2626
‪TYPO3\CMS\Core\Page\PageRenderer\JQUERY_NAMESPACE_NONE
‪const JQUERY_NAMESPACE_NONE
Definition: PageRenderer.php:45
‪TYPO3\CMS\Core\Page\PageRenderer\getPreparedMarkerArray
‪array getPreparedMarkerArray($jsLibs, $jsFiles, $jsFooterFiles, $cssLibs, $cssFiles, $jsInline, $cssInline, $jsFooterInline, $jsFooterLibs, $metaTags)
Definition: PageRenderer.php:1919
‪TYPO3\CMS\Core\Page\PageRenderer\setIconMimeType
‪setIconMimeType($iconMimeType)
Definition: PageRenderer.php:513
‪TYPO3\CMS\Core\Page\PageRenderer\getLanguage
‪string getLanguage()
Definition: PageRenderer.php:753
‪TYPO3\CMS\Core\Page\PageRenderer\getCompressor
‪TYPO3 CMS Core Resource ResourceCompressor getCompressor()
Definition: PageRenderer.php:2610
‪TYPO3\CMS\Core\Page\PageRenderer\addHeaderData
‪addHeaderData($data)
Definition: PageRenderer.php:1044
‪TYPO3\CMS\Core\Page\PageRenderer\addJsFooterFile
‪addJsFooterFile($file, $type='text/javascript', $compress=true, $forceOnTop=false, $allWrap='', $excludeFromConcatenation=false, $splitChar='|', $async=false, $integrity='', $defer=false, $crossorigin='')
Definition: PageRenderer.php:1195
‪TYPO3\CMS\Core\Page\PageRenderer\$renderXhtml
‪bool $renderXhtml
Definition: PageRenderer.php:148
‪TYPO3\CMS\Core\Cache\Frontend\FrontendInterface
Definition: FrontendInterface.php:21
‪TYPO3\CMS\Core\Page\PageRenderer\$inlineSettings
‪array $inlineSettings
Definition: PageRenderer.php:312
‪TYPO3\CMS\Core\Page\PageRenderer\$cssInline
‪array $cssInline
Definition: PageRenderer.php:214
‪TYPO3\CMS\Core\Page\PageRenderer\renderMetaTagsFromAPI
‪array renderMetaTagsFromAPI()
Definition: PageRenderer.php:1784
‪TYPO3\CMS\Core\Page\PageRenderer\$jsLibs
‪array $jsLibs
Definition: PageRenderer.php:112
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
Definition: TypoScriptFrontendController.php:97
‪TYPO3\CMS\Core\Page\PageRenderer\includeLanguageFileForInline
‪includeLanguageFileForInline($fileRef, $selectionPrefix='', $stripFromSelectionName='')
Definition: PageRenderer.php:2404
‪TYPO3\CMS\Core\Page\PageRenderer\$charSet
‪string $charSet
Definition: PageRenderer.php:136
‪TYPO3\CMS\Core\Page\PageRenderer\getRemoveLineBreaksFromTemplate
‪bool getRemoveLineBreaksFromTemplate()
Definition: PageRenderer.php:905
‪TYPO3\CMS\Core\SingletonInterface
Definition: SingletonInterface.php:22
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Core\Page\PageRenderer\convertCharsetRecursivelyToUtf8
‪convertCharsetRecursivelyToUtf8(&$data, string $fromCharset)
Definition: PageRenderer.php:2097
‪TYPO3\CMS\Core\Page\PageRenderer\$jQueryPath
‪string $jQueryPath
Definition: PageRenderer.php:236
‪TYPO3\CMS\Core\Page\PageRenderer\$cssLibs
‪array $cssLibs
Definition: PageRenderer.php:124
‪TYPO3\CMS\Core\Page\PageRenderer\getHeadTag
‪string getHeadTag()
Definition: PageRenderer.php:793
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:39
‪TYPO3\CMS\Core\Page\PageRenderer\$lang
‪string $lang
Definition: PageRenderer.php:88
‪TYPO3\CMS\Core\Page\PageRenderer\setCharSet
‪setCharSet($charSet)
Definition: PageRenderer.php:444
‪TYPO3\CMS\Core\Page\PageRenderer\getLanguageService
‪TYPO3 CMS Core Localization LanguageService getLanguageService()
Definition: PageRenderer.php:2698
‪TYPO3\CMS\Core\Page\PageRenderer\enableCompressCss
‪enableCompressCss()
Definition: PageRenderer.php:627
‪TYPO3\CMS\Core\Page\PageRenderer\doConcatenateCss
‪doConcatenateCss()
Definition: PageRenderer.php:2512
‪TYPO3\CMS\Core\Page\PageRenderer\disableRemoveLineBreaksFromTemplate
‪disableRemoveLineBreaksFromTemplate()
Definition: PageRenderer.php:703
‪TYPO3\CMS\Core\Page\PageRenderer\$languageDependencies
‪array $languageDependencies
Definition: PageRenderer.php:95
‪TYPO3\CMS\Core\Page\PageRenderer\addFooterData
‪addFooterData($data)
Definition: PageRenderer.php:1056
‪TYPO3\CMS\Core\Page\PageRenderer\addInlineSetting
‪addInlineSetting($namespace, $key, $value)
Definition: PageRenderer.php:1698
‪TYPO3\CMS\Core\Page\PageRenderer\$addRequireJs
‪bool $addRequireJs
Definition: PageRenderer.php:281
‪TYPO3\CMS\Core\Page\PageRenderer\removeMetaTag
‪removeMetaTag(string $type, string $name)
Definition: PageRenderer.php:1017
‪TYPO3\CMS\Core\Page\PageRenderer\enableConcatenateFiles
‪enableConcatenateFiles()
Definition: PageRenderer.php:644
‪TYPO3\CMS\Core\Page\PageRenderer\executeRenderPostTransformHook
‪executeRenderPostTransformHook()
Definition: PageRenderer.php:2738
‪TYPO3\CMS\Core\Page\PageRenderer\$metaTags
‪array $metaTags
Definition: PageRenderer.php:157
‪TYPO3\CMS\Core\Page\PageRenderer\getBaseUrl
‪string getBaseUrl()
Definition: PageRenderer.php:823
‪TYPO3\CMS\Core\Page\PageRenderer\parseLanguageLabelsForJavaScript
‪array parseLanguageLabelsForJavaScript()
Definition: PageRenderer.php:2055
‪TYPO3\CMS\Core\Page\PageRenderer\prepareRendering
‪prepareRendering()
Definition: PageRenderer.php:1855
‪TYPO3\CMS\Core\Page\PageRenderer\$publicRequireJsConfig
‪array $publicRequireJsConfig
Definition: PageRenderer.php:296
‪TYPO3\CMS\Core\Page\PageRenderer\$iconMimeType
‪string $iconMimeType
Definition: PageRenderer.php:193
‪TYPO3\CMS\Core\Page\PageRenderer\getRequireJsConfig
‪array getRequireJsConfig(string $scope=null)
Definition: PageRenderer.php:562
‪TYPO3\CMS\Core\Page\PageRenderer\$baseUrl
‪string $baseUrl
Definition: PageRenderer.php:144
‪TYPO3\CMS\Core\Page\PageRenderer\readLLfile
‪array readLLfile($fileRef)
Definition: PageRenderer.php:2437
‪TYPO3\CMS\Core\Page\PageRenderer\loadJquery
‪loadJquery($version=null, $source=null, $namespace=self::JQUERY_NAMESPACE_NONE, bool $isCoreCall=false)
Definition: PageRenderer.php:1351
‪TYPO3\CMS\Core\Page\PageRenderer\$concatenateFiles
‪bool $concatenateFiles
Definition: PageRenderer.php:65
‪TYPO3\CMS\Core\Page\PageRenderer\disableCompressCss
‪disableCompressCss()
Definition: PageRenderer.php:635
‪TYPO3\CMS\Core\Page\PageRenderer\setRenderXhtml
‪setRenderXhtml($enable)
Definition: PageRenderer.php:424
‪TYPO3\CMS\Core\Cache\Frontend\FrontendInterface\set
‪set($entryIdentifier, $data, array $tags=[], $lifetime=null)
‪TYPO3\CMS\Core\Page\PageRenderer\setTemplateFile
‪setTemplateFile($file)
Definition: PageRenderer.php:533
‪TYPO3\CMS\Core\Page\PageRenderer\enableRemoveLineBreaksFromTemplate
‪enableRemoveLineBreaksFromTemplate()
Definition: PageRenderer.php:695
‪TYPO3\CMS\Core\Page\PageRenderer\addBodyContent
‪addBodyContent($content)
Definition: PageRenderer.php:1747
‪TYPO3\CMS\Core\Service\MarkerBasedTemplateService
Definition: MarkerBasedTemplateService.php:25
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Core\Page\PageRenderer\findRequireJsBaseModuleName
‪string null findRequireJsBaseModuleName(string $moduleName)
Definition: PageRenderer.php:1621
‪TYPO3\CMS\Core\Page\PageRenderer\$headerData
‪array $headerData
Definition: PageRenderer.php:165
‪TYPO3\CMS\Core\Utility\PathUtility\getAbsoluteWebPath
‪static string getAbsoluteWebPath($targetPath)
Definition: PathUtility.php:42
‪TYPO3\CMS\Core\Page\PageRenderer\getCompressJavascript
‪bool getCompressJavascript()
Definition: PageRenderer.php:853
‪TYPO3\CMS\Core\Page\PageRenderer\setMetaTag
‪setMetaTag(string $type, string $name, string $content, array $subProperties=[], $replace=true)
Definition: PageRenderer.php:969
‪TYPO3\CMS\Core\Page\PageRenderer\disableConcatenateCss
‪disableConcatenateCss()
Definition: PageRenderer.php:687
‪TYPO3\CMS\Core\Page\PageRenderer\$internalRequireJsPathModuleNames
‪array $internalRequireJsPathModuleNames
Definition: PageRenderer.php:291
‪TYPO3\CMS\Core\Page\PageRenderer\enableDebugMode
‪enableDebugMode()
Definition: PageRenderer.php:712
‪TYPO3\CMS\Backend\Routing\Router
Definition: Router.php:32
‪TYPO3\CMS\Core\Page\PageRenderer\addAjaxUrlsToInlineSettings
‪addAjaxUrlsToInlineSettings(bool $publicRoutesOnly=false)
Definition: PageRenderer.php:2113
‪TYPO3\CMS\Core\Page\PageRenderer\PART_HEADER
‪const PART_HEADER
Definition: PageRenderer.php:38
‪TYPO3\CMS\Core\Page\PageRenderer\reset
‪reset()
Definition: PageRenderer.php:385
‪TYPO3\CMS\Core\Page\PageRenderer\addJsInlineCode
‪addJsInlineCode($name, $block, $compress=true, $forceOnTop=false)
Definition: PageRenderer.php:1226
‪TYPO3\CMS\Core\Page\PageRenderer\$availableLocalJqueryVersions
‪array $availableLocalJqueryVersions
Definition: PageRenderer.php:263
‪TYPO3\CMS\Core\Page\PageRenderer\$cache
‪static FrontendInterface $cache
Definition: PageRenderer.php:340
‪TYPO3\CMS\Core\Page\PageRenderer\$inlineLanguageLabelFiles
‪array $inlineLanguageLabelFiles
Definition: PageRenderer.php:308
‪TYPO3\CMS\Core\Page\PageRenderer\computeRequireJsConfig
‪array computeRequireJsConfig($isDevelopment, array $packages)
Definition: PageRenderer.php:1415
‪TYPO3\CMS\Core\Page\PageRenderer\addJsFile
‪addJsFile($file, $type='text/javascript', $compress=true, $forceOnTop=false, $allWrap='', $excludeFromConcatenation=false, $splitChar='|', $async=false, $integrity='', $defer=false, $crossorigin='')
Definition: PageRenderer.php:1157
‪TYPO3\CMS\Core\Page\PageRenderer\getMoveJsFromHeaderToFooter
‪bool getMoveJsFromHeaderToFooter()
Definition: PageRenderer.php:843
‪TYPO3\CMS\Core\Page\PageRenderer\getAbsoluteWebPath
‪string getAbsoluteWebPath(string $file)
Definition: PageRenderer.php:2675
‪TYPO3\CMS\Core\Page\PageRenderer\$footerData
‪array $footerData
Definition: PageRenderer.php:169
‪TYPO3\CMS\Core\Page\PageRenderer\getConcatenateJavascript
‪bool getConcatenateJavascript()
Definition: PageRenderer.php:885
‪TYPO3\CMS\Core\Page\PageRenderer\createInlineCssTagFromFile
‪string createInlineCssTagFromFile(string $file, array $properties)
Definition: PageRenderer.php:2821
‪TYPO3\CMS\Core\Page\PageRenderer\getTemplateForPart
‪string getTemplateForPart($part)
Definition: PageRenderer.php:1989
‪TYPO3\CMS\Core\Page\PageRenderer\createCssTag
‪string createCssTag(array $properties, string $file)
Definition: PageRenderer.php:2225
‪TYPO3\CMS\Core\Page\PageRenderer\$moveJsFromHeaderToFooter
‪bool $moveJsFromHeaderToFooter
Definition: PageRenderer.php:77