1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 03:40:37 +02:00

Introduce e107::setErrorPage() for delivering an error page to the browser.

This commit is contained in:
lonalore
2016-12-15 10:06:54 +01:00
parent d9f3d487f7
commit 2667537fd1
4 changed files with 305 additions and 199 deletions

View File

@@ -48,28 +48,7 @@ class core_system_error_controller extends eController
*/
public function actionForbidden()
{
$response = $this->getResponse();
$response->setRenderMod('error403');
$response->addHeader('HTTP/1.0 403 Forbidden');
$tp = e107::getParser();
$tpl = e107::getCoreTemplate('error', '403');
$sc = e107::getScBatch('error');
$title = LAN_ERROR_TITLE;
$subtitle = LAN_ERROR_4;
$caption = LAN_ERROR_45;
$content = LAN_ERROR_5 . '<br/>' . LAN_ERROR_6 . '<br/><br/>' . LAN_ERROR_2;
$sc->setVars(array(
'title' => $title,
'subtitle' => $subtitle,
'caption' => $caption,
'content' => $content,
));
$body = $tp->parseTemplate($tpl, true, $sc);
$this->addBody($body);
e107::setErrorPage(403);
}
/**
@@ -77,28 +56,7 @@ class core_system_error_controller extends eController
*/
public function actionNotfound()
{
$response = $this->getResponse();
$response->setRenderMod('error404');
$response->addHeader('HTTP/1.0 404 Not Found');
$tp = e107::getParser();
$tpl = e107::getCoreTemplate('error', '404');
$sc = e107::getScBatch('error');
$title = LAN_ERROR_TITLE;
$subtitle = LAN_ERROR_7;
$caption = LAN_ERROR_45;
$content = LAN_ERROR_21 . '<br/>' . LAN_ERROR_9;
$sc->setVars(array(
'title' => $title,
'subtitle' => $subtitle,
'caption' => $caption,
'content' => $content,
));
$body = $tp->parseTemplate($tpl, true, $sc);
$this->addBody($body);
e107::setErrorPage(404);
}
}