summaryrefslogtreecommitdiffstats
path: root/application/helpers
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2014-10-25 13:55:08 +0200
committerFlorian Pritz <bluewind@xinu.at>2015-01-16 17:38:38 +0100
commitd59962443687127ea1defc2f8ac41af1c2c02fe4 (patch)
treef33a9f358efdd1e30a27e0244314d0ef81b2ce7e /application/helpers
parent9535ede862e01d834ebdd553184b1f6544b06d2c (diff)
first go at reworking; needs to be redesigned
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/helpers')
-rw-r--r--application/helpers/filebin_helper.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/application/helpers/filebin_helper.php b/application/helpers/filebin_helper.php
index e5637ce94..465f865f6 100644
--- a/application/helpers/filebin_helper.php
+++ b/application/helpers/filebin_helper.php
@@ -235,6 +235,22 @@ function send_json_reply($array, $status = "success")
$CI->output->set_output(json_encode($reply));
}
+function send_json_error_reply($message, $array = null)
+{
+ $reply = array();
+ $reply["status"] = "error";
+ $reply["message"] = $message;
+
+ if ($array !== null) {
+ $reply["data"] = $array;
+ }
+
+ $CI =& get_instance();
+ $CI->output->set_status_header(400);
+ $CI->output->set_content_type('application/json');
+ $CI->output->set_output(json_encode($reply));
+}
+
function static_storage($key, $value = null)
{
static $storage = array();