129 'insertContent' =>
'CONTENT',
130 'insertContent.' => array(
131 'table' =>
'tt_content',
133 'orderBy' =>
'sorting',
134 'where' =>
'colPos=0',
135 'languageField' =>
'sys_language_uid' 140 'extTarget' =>
'_top',
141 'uniqueLinkVars' => 1
155 '_clear' =>
'<img src="clear.gif" width="1" height="1" alt="" />',
156 '_blackBorderWrap' =>
'<table border="0" bgcolor="black" cellspacing="0" cellpadding="1"><tr><td> | </td></tr></table>',
157 '_tableWrap' =>
'<table border="0" cellspacing="0" cellpadding="0"> | </table>',
158 '_tableWrap_DEBUG' =>
'<table border="1" cellspacing="0" cellpadding="0"> | </table>',
159 '_stdFrameParams' =>
'frameborder="no" marginheight="0" marginwidth="0" noresize="noresize"',
160 '_stdFramesetParams' =>
'border="0" framespacing="0" frameborder="no"' 353 $this->whereClause =
'AND deleted=0 ';
354 if (!
$GLOBALS[
'TSFE']->showHiddenRecords) {
355 $this->whereClause .=
'AND hidden=0 ';
359 $this->simulationHiddenOrTime = 1;
361 $this->whereClause .=
'AND (starttime<=' .
$GLOBALS[
'SIM_ACCESS_TIME'] .
') AND (endtime=0 OR endtime>' .
$GLOBALS[
'SIM_ACCESS_TIME'] .
')';
363 $this->allowedPaths = array(
365 $GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'fileadminDir'],
369 TYPO3_mainDir .
'ext/',
370 TYPO3_mainDir .
'sysext/',
371 TYPO3_mainDir .
'contrib/',
374 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'FE'][
'addAllowedPaths']) {
376 foreach ($pathArr as $p) {
378 $this->allowedPaths[] = $p;
410 public function matching($cc) {
411 if (is_array($cc[
'all'])) {
414 $matchObj->setRootline((array) $cc[
'rootLine']);
415 foreach ($cc[
'all'] as $key => $pre) {
416 if ($matchObj->match($pre)) {
435 public function start($theRootLine) {
436 if (is_array($theRootLine)) {
448 if (serialize($this->rowSum) !== serialize($cc[
'rowSum'])) {
452 if (serialize($this->rootLine) === serialize($cc[
'rootLine'])) {
456 unset($cc[
'rootLine']);
465 $cc = $this->matching($cc);
468 $hash = md5(serialize($cc));
471 $rowSumHash = md5(
'ROWSUM:' . serialize($this->rowSum));
477 $cc = $this->matching($cc);
479 $hash = md5(serialize($cc));
486 if (is_array($setupData) && !$this->forceTemplateParsing) {
488 $this->setup = $setupData;
489 if ($this->tt_track) {
490 $GLOBALS[
'TT']->setTSLogMessage(
'Using cached TS template data');
493 if ($this->tt_track) {
494 $GLOBALS[
'TT']->setTSLogMessage(
'Not using any cached TS data');
498 $this->generateConfig();
505 $cc = $this->matching($cc);
507 $hash = md5(serialize($cc));
510 if ($this->tt_track) {
511 $GLOBALS[
'TT']->setTSlogMessage(
'TS template size, serialized: ' . strlen(serialize($this->setup)) .
' bytes');
513 $rowSumHash = md5(
'ROWSUM:' . serialize($this->rowSum));
523 if (!$isCached && !$this->simulationHiddenOrTime && !
$GLOBALS[
'TSFE']->no_cache) {
528 $pageSectionCache->set((
int)
$GLOBALS[
'TSFE']->
id .
'_' . $mpvarHash, $cc, array(
529 'pageId_' . (
int)
$GLOBALS[
'TSFE']->
id,
530 'mpvarHash_' . $mpvarHash
534 if ($this->rootId && $this->rootLine && $this->setup) {
557 $this->constants = array();
558 $this->config = array();
559 $this->rowSum = array();
560 $this->hierarchyInfoToRoot = array();
561 $this->absoluteRootLine = $theRootLine;
562 $this->isDefaultTyposcriptAdded = FALSE;
564 reset($this->absoluteRootLine);
565 $c = count($this->absoluteRootLine);
566 for ($a = 0; $a < $c; $a++) {
568 if ($this->nextLevel) {
569 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'*',
'sys_template',
'uid=' . (
int)$this->nextLevel .
' ' . $this->whereClause);
570 $this->nextLevel = 0;
571 if ($row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res)) {
573 if (is_array($row)) {
574 $this->
processTemplate($row,
'sys_' . $row[
'uid'], $this->absoluteRootLine[$a][
'uid'],
'sys_' . $row[
'uid']);
575 $this->outermostRootlineIndexWithTemplate = $a;
578 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
582 if ($a == $c - 1 && $start_template_uid) {
583 $addC =
' AND uid=' . (int)$start_template_uid;
585 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'*',
'sys_template',
'pid=' . (
int)$this->absoluteRootLine[$a][
'uid'] . $addC .
' ' . $this->whereClause,
'',
'sorting', 1);
586 if ($row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res)) {
588 if (is_array($row)) {
589 $this->
processTemplate($row,
'sys_' . $row[
'uid'], $this->absoluteRootLine[$a][
'uid'],
'sys_' . $row[
'uid']);
590 $this->outermostRootlineIndexWithTemplate = $a;
593 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
594 $this->rootLine[] = $this->absoluteRootLine[$a];
598 if (!$this->extensionStaticsProcessed && $this->processExtensionStatics) {
622 public function processTemplate($row, $idList, $pid, $templateID =
'', $templateParent =
'', $includePath =
'') {
624 $this->rowSum[] = array($row[
'uid'], $row[
'title'], $row[
'tstamp']);
627 $clConst = $row[
'clear'] & 1;
628 $clConf = $row[
'clear'] & 2;
631 foreach ($this->constants as &$constantConfiguration) {
632 $constantConfiguration =
'';
634 unset($constantConfiguration);
635 $this->clearList_const = array();
639 foreach ($this->config as &$configConfiguration) {
640 $configConfiguration =
'';
642 unset($configConfiguration);
643 $this->hierarchyInfoToRoot = array();
644 $this->clearList_setup = array();
649 if (!$row[
'includeStaticAfterBasedOn']) {
654 if (trim($row[
'basedOn'])) {
658 $basedOn_hackFeature = explode(
'=', $row[
'basedOn']);
659 if ($basedOn_hackFeature[0] ==
'EXTERNAL_BASED_ON_TEMPLATE_ID' && $basedOn_hackFeature[1]) {
663 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'*',
'sys_template',
'uid=' . $id .
' ' . $this->whereClause);
665 if ($subrow =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res)) {
667 if (is_array($subrow)) {
668 $this->
processTemplate($subrow, $idList .
',sys_' . $id, $pid,
'sys_' . $id, $templateID);
671 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
678 foreach ($basedOnIds as $key => $basedOnId) {
680 unset($basedOnIds[$key]);
683 if (!empty($basedOnIds)) {
684 $subTemplates =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetRows(
'*',
'sys_template',
'uid IN (' . implode(
',', $basedOnIds) .
') ' . $this->whereClause,
'',
'',
'',
'uid');
686 foreach ($basedOnIds as $id) {
687 if (is_array($subTemplates[$id])) {
689 $this->
processTemplate($subTemplates[$id], $idList .
',sys_' . $id, $pid,
'sys_' . $id, $templateID);
696 if ($row[
'includeStaticAfterBasedOn']) {
700 $this->hierarchyInfo[] = ($this->hierarchyInfoToRoot[] = array(
701 'root' => trim($row[
'root']),
702 'next' => $row[
'nextLevel'],
703 'clConst' => $clConst,
705 'templateID' => $templateID,
706 'templateParent' => $templateParent,
707 'title' => $row[
'title'],
708 'uid' => $row[
'uid'],
709 'pid' => $row[
'pid'],
710 'configLines' => substr_count($row[
'config'], LF) + 1
713 $this->constants[] = $row[
'constants'];
714 $this->config[] = $row[
'config'];
715 $this->templateIncludePaths[] = $includePath;
717 $this->clearList_const[] = $templateID;
718 $this->clearList_setup[] = $templateID;
719 if (trim($row[
'sitetitle'])) {
720 $this->sitetitle = $row[
'sitetitle'];
723 if (trim($row[
'root'])) {
724 $this->rootId = $pid;
725 $this->rootLine = array();
728 if ($row[
'nextLevel']) {
729 $this->nextLevel = $row[
'nextLevel'];
731 $this->nextLevel = 0;
747 if (!is_array($this->rootLine) || count($this->rootLine) === 0) {
751 $fullRootLineByUid = array();
752 foreach ($fullRootLine as $rootLineData) {
753 $fullRootLineByUid[$rootLineData[
'uid']] = $rootLineData;
756 foreach ($this->rootLine as $level => $dataArray) {
757 $currentUid = $dataArray[
'uid'];
759 if (!array_key_exists($currentUid, $fullRootLineByUid)) {
760 throw new \RuntimeException(sprintf(
'The full rootLine does not contain data for the page with the uid %d that is contained in the template rootline.', $currentUid), 1370419654);
763 $this->rootLine[$level] = $fullRootLineByUid[$currentUid];
781 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_tstemplate.php'][
'includeStaticTypoScriptSources'])) {
783 'idList' => &$idList,
784 'templateId' => &$templateID,
788 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_tstemplate.php'][
'includeStaticTypoScriptSources'] as $_funcRef) {
793 if ($row[
'static_file_mode'] == 3 && substr($templateID, 0, 4) ==
'sys_' && $row[
'root']) {
797 if (trim($row[
'include_static_file'])) {
800 foreach ($include_static_fileArr as $ISF_file) {
801 if (substr($ISF_file, 0, 4) ==
'EXT:') {
802 list($ISF_extKey, $ISF_localPath) = explode(
'/', substr($ISF_file, 4), 2);
804 $ISF_localPath = rtrim($ISF_localPath,
'/') .
'/';
806 if (@is_dir($ISF_filePath)) {
807 $mExtKey = str_replace(
'_',
'', $ISF_extKey .
'/' . $ISF_localPath);
809 'constants' => @file_exists(($ISF_filePath .
'constants.txt')) ?
GeneralUtility::getUrl($ISF_filePath .
'constants.txt') :
'',
810 'config' => @file_exists(($ISF_filePath .
'setup.txt')) ?
GeneralUtility::getUrl($ISF_filePath .
'setup.txt') :
'',
812 'include_static_file' => @file_exists(($ISF_filePath .
'include_static_file.txt')) ? implode(
',', array_unique(explode(
',',
GeneralUtility::getUrl($ISF_filePath .
'include_static_file.txt')))) :
'',
813 'title' => $ISF_file,
817 $this->
processTemplate($subrow, $idList .
',ext_' . $mExtKey, $pid,
'ext_' . $mExtKey, $templateID, $ISF_filePath);
825 if ($row[
'static_file_mode'] == 1 || $row[
'static_file_mode'] == 0 && substr($templateID, 0, 4) ==
'sys_' && $row[
'root']) {
829 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_tstemplate.php'][
'includeStaticTypoScriptSourcesAtEnd'])) {
831 'idList' => &$idList,
832 'templateId' => &$templateID,
836 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_tstemplate.php'][
'includeStaticTypoScriptSourcesAtEnd'] as $_funcRef) {
855 $this->extensionStaticsProcessed = TRUE;
858 foreach (
$GLOBALS[
'TYPO3_LOADED_EXT'] as $extKey => $files) {
859 if ((is_array($files) || $files instanceof \ArrayAccess) && ($files[
'ext_typoscript_constants.txt'] || $files[
'ext_typoscript_setup.txt'])) {
860 $mExtKey = str_replace(
'_',
'', $extKey);
862 'constants' => $files[
'ext_typoscript_constants.txt'] ?
GeneralUtility::getUrl($files[
'ext_typoscript_constants.txt']) :
'',
863 'config' => $files[
'ext_typoscript_setup.txt'] ?
GeneralUtility::getUrl($files[
'ext_typoscript_setup.txt']) :
'',
869 $this->
processTemplate($subrow, $idList .
',ext_' . $mExtKey, $pid,
'ext_' . $mExtKey, $templateID, $extPath);
887 $identifier = $subrow[
'uid'];
888 $subrow[
'config'] .=
$GLOBALS[
'TYPO3_CONF_VARS'][
'FE'][
'defaultTypoScript_setup.'][$identifier];
889 $subrow[
'constants'] .=
$GLOBALS[
'TYPO3_CONF_VARS'][
'FE'][
'defaultTypoScript_constants.'][$identifier];
891 if (in_array($identifier,
$GLOBALS[
'TYPO3_CONF_VARS'][
'FE'][
'contentRenderingTemplates'], TRUE)) {
892 $subrow[
'config'] .=
$GLOBALS[
'TYPO3_CONF_VARS'][
'FE'][
'defaultTypoScript_setup.'][
'defaultContentRendering'];
893 $subrow[
'constants'] .=
$GLOBALS[
'TYPO3_CONF_VARS'][
'FE'][
'defaultTypoScript_constants.'][
'defaultContentRendering'];
911 if (is_object(
$GLOBALS[
'TSFE']) === TRUE && property_exists(
$GLOBALS[
'TSFE'],
'sys_page') === TRUE && method_exists(
$GLOBALS[
'TSFE']->sys_page,
'versionOL') === TRUE) {
913 $GLOBALS[
'TSFE']->sys_page->versionOL(
'sys_template', $row);
933 public function generateConfig() {
947 $constants->breakPointLN = (int)$this->ext_constants_BRP;
952 $matchObj->setSimulateMatchConditions($this->matchAlternative);
953 $matchObj->setSimulateMatchResult((
bool) $this->matchAll);
955 foreach ($this->constants as $str) {
959 $this->parserErrors[
'constants'] =
$constants->errors;
961 $this->flatSetup = array();
969 $config->breakPointLN = (int)$this->ext_config_BRP;
978 foreach ($this->config as $str) {
984 if ($this->tt_track) {
985 $GLOBALS[
'TT']->push(
'Substitute Constants (' . count($this->flatSetup) .
')');
988 if ($this->tt_track) {
992 if (strstr($all,
'{$')) {
993 $theConstList = array();
994 $findConst = explode(
'{$', $all);
995 array_shift($findConst);
996 foreach ($findConst as $constVal) {
998 $theConstList[] =
'{$' . substr($constVal, 0, ($constLen + 1));
1000 if ($this->tt_track) {
1001 $GLOBALS[
'TT']->setTSlogMessage(implode(
', ', $theConstList) .
': Constants may remain un-substituted!!', 2);
1005 if ($this->tt_track) {
1006 $GLOBALS[
'TT']->setTSlogMessage(
'TypoScript template size as textfile: ' . strlen($all) .
' bytes');
1009 $config->parse($all, $matchObj);
1011 $this->parserErrors[
'config'] =
$config->errors;
1013 $this->setup =
$config->setup;
1014 if ($this->backend_info) {
1023 unset($this->setup[
'sitetitle']);
1024 unset($this->setup[
'sitetitle.']);
1027 unset($this->setup[
'types.']);
1028 unset($this->setup[
'types']);
1029 if (is_array($this->setup)) {
1030 foreach ($this->setup as $key => $value) {
1031 if ($value ==
'PAGE') {
1033 if (isset($this->setup[$key .
'.'][
'typeNum'])) {
1034 $typeNum = $this->setup[$key .
'.'][
'typeNum'];
1035 $this->setup[
'types.'][$typeNum] = $key;
1036 } elseif (!isset($this->setup[
'types.'][0]) || !$this->setup[
'types.'][0]) {
1037 $this->setup[
'types.'][0] = $key;
1042 unset($this->setup[
'styles.']);
1043 unset($this->setup[
'temp.']);
1046 $this->sections =
$config->sections;
1047 $this->sectionsMatch =
$config->sectionsMatch;
1059 if ($this->processIncludesHasBeenRun) {
1065 foreach ($this->constants as &$value) {
1067 $files = array_merge($files, $includeData[
'files']);
1068 $value = $includeData[
'typoscript'];
1072 foreach ($this->config as &$value) {
1074 $files = array_merge($files, $includeData[
'files']);
1075 $value = $includeData[
'typoscript'];
1079 if (!empty($files)) {
1080 $files = array_unique($files);
1081 foreach ($files as $file) {
1082 $this->rowSum[] = array($file, filemtime($file));
1086 $this->processIncludesHasBeenRun = TRUE;
1097 public function mergeConstantsFromPageTSconfig($constArray) {
1098 $TSdataArray = array();
1100 $TSdataArray[] =
$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'defaultPageTSconfig'];
1102 $TSdataArray[] = $this->absoluteRootLine[$a][
'TSconfig'];
1106 $userTS = implode(LF .
'[GLOBAL]' . LF, $TSdataArray);
1109 $parseObj->parse($userTS);
1110 if (is_array($parseObj->setup[
'TSFE.'][
'constants.'])) {
1127 if (is_array($setupArray)) {
1128 foreach ($setupArray as $key => $val) {
1129 if ($prefix || substr($key, 0, 16) !=
'TSConstantEditor') {
1131 if (is_array($val)) {
1132 $this->
flattenSetup($val, $prefix . $key, $key ==
'file.');
1133 } elseif ($resourceFlag) {
1134 $this->flatSetup[$prefix . $key] = $this->
getFileName($val);
1136 $this->flatSetup[$prefix . $key] = $val;
1152 if ($this->tt_track) {
1153 $GLOBALS[
'TT']->setTSlogMessage(
'Constants to substitute: ' . count($this->flatSetup));
1157 for ($i = 0; $i < 10 && !$noChange; $i++) {
1159 $all = preg_replace_callback(
'/\\{\\$(.[^}]*)\\}/', array($this,
'substituteConstantsCallBack'), $all);
1160 if ($old_all == $all) {
1177 return isset($this->flatSetup[$matches[1]]) && !is_array($this->flatSetup[$matches[1]]) ? $this->flatSetup[$matches[1]] : $matches[0];
1198 $splitCount = (int)$splitCount;
1200 if ($splitCount && is_array($conf)) {
1202 for ($aKey = 0; $aKey < $splitCount; $aKey++) {
1203 $conf2[$aKey] = array();
1206 foreach ($conf as $cKey => $val) {
1207 if (is_array($val)) {
1209 foreach ($tempConf as $aKey => $val) {
1210 $conf2[$aKey][$cKey] = $val;
1214 if ($cKey ===
'noTrimWrap' || (!strstr($val,
'|*|') && !strstr($val,
'||'))) {
1215 for ($aKey = 0; $aKey < $splitCount; $aKey++) {
1216 $conf2[$aKey][$cKey] = $val;
1219 $main = explode(
'|*|', $val);
1220 $mainCount = count($main);
1225 $first = explode(
'||', $main[0]);
1226 $firstC = count($first);
1229 $middle = explode(
'||', $main[1]);
1230 $middleC = count($middle);
1233 $last = explode(
'||', $main[2]);
1234 $lastC = count($last);
1237 for ($aKey = 0; $aKey < $splitCount; $aKey++) {
1238 if ($firstC && isset($first[$aKey])) {
1239 $value = $first[$aKey];
1240 } elseif ($middleC) {
1241 $value = $middle[($aKey - $firstC) % $middleC];
1243 if ($lastC && $lastC >= $splitCount - $aKey) {
1244 $value = $last[$lastC - ($splitCount - $aKey)];
1246 $conf2[$aKey][$cKey] = trim($value);
1264 $file = trim($fileFromSetup);
1267 } elseif (strstr($file,
'../')) {
1268 if ($this->tt_track) {
1269 $GLOBALS[
'TT']->setTSlogMessage(
'File path "' . $file .
'" contained illegal string "../"!', 3);
1275 if (isset($this->fileCache[$hash])) {
1276 return $this->fileCache[$hash];
1278 if (substr($file, 0, 4) ===
'EXT:') {
1280 list($extKey, $script) = explode(
'/', substr($file, 4), 2);
1285 if (!@file_exists((PATH_site . $newFile))) {
1286 if ($this->tt_track) {
1287 $GLOBALS[
'TT']->setTSlogMessage(
'Extension media file "' . $newFile .
'" was not found!', 3);
1295 $urlScheme = parse_url($file, PHP_URL_SCHEME);
1296 if ($urlScheme ===
'https' || $urlScheme ===
'http' || is_file(PATH_site . $file)) {
1300 if (strpos($file,
'/') !== FALSE) {
1306 if (file_exists($this->getFileName_backPath . $file)) {
1310 foreach ($this->allowedPaths as $val) {
1311 if (substr($fileInfo[
'path'], 0, strlen($val)) == $val) {
1317 $this->fileCache[$hash] = $outFile;
1319 } elseif ($this->tt_track) {
1320 $GLOBALS[
'TT']->setTSlogMessage(
'"' . $file .
'" was not located in the allowed paths: (' . implode(
',', $this->allowedPaths) .
')', 3);
1322 } elseif ($this->tt_track) {
1323 $GLOBALS[
'TT']->setTSlogMessage(
'"' . $this->getFileName_backPath . $file .
'" is not a file (non-uploads/.. resource, did not exist).', 3);
1338 public function printTitle($pageTitle, $noTitle = FALSE, $showTitleFirst = FALSE) {
1339 $siteTitle = trim($this->setup[
'sitetitle']);
1340 $pageTitle = $noTitle ?
'' : $pageTitle;
1341 $pageTitleSeparator =
'';
1342 if ($showTitleFirst) {
1344 $siteTitle = $pageTitle;
1347 if ($pageTitle !=
'' && $siteTitle !=
'') {
1348 $pageTitleSeparator =
': ';
1349 if (isset($this->setup[
'config.'][
'pageTitleSeparator']) && $this->setup[
'config.'][
'pageTitleSeparator']) {
1350 $pageTitleSeparator = $this->setup[
'config.'][
'pageTitleSeparator'];
1352 if (is_object(
$GLOBALS[
'TSFE']->cObj) && isset($this->setup[
'config.'][
'pageTitleSeparator.']) && is_array($this->setup[
'config.'][
'pageTitleSeparator.'])) {
1353 $pageTitleSeparator =
$GLOBALS[
'TSFE']->cObj->stdWrap($pageTitleSeparator, $this->setup[
'config.'][
'pageTitleSeparator.']);
1355 $pageTitleSeparator .=
' ';
1359 return $siteTitle . $pageTitleSeparator . $pageTitle;
1374 return @file_get_contents($incFile);
1387 public function wrap($content, $wrap) {
1389 $wrapArr = explode(
'|', $wrap);
1390 return trim($wrapArr[0]) . $content . trim($wrapArr[1]);
1405 if (substr($url, -1) ==
'?') {
1406 return substr($url, 0, -1);
1421 static public function sortedKeyList($setupArr, $acceptOnlyProperties = FALSE) {
1423 $setupArrKeys = array_keys($setupArr);
1424 foreach ($setupArrKeys as $key) {
1425 if ($acceptOnlyProperties || \
TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($key)) {
1426 $keyArr[] = (int)$key;
1429 $keyArr = array_unique($keyArr);
1443 foreach ($this->rootLine as $page) {
1475 public function linkData($page, $oTarget, $no_cache, $script, $overrideArray = NULL, $addParams =
'', $typeOverride =
'', $targetDomain =
'') {
1478 if (is_array($overrideArray)) {
1479 foreach ($overrideArray as $theKey => $theNewVal) {
1480 $addParams .=
'&real_' . $theKey .
'=' . rawurlencode($page[$theKey]);
1481 $page[$theKey] = $theNewVal;
1485 if (!strstr($addParams,
'&MP=')) {
1487 if (trim(
$GLOBALS[
'TSFE']->MP_defaults[$page[
'uid']])) {
1488 $addParams .=
'&MP=' . rawurlencode(trim(
$GLOBALS[
'TSFE']->MP_defaults[$page[
'uid']]));
1489 } elseif (
$GLOBALS[
'TSFE']->config[
'config'][
'MP_mapRootPoints']) {
1493 $addParams .=
'&MP=' . rawurlencode($m);
1499 $script =
$GLOBALS[
'TSFE']->config[
'mainScript'];
1501 if ($page[
'alias']) {
1502 $LD[
'url'] = $script .
'?id=' . rawurlencode($page[
'alias']);
1504 $LD[
'url'] = $script .
'?id=' . $page[
'uid'];
1507 $LD[
'target'] = trim($page[
'target']) ?: $oTarget;
1509 $typeNum = $this->setup[$LD[
'target'] .
'.'][
'typeNum'];
1510 if (!\
TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($typeOverride) && (
int)
$GLOBALS[
'TSFE']->config[
'config'][
'forceTypeValue']) {
1511 $typeOverride = (int)
$GLOBALS[
'TSFE']->config[
'config'][
'forceTypeValue'];
1513 if ((
string)$typeOverride !==
'') {
1514 $typeNum = $typeOverride;
1518 $LD[
'type'] =
'&type=' . (int)$typeNum;
1523 $LD[
'orig_type'] = $LD[
'type'];
1525 $LD[
'no_cache'] = trim($page[
'no_cache']) || $no_cache ?
'&no_cache=1' :
'';
1527 if (
$GLOBALS[
'TSFE']->config[
'config'][
'uniqueLinkVars']) {
1531 $LD[
'linkVars'] =
$GLOBALS[
'TSFE']->linkVars;
1534 $LD[
'linkVars'] =
$GLOBALS[
'TSFE']->linkVars . $addParams;
1537 $LD[
'url'] =
$GLOBALS[
'TSFE']->absRefPrefix . $LD[
'url'];
1539 $LD[
'sectionIndex'] = $page[
'sectionIndex_uid'] ?
'#c' . $page[
'sectionIndex_uid'] :
'';
1541 $LD[
'totalURL'] = $this->
removeQueryString(($LD[
'url'] . $LD[
'type'] . $LD[
'no_cache'] . $LD[
'linkVars'] .
$GLOBALS[
'TSFE']->getMethodUrlIdToken)) . $LD[
'sectionIndex'];
1543 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_tstemplate.php'][
'linkData-PostProc'])) {
1546 'args' => array(
'page' => $page,
'oTarget' => $oTarget,
'no_cache' => $no_cache,
'script' => $script,
'overrideArray' => $overrideArray,
'addParams' => $addParams,
'typeOverride' => $typeOverride,
'targetDomain' => $targetDomain),
1547 'typeNum' => $typeNum
1549 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_tstemplate.php'][
'linkData-PostProc'] as $_funcRef) {
1569 if (!is_array($this->MPmap)) {
1570 $this->MPmap = array();
1573 foreach ($rootPoints as $p) {
1575 $p = $this->rootLine[0][
'uid'];
1576 $initMParray = array();
1577 if ($this->rootLine[0][
'_MOUNT_OL'] && $this->rootLine[0][
'_MP_PARAM']) {
1578 $initMParray[] = $this->rootLine[0][
'_MP_PARAM'];
1586 if (is_array($this->MPmap[$pageId]) && count($this->MPmap[$pageId])) {
1587 return implode(
',', $this->MPmap[$pageId]);
1610 $mount_info =
$GLOBALS[
'TSFE']->sys_page->getMountPointInfo($id);
1612 if (is_array($mount_info) && $mount_info[
'overlay']) {
1613 $MP_array[] = $mount_info[
'MPvar'];
1614 $id = $mount_info[
'mount_pid'];
1617 $this->MPmap[$id] = $MP_array;
1619 if (is_array($mount_info) && !$mount_info[
'overlay']) {
1620 $MP_array[] = $mount_info[
'MPvar'];
1621 $id = $mount_info[
'mount_pid'];
1624 if ($id && $level < 20) {
1625 $nextLevelAcc = array();
1627 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'uid,pid,doktype,mount_pid,mount_pid_ol',
'pages',
'pid=' . (
int)$id .
' AND deleted=0 AND doktype<>' . \
TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_RECYCLER .
' AND doktype<>' . \
TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_BE_USER_SECTION);
1628 while ($row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res)) {
1630 $next_id = $row[
'uid'];
1631 $next_MP_array = $MP_array;
1632 $mount_info =
$GLOBALS[
'TSFE']->sys_page->getMountPointInfo($next_id, $row);
1634 if (is_array($mount_info) && $mount_info[
'overlay']) {
1635 $next_MP_array[] = $mount_info[
'MPvar'];
1636 $next_id = $mount_info[
'mount_pid'];
1638 if (!isset($this->MPmap[$next_id])) {
1640 $this->MPmap[$next_id] = $next_MP_array;
1642 if (is_array($mount_info) && !$mount_info[
'overlay']) {
1643 $next_MP_array[] = $mount_info[
'MPvar'];
1644 $next_id = $mount_info[
'mount_pid'];
1648 $nextLevelAcc[] = array($next_id, $next_MP_array);
1651 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
1653 foreach ($nextLevelAcc as $pSet) {
1669 if (!$this->isDefaultTypoScriptAdded) {
1673 array_unshift($this->constants, (
string)
$GLOBALS[
'TYPO3_CONF_VARS'][
'FE'][
'defaultTypoScript_constants']);
1674 array_unshift($this->config, (
string)$GLOBALS[
'TYPO3_CONF_VARS'][
'FE'][
'defaultTypoScript_setup']);
1675 array_unshift($this->templateIncludePaths,
'');
1677 $rootTemplateId = $this->hierarchyInfo[count($this->hierarchyInfo)-1][
'templateID'];
1678 $defaultTemplateInfo = array(
1683 'templateID' =>
'_defaultTypoScript_',
1684 'templateParent' => $rootTemplateId,
1685 'title' =>
'SYS:TYPO3_CONF_VARS:FE:defaultTypoScript',
1686 'uid' =>
'_defaultTypoScript_',
1688 'configLines' => substr_count((
string)$GLOBALS[
'TYPO3_CONF_VARS'][
'FE'][
'defaultTypoScript_setup'], LF) + 1
1691 array_unshift($this->clearList_const, $defaultTemplateInfo[
'uid']);
1692 array_unshift($this->clearList_setup, $defaultTemplateInfo[
'uid']);
1693 array_unshift($this->hierarchyInfo, $defaultTemplateInfo);
1694 $this->isDefaultTypoScriptAdded = TRUE;
static mergeRecursiveWithOverrule(array &$original, array $overrule, $addKeys=TRUE, $includeEmptyValues=TRUE, $enableUnsetFeature=TRUE)
printTitle($pageTitle, $noTitle=FALSE, $showTitleFirst=FALSE)
linkData($page, $oTarget, $no_cache, $script, $overrideArray=NULL, $addParams='', $typeOverride='', $targetDomain='')
static explodeUrl2Array($string, $multidim=FALSE)
getProcessExtensionStatics()
static getHash($hash, $expTime=0)
static isFirstPartOfStr($str, $partStr)
static forceIntegerInRange($theInt, $min, $max=2000000000, $defaultValue=0)
static extPath($key, $script='')
splitConfArray($conf, $splitCount)
substituteConstantsCallBack($matches)
static workspaceOL($table, &$row, $wsid=-99, $unsetMovePointers=FALSE)
static intExplode($delimiter, $string, $removeEmptyValues=FALSE, $limit=0)
static makeInstance($className)
runThroughTemplates($theRootLine, $start_template_uid=0)
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
includeStaticTypoScriptSources($idList, $templateID, $pid, $row)
static checkIncludeLines($string, $cycle_counter=1, $returnFiles=FALSE, $parentFilenameOrPath='')
static callUserFunction($funcName, &$params, &$ref, $checkPrefix='', $errorMode=0)
processTemplate($row, $idList, $pid, $templateID='', $templateParent='', $includePath='')
prependStaticExtra($subrow)
static split_fileref($fileNameWithPath)
static checkIncludeLines_array(array $array)
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren't numeric.
static getUrl($url, $includeHeader=0, $requestHeaders=FALSE, &$report=NULL)
static storeHash($hash, $data, $ident, $lifetime=0)
static isLoaded($key, $exitOnError=FALSE)
setProcessExtensionStatics($processExtensionStatics)
updateRootlineData($fullRootLine)
$extensionStaticsProcessed
substituteConstants($all)
static implodeArrayForUrl($name, array $theArray, $str='', $skipBlank=FALSE, $rawurlencodeParamName=FALSE)
addExtensionStatics($idList, $templateID, $pid, $row)
initMPmap_create($id, $MP_array=array(), $level=0)
$isDefaultTypoScriptAdded
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
$processIncludesHasBeenRun
flattenSetup($setupArray, $prefix, $resourceFlag)
static inList($list, $item)
static stripPathSitePrefix($path)
$outermostRootlineIndexWithTemplate
static sortedKeyList($setupArr, $acceptOnlyProperties=FALSE)
getFileName($fileFromSetup)