# geschrieben wurde.\r
#\r
# Autor: Patrick Canterino <patrick@patshaping.de>\r
-# Letzte Aenderung: 3.12.2011\r
+# Letzte Aenderung: 17.12.2011\r
#\r
# Copyright (C) 2002-2011 Patrick Canterino\r
#\r
#\r
# Rueckgabe: Bearbeiteter Text (String)\r
\r
-function &plain(&$text,$linebreak='<br>') {\r
+function plain($text,$linebreak='<br>') {\r
$htmltext = htmlspecialchars($text);\r
$htmltext = preg_replace("/\015\012|\012|\015/",$linebreak,$htmltext);\r
\r
#\r
# Parameter: Fehlermeldung\r
\r
-function show_fatal(&$errmsg) {\r
+function show_fatal($errmsg,$vars=array()) {\r
global $tpl_fatal;\r
\r
$tpl = new Template;\r
$tpl->read_file($tpl_fatal);\r
\r
- $tpl->fillin('ERROR',$errmsg);\r
+ if(sizeof($vars) > 0) {\r
+ while(list($var,$content) = each($vars)) {\r
+ $errmsg = str_replace('{'.$var.'}',htmlspecialchars($content),$errmsg);\r
+ }\r
+ }\r
+\r
+ $tpl->set_var('ERROR',$errmsg);\r
+\r
+ $tpl->parse();\r
\r
print $tpl->get_template();\r
exit;\r
#\r
# Parameter: Fehlermeldung\r
\r
-function show_user_error(&$errmsg) {\r
+function show_user_error($errmsg) {\r
global $captcha_enable, $email, $name, $subject, $text, $user_fields, $tpl_user_error;\r
\r
$tpl = new Template;\r
reset($user_fields);\r
\r
while(list($user_field,$user_field_data) = each($user_fields)) {\r
- $tpl->set_var($user_field_data['tpl_var'],htmlspecialchars(formdata($user_field)));\r
+ if(isset($user_field_data['tpl_var']) && $user_field_data['tpl_var'] != '') {\r
+ $tpl_var = $user_field_data['tpl_var'];\r
+ }\r
+ else {\r
+ $tpl_var = 'USER_'.$user_field;\r
+ }\r
+\r
+ $tpl->set_var($tpl_var,htmlspecialchars(formdata($user_field)));\r
}\r
\r
$tpl->parse();\r