use no printf when not needed

This commit is contained in:
Roland Gruber 2005-05-06 13:15:27 +00:00
parent ab2a8f860c
commit 48cc835ade
1 changed files with 7 additions and 2 deletions

View File

@ -76,8 +76,13 @@ function StatusMessage($MessageTyp,$MessageHeadline,$MessageText,$MessageVariabl
$MessageText = "<p " . $class . ">" . $MessageText . "</p>"; // Format $MessageText $MessageText = "<p " . $class . ">" . $MessageText . "</p>"; // Format $MessageText
$format = "<div " . $class . ">\n<table>\n<tr>\n<td>" . $MessageTyp . "</td>\n<td>" . $MessageHeadline . $MessageText . "</td>\n</tr>\n</table>\n</div>\n"; $format = "<div " . $class . ">\n<table>\n<tr>\n<td>" . $MessageTyp . "</td>\n<td>" . $MessageHeadline . $MessageText . "</td>\n</tr>\n</table>\n</div>\n";
if (is_array($MessageVariables)) { if (is_array($MessageVariables)) {
array_unshift($MessageVariables, $format); if (sizeof($MessageVariables) > 0) {
call_user_func_array('printf',$MessageVariables); array_unshift($MessageVariables, $format);
call_user_func_array('printf',$MessageVariables);
}
else {
echo $format;
}
} }
else { else {
printf($format, $MessageVariables); printf($format, $MessageVariables);