Use the new template parser for the errorhandler component

develop
Sven Slootweg 12 years ago
parent 4c6f46efe6
commit 9d08020a8d

@ -42,30 +42,27 @@ class CPHPErrorHandler
{ {
global $locale; global $locale;
$template['error'] = new Templater();
switch($this->sErrorType) switch($this->sErrorType)
{ {
case CPHP_ERRORHANDLER_TYPE_ERROR: case CPHP_ERRORHANDLER_TYPE_ERROR:
$template['error']->Load("errorhandler.error"); $template = "errorhandler.error";
break; break;
case CPHP_ERRORHANDLER_TYPE_INFO: case CPHP_ERRORHANDLER_TYPE_INFO:
$template['error']->Load("errorhandler.info"); $template = "errorhandler.info";
break; break;
case CPHP_ERRORHANDLER_TYPE_WARNING: case CPHP_ERRORHANDLER_TYPE_WARNING:
$template['error']->Load("errorhandler.warning"); $template = "errorhandler.warning";
break; break;
case CPHP_ERRORHANDLER_TYPE_SUCCESS: case CPHP_ERRORHANDLER_TYPE_SUCCESS:
$template['error']->Load("errorhandler.success"); $template = "errorhandler.success";
break; break;
default:
return false;
} }
$template['error']->Localize($locale->strings); return Templater::AdvancedParse($template, $locale->strings, array(
$template['error']->Compile(array(
'title' => $this->sTitle, 'title' => $this->sTitle,
'message' => $this->sMessage 'message' => $this->sMessage
)); ));
return $template['error']->Render();
} }
} }

Loading…
Cancel
Save