From 4f0bbd8be41a28d2342c69e6e2be6429e060c5e6 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Sat, 12 May 2012 02:54:57 +0200 Subject: [PATCH] Updated CPHPErrorHandler to use new template format --- .../cphp/components/component.errorhandler.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/frontend/cphp/components/component.errorhandler.php b/frontend/cphp/components/component.errorhandler.php index 7a53977..709ebb1 100644 --- a/frontend/cphp/components/component.errorhandler.php +++ b/frontend/cphp/components/component.errorhandler.php @@ -42,31 +42,26 @@ class CPHPErrorHandler { global $locale; - $template['error'] = new Templater(); - switch($this->sErrorType) { case CPHP_ERRORHANDLER_TYPE_ERROR: - $template['error']->Load("errorhandler.error"); + $template = "errorhandler.error"; break; case CPHP_ERRORHANDLER_TYPE_INFO: - $template['error']->Load("errorhandler.info"); + $template = "errorhandler.info"; break; case CPHP_ERRORHANDLER_TYPE_WARNING: - $template['error']->Load("errorhandler.warning"); + $template = "errorhandler.warning"; break; case CPHP_ERRORHANDLER_TYPE_SUCCESS: - $template['error']->Load("errorhandler.success"); + $template = "errorhandler.success"; break; } - $template['error']->Localize($locale->strings); - $template['error']->Compile(array( + return Templater::AdvancedParse($template, $locale->strings, array( 'title' => $this->sTitle, 'message' => $this->sMessage )); - - return $template['error']->Render(); } } ?>