Feature #17567 » tslib_fe.diff
typo3/sysext/cms/tslib/class.tslib_fe.php (working copy) | ||
---|---|---|
*/
|
||
function getPageAndRootline($itera=20) {
|
||
$this->page = $this->sys_page->getPage($this->id);
|
||
|
||
if (!count($this->page)
|
||
&& is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['getPageFail'])
|
||
) {
|
||
$nOriginalId = $this->id;
|
||
$getPageFailHooks =& $this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['getPageFail'];
|
||
$hookParameters = array(
|
||
'id_orig' => $nOriginalId,
|
||
'id' => &$this->id,
|
||
'page' => &$this->page
|
||
);
|
||
$hookReference = $this;
|
||
foreach ($getPageFailHooks as $hookFunction) {
|
||
t3lib_div::callUserFunction($hookFunction, $hookParameters, $hookReference);
|
||
}
|
||
}
|
||
|
||
if (!count($this->page)) {
|
||
// If no page, we try to find the page before in the rootLine.
|
||
$this->pageNotFound=1; // Page is 'not found' in case the id itself was not an accessible page. code 1
|
||
... | ... | |
exit;
|
||
}
|
||
} else {
|
||
if ($itera>0) {
|
||
$this->pageNotFound=0;
|
||
$el = reset($this->rootLine);
|
||
$this->id = $el['uid'];
|
||
$this->getPageAndRootline($itera-1);
|
||
} else {
|
||
$message = 'The requested page was not accessible!';
|
||
header('HTTP/1.0 503 Service Temporarily Unavailable');
|
||
t3lib_div::sysLog($message, 'cms', t3lib_div::SYSLOG_SEVERITY_ERROR);
|
||
$this->printError($message);
|
||
exit;
|
||
}
|
||
$this->page = '';
|
||
if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['getPageFail'])
|
||
) {
|
||
$nOriginalId = $this->id;
|
||
$getPageFailHooks =& $this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['getPageFail'];
|
||
$hookParameters = array(
|
||
'id_orig' => $nOriginalId,
|
||
'id' => &$this->id,
|
||
'page' => &$this->page,
|
||
'inparent' => true
|
||
);
|
||
$hookReference = $this;
|
||
foreach ($getPageFailHooks as $hookFunction) {
|
||
t3lib_div::callUserFunction($hookFunction, $hookParameters, $hookReference);
|
||
}
|
||
}
|
||
|
||
if ($this->page) {
|
||
$this->getPageAndRootline($itera-1);
|
||
} else {
|
||
if ($itera>0) {
|
||
$this->pageNotFound=0;
|
||
$el = reset($this->rootLine);
|
||
$this->id = $el['uid'];
|
||
$this->getPageAndRootline($itera-1);
|
||
} else {
|
||
$message = 'The requested page was not accessible!';
|
||
header('HTTP/1.0 503 Service Temporarily Unavailable');
|
||
t3lib_div::sysLog($message, 'cms', t3lib_div::SYSLOG_SEVERITY_ERROR);
|
||
$this->printError($message);
|
||
exit;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|