more factorization in error messages: make errstr() work with our new messaging system

This commit is contained in:
Antoine Beaupré 2008-01-22 04:11:00 +00:00
parent d63da16fcc
commit de54a15ca0
1 changed files with 7 additions and 7 deletions

View File

@ -87,7 +87,12 @@ class m_err {
* *
*/ */
function errstr() { function errstr() {
return sprintf(_("err_".$this->clsid."_".$this->error),$this->param); if (is_string($this->error)) {
$msg = sprintf(_("err_".$this->clsid."_generic: ")._($this->error)."\n",$this->param);
} else {
$msg = sprintf(_("err_".$this->clsid."_".$this->error)."\n",$this->param);
}
return $msg;
} }
/** /**
@ -104,12 +109,7 @@ class m_err {
if ($f) { if ($f) {
fputs($f,date("d/m/Y H:i:s")." - ERROR - "); fputs($f,date("d/m/Y H:i:s")." - ERROR - ");
fputs($f,$mem->user["login"]." - "); fputs($f,$mem->user["login"]." - ");
if (is_string($this->error)) { fputs($f,$this->errstr());
$msg = sprintf(_("err_".$this->clsid."_generic: ")._($this->error)."\n",$this->param);
} else {
$msg = sprintf(_("err_".$this->clsid."_".$this->error)."\n",$this->param);
}
fputs($f,$msg);
fclose($f); fclose($f);
} }
} }