diff options
Diffstat (limited to 'inc/messages.inc')
-rw-r--r-- | inc/messages.inc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/inc/messages.inc b/inc/messages.inc index 4938fa1..7b952b8 100644 --- a/inc/messages.inc +++ b/inc/messages.inc @@ -14,18 +14,19 @@ $messages = array( "gamesave_delete_success" => "Game save successfully removed from server", ); -function sendMessage($type, $msg) { +function sendMessage($type, $msg, $fmt = null) { global $messages; $text = $messages[$msg]; + if($fmt) $text = vsprintf($text, $fmt); echo json_encode(array($type => $text)); } -function sendError($msg) { - sendMessage("error", $msg); +function sendError($msg, $fmt = null) { + sendMessage("error", $msg, $fmt); } -function sendInfo($msg) { - sendMessage("info", $msg); +function sendInfo($msg, $fmt = null) { + sendMessage("info", $msg, $fmt); } ?> |