Templater and form handler updates

feature/formhandler
Sven Slootweg 10 years ago
parent 2db9f1bb7f
commit c0b077dc9f

@ -93,7 +93,7 @@ class NewTemplater
public function Load($template_name)
{
global $template_cache;
global $template_cache, $cphp_config;
if(isset($template_cache[$template_name]))
{
@ -101,7 +101,8 @@ class NewTemplater
}
else
{
$this->template = file_get_contents("templates/{$template_name}.tpl");
$template_extension = (empty($cphp_config->templates->extension)) ? "tpl" : $cphp_config->templates->extension;
$this->template = file_get_contents("templates/{$template_name}.{$template_extension}");
$template_cache[$template_name] = $this->template;
}

@ -61,6 +61,20 @@ class FormValidationException extends Exception {
return $results;
}
public function GetErrorMessages()
{
$flattened = $this->GetErrors();
$results = array();
foreach($flattened as $exception)
{
$results[] = $exception["error_msg"];
}
return $results;
}
public function GetOffendingKeys()
{
$results = array();

Loading…
Cancel
Save