diff options
author | piernov <piernov@piernov.org> | 2016-04-27 20:00:13 +0200 |
---|---|---|
committer | piernov <piernov@piernov.org> | 2016-04-27 20:00:13 +0200 |
commit | a639278fcf395dd7349886785d56dee63c3a8774 (patch) | |
tree | f22f0af19ff5cff9454de6d50f1472a8d0db0da8 /inc | |
parent | 8770f9ddccfafaad935f66ccbf254624b41545f3 (diff) | |
download | candybox-feat/messages.tar.gz candybox-feat/messages.tar.bz2 candybox-feat/messages.tar.xz candybox-feat/messages.zip |
Add sendInfo() from PHPfeat/messages
Diffstat (limited to 'inc')
-rw-r--r-- | inc/messages.inc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/inc/messages.inc b/inc/messages.inc index d6ea87e..5b1631f 100644 --- a/inc/messages.inc +++ b/inc/messages.inc @@ -8,10 +8,18 @@ $messages = array( "guild_already_built" => "You have aready built a guild." ); -function sendError($msg) { +function sendMessage($type, $msg) { global $messages; $text = $messages[$msg]; - echo json_encode(array("error" => $text)); + echo json_encode(array($type => $text)); +} + +function sendError($msg) { + sendMessage("error", $msg); +} + +function sendInfo($msg) { + sendMessage("info", $msg); } ?> |