2 namespace TYPO3\CMS\Frontend\ContentObject\Menu;
250 $this->mconf =
$conf[$this->menuNumber . $objSuffix .
'.'];
251 $this->
debug = $tsfe->debug;
254 switch ($tsfe->xhtmlDoctype) {
262 $this->nameAttribute =
'id';
265 $this->nameAttribute =
'name';
268 if ($this->conf[$this->menuNumber . $objSuffix] && is_object(
$tmpl) && is_object(
$sys_page)) {
272 if (trim($this->conf[
'alwaysActivePIDlist']) || isset($this->conf[
'alwaysActivePIDlist.'])) {
273 if (isset($this->conf[
'alwaysActivePIDlist.'])) {
274 $this->conf[
'alwaysActivePIDlist'] = $this->parent_cObj->stdWrap(
275 $this->conf[
'alwaysActivePIDlist'],
276 $this->conf[
'alwaysActivePIDlist.']
282 if ($this->conf[
'excludeDoktypes']) {
283 $this->doktypeExcludeList = $this->
getDatabaseConnection()->cleanIntList($this->conf[
'excludeDoktypes']);
286 $this->entryLevel = $this->parent_cObj->getKey(
287 isset(
$conf[
'entryLevel.']) ? $this->parent_cObj->stdWrap(
290 ) :
$conf[
'entryLevel'],
291 $this->tmpl->rootLine
296 $this->
id = (int)
$id;
299 $this->
id = (int)$this->tmpl->rootLine[$this->entryLevel][
'uid'];
302 foreach ($this->tmpl->rootLine as
$entryLevel => $levelRec) {
304 if ($levelRec[
'_MP_PARAM'] && $levelRec[
'_MOUNT_OL']) {
305 $this->MP_array[] = $levelRec[
'_MP_PARAM'];
312 if ($levelRec[
'_MP_PARAM'] && !$levelRec[
'_MOUNT_OL']) {
313 $this->MP_array[] = $levelRec[
'_MP_PARAM'];
318 if ($this->
id <= 0) {
323 $mount_info = $this->sys_page->getMountPointInfo($this->
id);
324 if (is_array($mount_info)) {
325 $this->MP_array[] = $mount_info[
'MPvar'];
326 $this->
id = $mount_info[
'mount_pid'];
330 if (!is_array($this->rL_uidRegister)) {
331 $rl_MParray = array();
332 foreach ($this->tmpl->rootLine as $v_rl) {
334 if ($v_rl[
'_MP_PARAM'] && $v_rl[
'_MOUNT_OL']) {
335 $rl_MParray[] = $v_rl[
'_MP_PARAM'];
338 $this->rL_uidRegister[] =
'ITEM:' . $v_rl[
'uid'] .
340 ?
':' . implode(
',', $rl_MParray)
344 if ($v_rl[
'_MP_PARAM'] && !$v_rl[
'_MOUNT_OL']) {
345 $rl_MParray[] = $v_rl[
'_MP_PARAM'];
352 if ($this->conf[
'special'] ===
'directory') {
353 $value = isset($this->conf[
'special.'][
'value.']) ? $this->parent_cObj->stdWrap(
354 $this->conf[
'special.'][
'value'],
355 $this->conf[
'special.'][
'value.']
356 ) : $this->conf[
'special.'][
'value'];
358 $value = $tsfe->page[
'uid'];
360 $directoryLevel = (int)$tsfe->tmpl->getRootlineLevel($value);
366 if (is_array($this->tmpl->rootLine[$currentLevel])) {
368 if (empty($nextMParray) && !$this->tmpl->rootLine[$currentLevel][
'_MOUNT_OL'] && $currentLevel > 0) {
371 $parentRecord = $this->tmpl->rootLine[$currentLevel - 1];
372 if (isset($parentRecord[
'_MP_PARAM'])) {
373 $nextMParray[] = $parentRecord[
'_MP_PARAM'];
377 if ($this->tmpl->rootLine[$currentLevel][
'_MOUNT_OL']) {
378 $nextMParray[] = $this->tmpl->rootLine[$currentLevel][
'_MP_PARAM'];
380 $this->nextActive = $this->tmpl->rootLine[$currentLevel][
'uid'] .
381 (!empty($nextMParray)
382 ?
':' . implode(
',', $nextMParray)
386 $this->nextActive =
'';
389 if ($this->mconf[
'imgNamePrefix']) {
390 $this->imgNamePrefix = $this->mconf[
'imgNamePrefix'];
392 $this->imgNameNotRandom = $this->mconf[
'imgNameNotRandom'];
415 $this->useCacheHash =
false;
418 $SAVED_where_groupAccess =
'';
419 if ($this->mconf[
'showAccessRestrictedPages']) {
421 $SAVED_where_groupAccess = $this->sys_page->where_groupAccess;
423 $this->sys_page->where_groupAccess =
'';
426 $menuItems = $this->prepareMenuItems();
430 $minItems = (int)($this->mconf[
'minItems'] ?: $this->conf[
'minItems']);
431 $maxItems = (int)($this->mconf[
'maxItems'] ?: $this->conf[
'maxItems']);
432 $begin = $this->parent_cObj->calc($this->mconf[
'begin'] ? $this->mconf[
'begin'] : $this->conf[
'begin']);
433 $minItemsConf = isset($this->mconf[
'minItems.']) ? $this->mconf[
'minItems.'] : (isset($this->conf[
'minItems.']) ? $this->conf[
'minItems.'] : null);
434 $minItems = is_array($minItemsConf) ? $this->parent_cObj->stdWrap($minItems, $minItemsConf) : $minItems;
435 $maxItemsConf = isset($this->mconf[
'maxItems.']) ? $this->mconf[
'maxItems.'] : (isset($this->conf[
'maxItems.']) ? $this->conf[
'maxItems.'] : null);
436 $maxItems = is_array($maxItemsConf) ? $this->parent_cObj->stdWrap($maxItems, $maxItemsConf) : $maxItems;
437 $beginConf = isset($this->mconf[
'begin.']) ? $this->mconf[
'begin.'] : (isset($this->conf[
'begin.']) ? $this->conf[
'begin.'] : null);
438 $begin = is_array($beginConf) ? $this->parent_cObj->stdWrap($begin, $beginConf) : $begin;
441 $this->menuArr = array();
442 foreach ($menuItems as $data) {
448 if ($begin <= $c_b) {
449 $this->menuArr[$c] = $data;
450 $this->menuArr[$c][
'isSpacer'] = $spacer;
452 if ($maxItems && $c >= $maxItems) {
460 while ($c < $minItems) {
461 $this->menuArr[$c] = array(
469 if ($this->mconf[
'itemArrayProcFunc']) {
470 $this->menuArr = $this->
userProcess(
'itemArrayProcFunc', $this->menuArr);
475 serialize($this->menuArr) .
476 serialize($this->mconf) .
477 serialize($this->tmpl->rootLine) .
478 serialize($this->MP_array)
481 if ($this->conf[
'cache_period']) {
482 $cacheTimeout = $this->conf[
'cache_period'];
487 $cachedData = $cache->get($this->hash);
488 if (!is_array($cachedData)) {
490 $cache->set($this->hash, $this->result, array(
'ident_MENUDATA'), (
int)$cacheTimeout);
492 $this->result = $cachedData;
495 if ($this->mconf[
'showAccessRestrictedPages']) {
497 $this->sys_page->where_groupAccess = $SAVED_where_groupAccess;
529 $filteredPages = array();
530 foreach ($pages as $aPage) {
532 $filteredPages[$aPage[
'uid']] = $aPage;
535 return $filteredPages;
543 protected function prepareMenuItems()
545 $menuItems = array();
546 $alternativeSortingField = trim($this->mconf[
'alternativeSortingField']) ?:
'sorting';
549 $additionalWhere = isset($this->mconf[
'additionalWhere']) ? $this->mconf[
'additionalWhere'] :
'';
550 if (isset($this->mconf[
'additionalWhere.'])) {
551 $additionalWhere = $this->parent_cObj->stdWrap($additionalWhere, $this->mconf[
'additionalWhere.']);
555 if ($this->menuNumber == 1 && $this->conf[
'special']) {
556 $value = isset($this->conf[
'special.'][
'value.'])
557 ? $this->parent_cObj->stdWrap($this->conf[
'special.'][
'value'], $this->conf[
'special.'][
'value.'])
558 : $this->conf[
'special.'][
'value'];
559 switch ($this->conf[
'special']) {
570 $menuItems = $this->prepareMenuItemsForListMenu($value);
575 $this->mconf[
'alternativeSortingField'] ?:
false
581 $this->mconf[
'alternativeSortingField'] ?:
false
587 $menuItems = $categoryMenuUtility->collectPages($value, $this->conf[
'special.'], $this);
593 $menuItems = $this->prepareMenuitemsForBrowseMenu($value, $alternativeSortingField, $additionalWhere);
596 if ($this->mconf[
'sectionIndex']) {
597 $sectionIndexes = array();
598 foreach ($menuItems as $page) {
599 $sectionIndexes = $sectionIndexes + $this->
sectionIndex($alternativeSortingField, $page[
'uid']);
601 $menuItems = $sectionIndexes;
603 }
elseif (is_array($this->alternativeMenuTempArray)) {
606 }
elseif ($this->mconf[
'sectionIndex']) {
607 $menuItems = $this->
sectionIndex($alternativeSortingField);
610 $menuItems = $this->sys_page->getMenu($this->
id,
'*', $alternativeSortingField, $additionalWhere);
624 $menuItems = $this->parent_cObj->callUserFunction(
625 $this->conf[
'special.'][
'userFunc'],
626 array_merge($this->conf[
'special.'], array(
'value' => $specialValue,
'_altSortField' => $sortingField)),
629 if (!is_array($menuItems)) {
630 $menuItems = array();
643 $menuItems = array();
646 $currentPageWithNoOverlay = $this->sys_page->getRawRecord(
'pages', $tsfe->page[
'uid']);
652 $lRecs = $this->sys_page->getPageOverlay($tsfe->page[
'uid'], $sUid);
658 empty($lRecs) || $tsfe->page[
'l18n_cfg'] & 1 &&
659 (!$sUid || empty($lRecs)) ||
660 !$this->conf[
'special.'][
'normalWhenNoLanguage'] && $sUid && empty($lRecs)
662 $iState = $tsfe->sys_language_uid == $sUid ?
'USERDEF2' :
'USERDEF1';
664 $iState = $tsfe->sys_language_uid == $sUid ?
'ACT' :
'NO';
666 if ($this->conf[
'addQueryString']) {
667 $getVars = $this->parent_cObj->getQueryArguments(
668 $this->conf[
'addQueryString.'],
672 $this->analyzeCacheHashRequirements($getVars);
674 $getVars =
'&L=' . $sUid;
677 $menuItems[] = array_merge(
678 array_merge($currentPageWithNoOverlay, $lRecs),
680 'ITEM_STATE' => $iState,
681 '_ADD_GETVARS' => $getVars,
700 $menuItems = array();
701 if ($specialValue ==
'') {
702 $specialValue = $tsfe->page[
'uid'];
705 foreach ($items as
$id) {
706 $MP = $this->tmpl->getFromMPmap($id);
708 $mount_info = $this->sys_page->getMountPointInfo($id);
709 if (is_array($mount_info)) {
710 if ($mount_info[
'overlay']) {
712 $MP = $this->tmpl->getFromMPmap($mount_info[
'mount_pid']);
713 $MP = $MP ? $MP : $mount_info[
'MPvar'];
715 $MP = ($MP ? $MP .
',' :
'') . $mount_info[
'MPvar'];
717 $id = $mount_info[
'mount_pid'];
720 $res = $this->parent_cObj->exec_getQuery(
'pages', array(
'pidInList' => $id,
'orderBy' => $sortingField));
721 while ($row = $databaseConnection->sql_fetch_assoc($res)) {
722 $tsfe->sys_page->versionOL(
'pages', $row,
true);
725 $mount_info = $this->sys_page->getMountPointInfo($row[
'uid'], $row);
727 if (is_array($mount_info) && $mount_info[
'overlay']) {
730 $mp_row = $this->sys_page->getPage($mount_info[
'mount_pid']);
731 if (!empty($mp_row)) {
733 $row[
'_MP_PARAM'] = $mount_info[
'MPvar'];
743 $row[
'_MP_PARAM'] = $MP . ($row[
'_MP_PARAM'] ?
',' . $row[
'_MP_PARAM'] :
'');
745 $menuItems[$row[
'uid']] = $this->sys_page->getPageOverlay($row);
749 $databaseConnection->sql_free_result($res);
760 protected function prepareMenuItemsForListMenu($specialValue)
762 $menuItems = array();
763 if ($specialValue ==
'') {
766 $skippedEnableFields = array();
767 if (!empty($this->mconf[
'showAccessRestrictedPages'])) {
768 $skippedEnableFields = array(
'fe_group' => 1);
772 $loadDB->setFetchAllFields(
true);
773 $loadDB->start($specialValue,
'pages');
774 $loadDB->additionalWhere[
'pages'] = $this->parent_cObj->enableFields(
'pages',
false, $skippedEnableFields);
775 $loadDB->getFromDB();
776 foreach ($loadDB->itemArray as $val) {
777 $MP = $this->tmpl->getFromMPmap($val[
'id']);
779 $mount_info = $this->sys_page->getMountPointInfo($val[
'id']);
781 if (is_array($mount_info) && $mount_info[
'overlay']) {
784 $mp_row = $this->sys_page->getPage($mount_info[
'mount_pid']);
785 if (!empty($mp_row)) {
787 $row[
'_MP_PARAM'] = $mount_info[
'MPvar'];
789 if ($mount_info[
'overlay']) {
790 $MP = $this->tmpl->getFromMPmap($mount_info[
'mount_pid']);
792 unset($row[
'_MP_PARAM']);
801 $row = $loadDB->results[
'pages'][$val[
'id']];
804 if (isset($row) && is_array($row)) {
805 $this->sys_page->versionOL(
'pages', $row,
true);
808 if (isset($row) && is_array($row)) {
810 $row[
'_MP_PARAM'] = $MP . ($row[
'_MP_PARAM'] ?
',' . $row[
'_MP_PARAM'] :
'');
812 $menuItems[] = $this->sys_page->getPageOverlay($row);
828 $menuItems = array();
829 if ($specialValue ==
'') {
830 $specialValue = $tsfe->page[
'uid'];
840 $maxAge = (int)$this->parent_cObj->calc($this->conf[
'special.'][
'maxAge']);
845 $mode = $this->conf[
'special.'][
'mode'];
847 $id_list_arr = array();
848 foreach ($items as
$id) {
850 $id_list_arr[] = $this->parent_cObj->getTreeList(-1 * $id, $depth - 1 + $bA, $bA - 1);
852 $id_list = implode(
',', $id_list_arr);
856 $sortField =
'starttime';
860 $sortField =
'lastUpdated';
863 $sortField =
'tstamp';
866 $sortField =
'crdate';
869 $sortField =
'SYS_LASTCHANGED';
871 $extraWhere = ($this->conf[
'includeNotInMenu'] ?
'' :
' AND pages.nav_hide=0') . $this->
getDoktypeExcludeWhere();
872 if ($this->conf[
'special.'][
'excludeNoSearchPages']) {
873 $extraWhere .=
' AND pages.no_search=0';
876 $extraWhere .=
' AND ' . $sortField .
'>' . (
$GLOBALS[
'SIM_ACCESS_TIME'] - $maxAge);
878 $res = $this->parent_cObj->exec_getQuery(
'pages', array(
880 'uidInList' => $id_list,
881 'where' => $sortField .
'>=0' . $extraWhere,
882 'orderBy' => $sortingField ?: $sortField .
' DESC',
886 $tsfe->sys_page->versionOL(
'pages', $row,
true);
887 if (is_array($row)) {
888 $menuItems[$row[
'uid']] = $this->sys_page->getPageOverlay($row);
905 $menuItems = array();
907 if (!$specialValue) {
908 $specialValue = $tsfe->page[
'uid'];
910 if ($this->conf[
'special.'][
'setKeywords'] || $this->conf[
'special.'][
'setKeywords.']) {
911 $kw = isset($this->conf[
'special.'][
'setKeywords.']) ? $this->parent_cObj->stdWrap($this->conf[
'special.'][
'setKeywords'], $this->conf[
'special.'][
'setKeywords.']) : $this->conf[
'special.'][
'setKeywords'];
914 $value_rec = $this->sys_page->getPage($specialValue);
915 $kfieldSrc = $this->conf[
'special.'][
'keywordsField.'][
'sourceField'] ? $this->conf[
'special.'][
'keywordsField.'][
'sourceField'] :
'keywords';
917 $kw = trim($this->parent_cObj->keywords($value_rec[$kfieldSrc]));
920 $mode = $this->conf[
'special.'][
'mode'];
923 $sortField =
'starttime';
927 $sortField =
'lastUpdated';
930 $sortField =
'tstamp';
933 $sortField =
'crdate';
936 $sortField =
'SYS_LASTCHANGED';
946 $extraWhere =
' AND pages.uid<>' . $specialValue . ($this->conf[
'includeNotInMenu'] ?
'' :
' AND pages.nav_hide=0') . $this->
getDoktypeExcludeWhere();
947 if ($this->conf[
'special.'][
'excludeNoSearchPages']) {
948 $extraWhere .=
' AND pages.no_search=0';
951 $eLevel = $this->parent_cObj->getKey(isset($this->conf[
'special.'][
'entryLevel.'])
952 ? $this->parent_cObj->stdWrap($this->conf[
'special.'][
'entryLevel'], $this->conf[
'special.'][
'entryLevel.'])
953 : $this->conf[
'special.'][
'entryLevel'], $this->tmpl->rootLine
955 $startUid = (int)$this->tmpl->rootLine[$eLevel][
'uid'];
957 $kfield =
'keywords';
958 if ($this->conf[
'special.'][
'keywordsField']) {
959 list($kfield) = explode(
' ', trim($this->conf[
'special.'][
'keywordsField']));
962 if ($kw && $startUid) {
964 $id_list = $this->parent_cObj->getTreeList(-1 * $startUid, $depth - 1 + $bA, $bA - 1);
965 $kwArr = explode(
',', $kw);
966 $keyWordsWhereArr = array();
967 foreach ($kwArr as $word) {
970 $keyWordsWhereArr[] = $kfield .
' LIKE \'%' . $this->
getDatabaseConnection()->quoteStr($word,
'pages') .
'%\'';
973 $where = empty($keyWordsWhereArr) ?
'' :
'(' . implode(
' OR ', $keyWordsWhereArr) .
')';
974 $res = $this->parent_cObj->exec_getQuery(
'pages', array(
976 'uidInList' => $id_list,
977 'where' => $where . $extraWhere,
978 'orderBy' => $sortingField ?: $sortField .
' desc',
982 $tsfe->sys_page->versionOL(
'pages', $row,
true);
983 if (is_array($row)) {
984 $menuItems[$row[
'uid']] = $this->sys_page->getPageOverlay($row);
999 $menuItems = array();
1000 $range = isset($this->conf[
'special.'][
'range.'])
1001 ? $this->parent_cObj->stdWrap($this->conf[
'special.'][
'range'], $this->conf[
'special.'][
'range.'])
1002 : $this->conf[
'special.'][
'range'];
1003 $begin_end = explode(
'|', $range);
1004 $begin_end[0] = (int)$begin_end[0];
1008 $beginKey = $this->parent_cObj->getKey($begin_end[0], $this->tmpl->rootLine);
1009 $endKey = $this->parent_cObj->getKey($begin_end[1], $this->tmpl->rootLine);
1010 if ($endKey < $beginKey) {
1011 $endKey = $beginKey;
1013 $rl_MParray = array();
1014 foreach ($this->tmpl->rootLine as $k_rl => $v_rl) {
1016 if ($v_rl[
'_MP_PARAM'] && $v_rl[
'_MOUNT_OL']) {
1017 $rl_MParray[] = $v_rl[
'_MP_PARAM'];
1020 if ($k_rl >= $beginKey && $k_rl <= $endKey) {
1022 $menuItems[$temp_key] = $this->sys_page->getPage($v_rl[
'uid']);
1023 if (!empty($menuItems[$temp_key])) {
1025 if (!$menuItems[$temp_key][
'target']) {
1026 $menuItems[$temp_key][
'target'] = $this->conf[
'special.'][
'targets.'][$k_rl];
1027 $menuItems[$temp_key][
'_MP_PARAM'] = implode(
',', $rl_MParray);
1030 unset($menuItems[$temp_key]);
1034 if ($v_rl[
'_MP_PARAM'] && !$v_rl[
'_MOUNT_OL']) {
1035 $rl_MParray[] = $v_rl[
'_MP_PARAM'];
1039 if (isset($this->conf[
'special.'][
'reverseOrder']) && $this->conf[
'special.'][
'reverseOrder']) {
1040 $menuItems = array_reverse($menuItems);
1055 $menuItems = array();
1057 if (!$specialValue) {
1061 if ($specialValue != $this->tmpl->rootLine[0][
'uid']) {
1064 $value_rec = $this->sys_page->getPage($specialValue);
1066 if ($value_rec[
'pid']) {
1068 $recArr[
'up'] = $this->sys_page->getPage($value_rec[
'pid']);
1071 if ($recArr[
'up'][
'pid'] && $value_rec[
'pid'] != $this->tmpl->rootLine[0][
'uid']) {
1073 $recArr[
'index'] = $this->sys_page->getPage($recArr[
'up'][
'pid']);
1076 $additionalWhere .= ($this->conf[
'includeNotInMenu'] ?
'' :
' AND pages.nav_hide=0') . $this->
getDoktypeExcludeWhere();
1077 if ($this->conf[
'special.'][
'excludeNoSearchPages']) {
1078 $additionalWhere .=
' AND pages.no_search=0';
1081 $prevnext_menu = $this->
removeInaccessiblePages($this->sys_page->getMenu($value_rec[
'pid'],
'*', $sortingField, $additionalWhere));
1084 foreach ($prevnext_menu as $k_b => $v_b) {
1086 $recArr[
'next'] = $v_b;
1089 if ($v_b[
'uid'] == $specialValue) {
1091 $recArr[
'prev'] = $prevnext_menu[$lastKey];
1098 $recArr[
'first'] = reset($prevnext_menu);
1099 $recArr[
'last'] = end($prevnext_menu);
1102 if (is_array($recArr[
'index'])) {
1103 $prevnextsection_menu = $this->
removeInaccessiblePages($this->sys_page->getMenu($recArr[
'index'][
'uid'],
'*', $sortingField, $additionalWhere));
1106 foreach ($prevnextsection_menu as $k_b => $v_b) {
1108 $sectionRec_temp = $this->
removeInaccessiblePages($this->sys_page->getMenu($v_b[
'uid'],
'*', $sortingField, $additionalWhere));
1109 if (!empty($sectionRec_temp)) {
1110 $recArr[
'nextsection'] = reset($sectionRec_temp);
1111 $recArr[
'nextsection_last'] = end($sectionRec_temp);
1115 if ($v_b[
'uid'] == $value_rec[
'pid']) {
1117 $sectionRec_temp = $this->
removeInaccessiblePages($this->sys_page->getMenu($prevnextsection_menu[$lastKey][
'uid'],
'*', $sortingField, $additionalWhere));
1118 if (!empty($sectionRec_temp)) {
1119 $recArr[
'prevsection'] = reset($sectionRec_temp);
1120 $recArr[
'prevsection_last'] = end($sectionRec_temp);
1128 if ($this->conf[
'special.'][
'items.'][
'prevnextToSection']) {
1129 if (!is_array($recArr[
'prev']) && is_array($recArr[
'prevsection_last'])) {
1130 $recArr[
'prev'] = $recArr[
'prevsection_last'];
1132 if (!is_array($recArr[
'next']) && is_array($recArr[
'nextsection'])) {
1133 $recArr[
'next'] = $recArr[
'nextsection'];
1136 $items = explode(
'|', $this->conf[
'special.'][
'items']);
1138 foreach ($items as $k_b => $v_b) {
1139 $v_b = strtolower(trim($v_b));
1140 if ((
int)$this->conf[
'special.'][$v_b .
'.'][
'uid']) {
1141 $recArr[$v_b] = $this->sys_page->getPage((
int)$this->conf[
'special.'][$v_b .
'.'][
'uid']);
1143 if (is_array($recArr[$v_b])) {
1144 $menuItems[$c] = $recArr[$v_b];
1145 if ($this->conf[
'special.'][$v_b .
'.'][
'target']) {
1146 $menuItems[$c][
'target'] = $this->conf[
'special.'][$v_b .
'.'][
'target'];
1148 $tmpSpecialFields = $this->conf[
'special.'][$v_b .
'.'][
'fields.'];
1149 if (is_array($tmpSpecialFields)) {
1150 foreach ($tmpSpecialFields as $fk => $val) {
1151 $menuItems[$c][$fk] = $val;
1167 protected function analyzeCacheHashRequirements($queryString)
1170 if (!empty($parameters)) {
1173 $cHashParameters = $cacheHashCalculator->getRelevantParameters($queryString);
1174 if (count($cHashParameters) > 1) {
1175 $this->useCacheHash = (
1176 $GLOBALS[
'TYPO3_CONF_VARS'][
'FE'][
'disableNoCacheParameter'] ||
1177 !isset($parameters[
'no_cache']) ||
1178 !$parameters[
'no_cache']
1197 $includePage =
true;
1198 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'cms/tslib/class.tslib_menu.php'][
'filterMenuPages'])) {
1199 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'cms/tslib/class.tslib_menu.php'][
'filterMenuPages'] as $classRef) {
1202 throw new \UnexpectedValueException(
'$hookObject must implement interface ' . AbstractMenuFilterPagesHookInterface::class, 1269877402);
1204 $includePage = $includePage && $hookObject->processFilter($data, $banUidArray, $spacer, $this);
1207 if (!$includePage) {
1210 if ($data[
'_SAFE']) {
1215 ($this->mconf[
'SPC'] || !$spacer)
1216 && (!$data[
'nav_hide'] || $this->conf[
'includeNotInMenu'])
1223 $blockPage = $data[
'l18n_cfg'] & 1 && (!$tsfe->sys_language_uid || $tsfe->sys_language_uid && !$data[
'_PAGES_OVERLAY']);
1229 if (!$data[
'_PAGES_OVERLAY']) {
1236 if ($this->conf[
'protectLvar']) {
1237 $languageUid = (int)$tsfe->config[
'config'][
'sys_language_uid'];
1239 $olRec = $tsfe->sys_page->getPageOverlay($data[
'uid'], $languageUid);
1240 if (empty($olRec)) {
1243 $data[
'_ADD_GETVARS'] .=
'&L=0';
1272 if (!is_array($this->mconf[
'NO.']) && $this->mconf[
'NO']) {
1274 $this->mconf[
'NO.'] = array();
1276 $NOconf = $this->tmpl->splitConfArray($this->mconf[
'NO.'], $splitCount);
1279 if ($this->mconf[
'RO']) {
1280 $ROconf = $this->tmpl->splitConfArray($this->mconf[
'RO.'], $splitCount);
1284 if (!empty($this->mconf[
'IFSUB'])) {
1286 $IFSUBROconf = null;
1287 foreach ($NOconf as $key => $val) {
1290 if ($IFSUBconf === null) {
1291 $IFSUBconf = $this->tmpl->splitConfArray($this->mconf[
'IFSUB.'], $splitCount);
1292 if (!empty($this->mconf[
'IFSUBRO'])) {
1293 $IFSUBROconf = $this->tmpl->splitConfArray($this->mconf[
'IFSUBRO.'], $splitCount);
1297 if (isset($IFSUBconf[$key])) {
1298 $NOconf[$key] = $IFSUBconf[$key];
1303 $ROconf[$key] = !empty($IFSUBROconf[$key]) ? $IFSUBROconf[$key] : $IFSUBconf[$key];
1309 if (!empty($this->mconf[
'ACT'])) {
1313 foreach ($NOconf as $key => $val) {
1316 if ($ACTconf === null) {
1317 $ACTconf = $this->tmpl->splitConfArray($this->mconf[
'ACT.'], $splitCount);
1319 if (!empty($this->mconf[
'ACTRO'])) {
1320 $ACTROconf = $this->tmpl->splitConfArray($this->mconf[
'ACTRO.'], $splitCount);
1324 if (isset($ACTconf[$key])) {
1325 $NOconf[$key] = $ACTconf[$key];
1330 $ROconf[$key] = !empty($ACTROconf[$key]) ? $ACTROconf[$key] : $ACTconf[$key];
1337 if (!empty($this->mconf[
'ACTIFSUB'])) {
1338 $ACTIFSUBconf = null;
1339 $ACTIFSUBROconf = null;
1341 foreach ($NOconf as $key => $val) {
1344 if ($ACTIFSUBconf === null) {
1345 $ACTIFSUBconf = $this->tmpl->splitConfArray($this->mconf[
'ACTIFSUB.'], $splitCount);
1347 if (!empty($this->mconf[
'ACTIFSUBRO'])) {
1348 $ACTIFSUBROconf = $this->tmpl->splitConfArray($this->mconf[
'ACTIFSUBRO.'], $splitCount);
1352 if (isset($ACTIFSUBconf[$key])) {
1353 $NOconf[$key] = $ACTIFSUBconf[$key];
1358 $ROconf[$key] = !empty($ACTIFSUBROconf[$key]) ? $ACTIFSUBROconf[$key] : $ACTIFSUBconf[$key];
1365 if (!empty($this->mconf[
'CUR'])) {
1368 foreach ($NOconf as $key => $val) {
1373 if ($CURconf === null) {
1374 $CURconf = $this->tmpl->splitConfArray($this->mconf[
'CUR.'], $splitCount);
1375 if (!empty($this->mconf[
'CURRO'])) {
1376 $CURROconf = $this->tmpl->splitConfArray($this->mconf[
'CURRO.'], $splitCount);
1380 if (isset($CURconf[$key])) {
1381 $NOconf[$key] = $CURconf[$key];
1386 $ROconf[$key] = !empty($CURROconf[$key]) ? $CURROconf[$key] : $CURconf[$key];
1393 if (!empty($this->mconf[
'CURIFSUB'])) {
1394 $CURIFSUBconf = null;
1395 $CURIFSUBROconf = null;
1396 foreach ($NOconf as $key => $val) {
1399 if ($CURIFSUBconf === null) {
1400 $CURIFSUBconf = $this->tmpl->splitConfArray($this->mconf[
'CURIFSUB.'], $splitCount);
1402 if (!empty($this->mconf[
'CURIFSUBRO'])) {
1403 $CURIFSUBROconf = $this->tmpl->splitConfArray($this->mconf[
'CURIFSUBRO.'], $splitCount);
1407 if ($CURIFSUBconf[$key]) {
1408 $NOconf[$key] = $CURIFSUBconf[$key];
1413 $ROconf[$key] = !empty($CURIFSUBROconf[$key]) ? $CURIFSUBROconf[$key] : $CURIFSUBconf[$key];
1419 if (!empty($this->mconf[
'USR'])) {
1423 foreach ($NOconf as $key => $val) {
1426 if ($USRconf === null) {
1427 $USRconf = $this->tmpl->splitConfArray($this->mconf[
'USR.'], $splitCount);
1429 if (!empty($this->mconf[
'USRRO'])) {
1430 $USRROconf = $this->tmpl->splitConfArray($this->mconf[
'USRRO.'], $splitCount);
1434 if ($USRconf[$key]) {
1435 $NOconf[$key] = $USRconf[$key];
1440 $ROconf[$key] = !empty($USRROconf[$key]) ? $USRROconf[$key] : $USRconf[$key];
1446 if (!empty($this->mconf[
'SPC'])) {
1449 foreach ($NOconf as $key => $val) {
1452 if ($SPCconf === null) {
1453 $SPCconf = $this->tmpl->splitConfArray($this->mconf[
'SPC.'], $splitCount);
1456 if (isset($SPCconf[$key])) {
1457 $NOconf[$key] = $SPCconf[$key];
1463 if (!empty($this->mconf[
'USERDEF1'])) {
1464 $USERDEF1conf = null;
1465 $USERDEF1ROconf = null;
1467 foreach ($NOconf as $key => $val) {
1470 if ($USERDEF1conf === null) {
1471 $USERDEF1conf = $this->tmpl->splitConfArray($this->mconf[
'USERDEF1.'], $splitCount);
1473 if (!empty($this->mconf[
'USERDEF1RO'])) {
1474 $USERDEF1ROconf = $this->tmpl->splitConfArray($this->mconf[
'USERDEF1RO.'], $splitCount);
1478 if (isset($USERDEF1conf[$key])) {
1479 $NOconf[$key] = $USERDEF1conf[$key];
1484 $ROconf[$key] = !empty($USERDEF1ROconf[$key]) ? $USERDEF1ROconf[$key] : $USERDEF1conf[$key];
1490 if (!empty($this->mconf[
'USERDEF2'])) {
1491 $USERDEF2conf = null;
1492 $USERDEF2ROconf = null;
1494 foreach ($NOconf as $key => $val) {
1497 if ($USERDEF2conf) {
1498 $USERDEF2conf = $this->tmpl->splitConfArray($this->mconf[
'USERDEF2.'], $splitCount);
1500 if (!empty($this->mconf[
'USERDEF2RO'])) {
1501 $USERDEF2ROconf = $this->tmpl->splitConfArray($this->mconf[
'USERDEF2RO.'], $splitCount);
1505 if (isset($USERDEF2conf[$key])) {
1506 $NOconf[$key] = $USERDEF2conf[$key];
1511 $ROconf[$key] = !empty($USERDEF2ROconf[$key]) ? $USERDEF2ROconf[$key] : $USERDEF2conf[$key];
1516 return array($NOconf, $ROconf);
1529 public function link($key, $altTarget =
'', $typeOverride =
'')
1533 $MP_params = $MP_var ?
'&MP=' . rawurlencode($MP_var) :
'';
1535 if ($this->mconf[
'overrideId'] || $this->menuArr[$key][
'overrideId']) {
1536 $overrideArray = array();
1538 $overrideArray[
'uid'] = $this->mconf[
'overrideId'] ?: $this->menuArr[$key][
'overrideId'];
1539 $overrideArray[
'alias'] =
'';
1543 $overrideArray =
'';
1547 $mainTarget = $altTarget;
1548 }
elseif ($this->mconf[
'target.']) {
1549 $mainTarget = $this->parent_cObj->stdWrap($this->mconf[
'target'], $this->mconf[
'target.']);
1551 $mainTarget = $this->mconf[
'target'];
1554 $addParams = $this->mconf[
'addParams'] . $MP_params;
1555 if ($this->mconf[
'collapse'] && $this->
isActive($this->menuArr[$key][
'uid'], $this->
getMPvar($key))) {
1556 $thePage = $this->sys_page->getPage($this->menuArr[$key][
'pid']);
1557 $addParams .= $this->menuArr[$key][
'_ADD_GETVARS'];
1558 $LD = $this->
menuTypoLink($thePage, $mainTarget,
'',
'', $overrideArray, $addParams, $typeOverride);
1560 $addParams .= $this->I[
'val'][
'additionalParams'] . $this->menuArr[$key][
'_ADD_GETVARS'];
1561 $LD = $this->
menuTypoLink($this->menuArr[$key], $mainTarget,
'',
'', $overrideArray, $addParams, $typeOverride);
1567 $LD[
'totalURL'] = $this->parent_cObj->typoLink_URL(array(
'parameter' => $this->menuArr[$key][
'url']));
1570 $LD[
'totalURL'] = $this->parent_cObj->typoLink_URL(array(
'parameter' => $this->
getSysPage()->getExtURL($this->menuArr[$key])));
1581 $shortcut = $tsfe->getPageShortcut(
1582 $menuItem[
'shortcut'],
1583 $menuItem[
'shortcut_mode'],
1591 if (!is_array($shortcut)) {
1595 $LD[
'totalURL'] = $this->parent_cObj->typoLink_URL(array(
1596 'parameter' => $shortcut[
'uid'],
1597 'additionalParams' => $addParams . $this->I[
'val'][
'additionalParams'] . $menuItem[
'_ADD_GETVARS'],
1598 'linkAccessRestrictedPages' => $this->mconf[
'showAccessRestrictedPages'] && $this->mconf[
'showAccessRestrictedPages'] !==
'NONE'
1602 $pageData = $shortcut;
1603 $pageData[
'_SHORTCUT_PAGE_UID'] = $this->menuArr[$key][
'uid'];
1605 $pageData = $this->menuArr[$key];
1610 if ($this->menuArr[$key][
'_OVERRIDE_HREF']) {
1611 $LD[
'totalURL'] = $this->menuArr[$key][
'_OVERRIDE_HREF'];
1612 if ($this->menuArr[$key][
'_OVERRIDE_TARGET']) {
1613 $LD[
'target'] = $this->menuArr[$key][
'_OVERRIDE_TARGET'];
1618 if ($this->mconf[
'JSWindow']) {
1619 $conf = $this->mconf[
'JSWindow.'];
1620 $url = $LD[
'totalURL'];
1621 $LD[
'totalURL'] =
'#';
1622 $onClick =
'openPic('
1624 .
'\'' . (
$conf[
'newWindow'] ? md5(
$url) :
'theNewPage') .
'\',
'
1625 . GeneralUtility::quoteJSvalue($conf['params
']) . ');
return false;
';
1626 $tsfe->setJS('openPic
');
1628 // look for type and popup
1629 // following settings are valid in field target:
1630 // 230 will add type=230 to the link
1631 // 230 500x600 will add type=230 to the link and open in popup window with 500x600 pixels
1632 // 230 _blank will add type=230 to the link and open with target "_blank"
1633 // 230x450:resizable=0,location=1 will open in popup window with 500x600 pixels with settings "resizable=0,location=1"
1635 $targetIsType = $LD['target
'] && MathUtility::canBeInterpretedAsInteger($LD['target
']) ? (int)$LD['target
'] : false;
1636 if (preg_match('/([0-9]+[\\s])?(([0-9]+)x([0-9]+))?(:.+)?/s
', $LD['target
'], $matches) || $targetIsType) {
1638 if ((int)$matches[1] || $targetIsType) {
1639 $LD['totalURL
'] = $this->parent_cObj->URLqMark($LD['totalURL
'], '&type=
' . ($targetIsType ?: (int)$matches[1]));
1640 $LD['target
'] = $targetIsType ? '' : trim(substr($LD['target
'], strlen($matches[1]) + 1));
1642 // Open in popup window?
1643 if ($matches[3] && $matches[4]) {
1644 $JSparamWH = 'width=
' . $matches[3] . ',height=
' . $matches[4] . ($matches[5] ? ',
' . substr($matches[5], 1) : '');
1645 $onClick = 'vHWin=window.open(
'
1646 . GeneralUtility::quoteJSvalue($tsfe->baseUrlWrap($LD['totalURL
']))
1656 $list[
'HREF'] = (string)$LD[
'totalURL'] !==
'' ? $LD[
'totalURL'] : $tsfe->baseUrl;
1657 $list[
'TARGET'] = $LD[
'target'];
1658 $list[
'onClick'] = $onClick;
1673 protected function determineOriginalShortcutPage(array $page)
1677 $this->getTypoScriptFrontendController()->sys_language_uid > 0
1678 && empty($page[
'shortcut'])
1679 && !empty($page[
'uid'])
1680 && !empty($page[
'_PAGES_OVERLAY'])
1681 && !empty($page[
'_PAGES_OVERLAY_UID'])
1684 $originalPage = $this->sys_page->getRawRecord(
'pages', $page[
'uid']);
1686 if ($originalPage[
'shortcut_mode'] === $page[
'shortcut_mode'] && !empty($originalPage[
'shortcut'])) {
1687 $page[
'shortcut'] = $originalPage[
'shortcut'];
1703 public function changeLinksForAccessRestrictedPages(&$LD, $page, $mainTarget, $typeOverride)
1706 if ($this->mconf[
'showAccessRestrictedPages'] && $this->mconf[
'showAccessRestrictedPages'] !==
'NONE' && !$this->getTypoScriptFrontendController()->checkPageGroupAccess($page)) {
1707 $thePage = $this->sys_page->getPage($this->mconf[
'showAccessRestrictedPages']);
1708 $addParams = str_replace(
1714 rawurlencode($LD[
'totalURL']),
1715 isset($page[
'_SHORTCUT_PAGE_UID']) ? $page[
'_SHORTCUT_PAGE_UID'] : $page[
'uid']
1717 $this->mconf[
'showAccessRestrictedPages.'][
'addParams']
1719 $LD = $this->menuTypoLink($thePage, $mainTarget,
'',
'',
'', $addParams, $typeOverride);
1731 public function subMenu($uid, $objSuffix =
'')
1735 if (is_array($this->menuArr[$this->I[
'key']][
'_SUB_MENU']) && !empty($this->menuArr[$this->I[
'key']][
'_SUB_MENU'])) {
1736 $altArray = $this->menuArr[$this->I[
'key']][
'_SUB_MENU'];
1739 $menuType = $this->conf[($this->menuNumber + 1) . $objSuffix];
1741 if (isset($this->mconf[
'expAll.'])) {
1742 $this->mconf[
'expAll'] = $this->parent_cObj->stdWrap($this->mconf[
'expAll'], $this->mconf[
'expAll.']);
1744 if (($this->mconf[
'expAll'] || $this->isNext($uid, $this->getMPvar($this->I[
'key'])) || is_array($altArray)) && !$this->mconf[
'sectionIndex']) {
1748 $submenu = $menuObjectFactory->getMenuObjectByType($menuType);
1749 $submenu->entryLevel = $this->entryLevel + 1;
1750 $submenu->rL_uidRegister = $this->rL_uidRegister;
1751 $submenu->MP_array = $this->MP_array;
1752 if ($this->menuArr[$this->I[
'key']][
'_MP_PARAM']) {
1753 $submenu->MP_array[] = $this->menuArr[$this->I[
'key']][
'_MP_PARAM'];
1756 $submenu->parent_cObj = $this->parent_cObj;
1758 if (is_array($altArray)) {
1759 $submenu->alternativeMenuTempArray = $altArray;
1761 if ($submenu->start($this->tmpl, $this->sys_page, $uid, $this->conf, $this->menuNumber + 1, $objSuffix)) {
1762 $submenu->makeMenu();
1764 $tsfe = $this->getTypoScriptFrontendController();
1765 $tempCountMenuObj = $tsfe->register[
'count_MENUOBJ'];
1767 $tsfe->register[
'count_MENUOBJ'] = 0;
1768 $content = $submenu->writeMenu();
1770 $tsfe->register[
'count_MENUOBJ'] = $tempCountMenuObj;
1771 $tsfe->register[
'count_menuItems'] = count($this->menuArr);
1774 }
catch (Exception\NoSuchMenuTypeException $e) {
1789 public function isNext($uid, $MPvar =
'')
1792 if (!empty($this->alwaysActivePIDlist) && in_array((
int)$uid, $this->alwaysActivePIDlist,
true)) {
1795 $testUid = $uid . ($MPvar ?
':' . $MPvar :
'');
1796 if ($uid && $testUid == $this->nextActive) {
1810 public function isActive($uid, $MPvar =
'')
1813 if (!empty($this->alwaysActivePIDlist) && in_array((
int)$uid, $this->alwaysActivePIDlist,
true)) {
1816 $testUid = $uid . ($MPvar ?
':' . $MPvar :
'');
1817 if ($uid && in_array(
'ITEM:' . $testUid, $this->rL_uidRegister,
true)) {
1831 public function isCurrent($uid, $MPvar =
'')
1833 $testUid = $uid . ($MPvar ?
':' . $MPvar :
'');
1834 return $uid && end($this->rL_uidRegister) ===
'ITEM:' . $testUid;
1845 public function isSubMenu($uid)
1849 $mount_info = $this->sys_page->getMountPointInfo($uid);
1850 if (is_array($mount_info)) {
1851 $uid = $mount_info[
'mount_pid'];
1853 $recs = $this->sys_page->getMenu($uid,
'uid,pid,doktype,mount_pid,mount_pid_ol,nav_hide,shortcut,shortcut_mode,l18n_cfg');
1854 $hasSubPages =
false;
1855 $bannedUids = $this->getBannedUids();
1856 foreach ($recs as $theRec) {
1863 if ($theRec[
'nav_hide'] && !$this->conf[
'includeNotInMenu']) {
1874 if ($this->getTypoScriptFrontendController()->sys_language_uid && $hideIfNotTranslated && !$theRec[
'_PAGES_OVERLAY']) {
1878 if (in_array($theRec[
'uid'], $bannedUids)) {
1881 $hasSubPages =
true;
1884 return $hasSubPages;
1896 public function isItemState($kind, $key)
1900 if ($this->menuArr[$key][
'ITEM_STATE']) {
1901 if ((
string)$this->menuArr[$key][
'ITEM_STATE'] === (
string)$kind) {
1907 $natVal = (bool)$this->menuArr[$key][
'isSpacer'];
1910 $natVal = $this->isSubMenu($this->menuArr[$key][
'uid']);
1913 $natVal = $this->isActive($this->menuArr[$key][
'uid'], $this->getMPvar($key));
1916 $natVal = $this->isActive($this->menuArr[$key][
'uid'], $this->getMPvar($key)) && $this->isSubMenu($this->menuArr[$key][
'uid']);
1919 $natVal = $this->isCurrent($this->menuArr[$key][
'uid'], $this->getMPvar($key));
1922 $natVal = $this->isCurrent($this->menuArr[$key][
'uid'], $this->getMPvar($key)) && $this->isSubMenu($this->menuArr[$key][
'uid']);
1925 $natVal = (bool)$this->menuArr[$key][
'fe_group'];
1939 public function accessKey($title)
1941 $tsfe = $this->getTypoScriptFrontendController();
1944 $title = trim(strip_tags($title));
1945 $titleLen = strlen($title);
1946 for ($a = 0; $a < $titleLen; $a++) {
1947 $key = strtoupper(substr($title, $a, 1));
1948 if (preg_match(
'/[A-Z]/', $key) && !isset($tsfe->accessKey[$key])) {
1949 $tsfe->accessKey[$key] = 1;
1950 $result[
'code'] =
' accesskey="' . $key .
'"';
1951 $result[
'alt'] =
' (ALT+' . $key .
')';
1952 $result[
'key'] = $key;
1968 public function userProcess($mConfKey, $passVar)
1970 if ($this->mconf[$mConfKey]) {
1971 $funcConf = $this->mconf[$mConfKey .
'.'];
1972 $funcConf[
'parentObj'] = $this;
1973 $passVar = $this->parent_cObj->callUserFunction($this->mconf[$mConfKey], $funcConf, $passVar);
1984 public function setATagParts()
1986 $params = trim($this->I[
'val'][
'ATagParams']) . $this->I[
'accessKey'][
'code'];
1987 $params = $params !==
'' ?
' ' . $params :
'';
1989 $this->I[
'A2'] =
'</a>';
2000 public function getPageTitle($title, $nav_title)
2002 return trim($nav_title) !==
'' ? $nav_title : $title;
2012 public function getMPvar($key)
2014 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'FE'][
'enable_mount_pids']) {
2015 $localMP_array = $this->MP_array;
2017 if ($this->menuArr[$key][
'_MP_PARAM']) {
2018 $localMP_array[] = $this->menuArr[$key][
'_MP_PARAM'];
2020 return !empty($localMP_array) ? implode(
',', $localMP_array) :
'';
2031 public function getDoktypeExcludeWhere()
2033 return $this->doktypeExcludeList ?
' AND pages.doktype NOT IN (' . $this->doktypeExcludeList .
')' :
'';
2042 public function getBannedUids()
2044 $excludeUidList = isset($this->conf[
'excludeUidList.'])
2045 ? $this->parent_cObj->stdWrap($this->conf[
'excludeUidList'], $this->conf[
'excludeUidList.'])
2046 : $this->conf[
'excludeUidList'];
2048 if (!trim($excludeUidList)) {
2052 $banUidList = str_replace(
'current', $this->getTypoScriptFrontendController()->page[
'uid'], $excludeUidList);
2068 public function menuTypoLink($page, $oTarget, $no_cache, $script, $overrideArray =
'', $addParams =
'', $typeOverride =
'')
2071 'parameter' => is_array($overrideArray) && $overrideArray[
'uid'] ? $overrideArray[
'uid'] : $page[
'uid']
2074 $conf[
'parameter'] .=
',' . (int)$typeOverride;
2077 $conf[
'additionalParams'] = $addParams;
2080 $conf[
'no_cache'] =
true;
2081 }
elseif ($this->useCacheHash) {
2082 $conf[
'useCacheHash'] =
true;
2085 $conf[
'target'] = $oTarget;
2087 if ($page[
'sectionIndex_uid']) {
2088 $conf[
'section'] = $page[
'sectionIndex_uid'];
2090 $conf[
'linkAccessRestrictedPages'] = $this->mconf[
'showAccessRestrictedPages'] && $this->mconf[
'showAccessRestrictedPages'] !==
'NONE';
2091 $this->parent_cObj->typoLink(
'|', $conf);
2092 $LD = $this->parent_cObj->lastTypoLinkLD;
2093 $LD[
'totalURL'] = $this->parent_cObj->lastTypoLinkUrl;
2108 protected function sectionIndex($altSortField, $pid = null)
2110 $pid = (int)($pid ?: $this->
id);
2111 $basePageRow = $this->sys_page->getPage($pid);
2112 if (!is_array($basePageRow)) {
2115 $tsfe = $this->getTypoScriptFrontendController();
2116 $configuration = $this->mconf[
'sectionIndex.'];
2118 if (trim($configuration[
'useColPos']) !==
'' || is_array($configuration[
'useColPos.'])) {
2119 $useColPos = $tsfe->cObj->stdWrap($configuration[
'useColPos'], $configuration[
'useColPos.']);
2120 $useColPos = (int)$useColPos;
2122 $selectSetup = array(
2123 'pidInList' => $pid,
2124 'orderBy' => $altSortField,
2125 'languageField' =>
'sys_language_uid',
2126 'where' => $useColPos >= 0 ?
'colPos=' . $useColPos :
''
2128 if ($basePageRow[
'content_from_pid']) {
2131 $selectSetup[
'pidInList'] = $basePageRow[
'content_from_pid'];
2133 $resource = $this->parent_cObj->exec_getQuery(
'tt_content', $selectSetup);
2135 $message =
'SectionIndex: Query to fetch the content elements failed!';
2136 throw new \UnexpectedValueException($message, 1337334849);
2139 while ($row = $this->getDatabaseConnection()->sql_fetch_assoc($resource)) {
2140 $this->sys_page->versionOL(
'tt_content', $row);
2141 if ($tsfe->sys_language_contentOL && $basePageRow[
'_PAGES_OVERLAY_LANGUAGE']) {
2142 $row = $this->sys_page->getRecordOverlay(
'tt_content', $row, $basePageRow[
'_PAGES_OVERLAY_LANGUAGE'], $tsfe->sys_language_contentOL);
2144 if ($this->mconf[
'sectionIndex.'][
'type'] !==
'all') {
2145 $doIncludeInSectionIndex = $row[
'sectionIndex'] >= 1;
2146 $doHeaderCheck = $this->mconf[
'sectionIndex.'][
'type'] ===
'header';
2147 $isValidHeader = ((int)$row[
'header_layout'] !== 100 || !empty($this->mconf[
'sectionIndex.'][
'includeHiddenHeaders'])) && trim($row[
'header']) !==
'';
2148 if (!$doIncludeInSectionIndex || $doHeaderCheck && !$isValidHeader) {
2152 if (is_array($row)) {
2154 $result[$uid] = $basePageRow;
2155 $result[$uid][
'title'] = $row[
'header'];
2156 $result[$uid][
'nav_title'] = $row[
'header'];
2158 $result[$uid][
'nav_hide'] = 0;
2159 $result[$uid][
'subtitle'] = $row[
'subheader'];
2160 $result[$uid][
'starttime'] = $row[
'starttime'];
2161 $result[$uid][
'endtime'] = $row[
'endtime'];
2162 $result[$uid][
'fe_group'] = $row[
'fe_group'];
2163 $result[$uid][
'media'] = $row[
'media'];
2164 $result[$uid][
'header_layout'] = $row[
'header_layout'];
2165 $result[$uid][
'bodytext'] = $row[
'bodytext'];
2166 $result[$uid][
'image'] = $row[
'image'];
2167 $result[$uid][
'sectionIndex_uid'] = $uid;
2170 $this->getDatabaseConnection()->sql_free_result($resource);
2179 public function getSysPage()
2181 return $this->sys_page;
2189 public function getParentContentObject()
2191 return $this->parent_cObj;
2197 protected function getDatabaseConnection()
2205 protected function getTypoScriptFrontendController()
2213 protected function getTimeTracker()
2221 protected function getCache()