diff options
Diffstat (limited to 'application/helpers')
-rw-r--r-- | application/helpers/filebin_helper.php | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/application/helpers/filebin_helper.php b/application/helpers/filebin_helper.php index 57f7bdc65..9b124506f 100644 --- a/application/helpers/filebin_helper.php +++ b/application/helpers/filebin_helper.php @@ -330,11 +330,26 @@ function user_logged_in() return $CI->muser->logged_in(); } -function send_json_reply($array) +function send_json_reply($array, $status = "success") { + $reply = array(); + $reply["status"] = $status; + $reply["data"] = $array; + $CI =& get_instance(); $CI->output->set_content_type('application/json'); - $CI->output->set_output(json_encode($array)); + $CI->output->set_output(json_encode($reply)); +} + +function request_type($set_type = null) +{ + static $type = null; + + if ($set_type !== null) { + $type = $set_type; + } + + return $type; } # vim: set noet: |