X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Ferrors.inc;h=160d41e5100dce8fe0d84bda8dd4d55b9c516f8f;hb=8864b1ec0fd3321e510511ef22614bc36845540e;hp=d5f7b4a097be3f038af28e29a87b8c8994d58bcd;hpb=d9cb8b17823edab3842cc7084598d53eb40fa0ad;p=fa-stable.git diff --git a/includes/errors.inc b/includes/errors.inc index d5f7b4a0..160d41e5 100644 --- a/includes/errors.inc +++ b/includes/errors.inc @@ -29,7 +29,7 @@ function error_handler($errno, $errstr, $file, $line) { // Formats system messages before insert them into message
// FIX center is unused now function fmt_errors($center=false) { - global $messages; + global $messages, $path_to_root; $msg_class = array( E_USER_ERROR => 'err_msg', @@ -38,8 +38,9 @@ function fmt_errors($center=false) { $type = E_USER_NOTICE; $content = ''; + $class = 'no_msg'; if (count($messages)) { - foreach($messages as $msg) { + foreach($messages as $cnt=>$msg) { if ($msg[0]>$type) continue; if ($msg[0]<$type) { @@ -53,12 +54,16 @@ function fmt_errors($center=false) { } } $str = $msg[1]; - $class = $msg_class[$type]; if ($msg[0] < E_USER_ERROR && $msg[2] != null) $str .= ' '._('in file').': '.$msg[2].' '._('at line ').$msg[3]; - $content .= "
$str

"; + $content .= ($cnt ? '
' : '').$str; } - } + $class = $msg_class[$type]; + } else + if ($path_to_root=='.') + return ''; + + $content = "
$content
"; return $content; } //-----------------------------------------------------------------------------