diff --git a/class.templater.php b/class.templater.php index 42e1f6a..5b8cd87 100644 --- a/class.templater.php +++ b/class.templater.php @@ -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; } diff --git a/include.forms.php b/include.forms.php index bfdce86..6c68071 100644 --- a/include.forms.php +++ b/include.forms.php @@ -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();