protected getPathCacheEntryAfterExcludedPages ( string $segment, array $pages, string $pagesEnableFields, array &$shortcutPages ) : DmitryDulepov\Realurl\Cache\PathCacheEntry | ||
$segment | string | |
$pages | array | |
$pagesEnableFields | string | |
$shortcutPages | array | |
Résultat | DmitryDulepov\Realurl\Cache\PathCacheEntry | | NULL |
protected function getPathCacheEntryAfterExcludedPages($segment, array $pages, $pagesEnableFields, array &$shortcutPages)
{
$ids = array();
$result = null;
$newPages = $pages;
while ($newPages) {
foreach ($newPages as $page) {
while ($page['doktype'] == PageRepository::DOKTYPE_MOUNTPOINT && $page['mount_pid_ol'] == 1) {
$originalUid = $page['uid'];
$page = $this->pageRepository->getPage($page['mount_pid']);
if (!is_array($page)) {
$this->tsfe->pageNotFoundAndExit('[realurl] Broken mount point at page with uid=' . $originalUid);
}
}
if ($page['tx_realurl_exclude']) {
$ids[] = $page['uid'];
}
}
if ($ids) {
// No sorting here because pages can be on any level
$children = $this->databaseConnection->exec_SELECTgetRows('*', 'pages', 'pid IN (' . implode(',', $ids) . ')' . ' AND doktype NOT IN (' . $this->disallowedDoktypes . ')' . $pagesEnableFields);
$languageExceptionUids = (string) $this->configuration->get('pagePath/languageExceptionUids');
if ($this->detectedLanguageId > 0 && (empty($languageExceptionUids) || !GeneralUtility::inList($languageExceptionUids, $this->detectedLanguageId))) {
foreach ($children as $key => $child) {
$children[$key] = $this->pageRepository->getPageOverlay($child, (int) $this->detectedLanguageId);
}
}
$result = $this->createPathCacheEntry($segment, $children, $shortcutPages);
if ($result) {
break;
}
$newPages = $children;
$ids = array();
} else {
break;
}
}
return $result;
}