projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #5057 from cividesk/CRM-15901-4.5
[civicrm-core.git]
/
CRM
/
Utils
/
JSON.php
diff --git
a/CRM/Utils/JSON.php
b/CRM/Utils/JSON.php
index 6e78112b059845ff14392229e5dff79e9327a3ef..00287a5eaab62c25176b42a434b76782f3ca6684 100644
(file)
--- a/
CRM/Utils/JSON.php
+++ b/
CRM/Utils/JSON.php
@@
-38,8
+38,19
@@
*/
class CRM_Utils_JSON {
*/
class CRM_Utils_JSON {
+ /**
+ * Output json to the client
+ * @param mixed $input
+ */
+ static function output($input) {
+ header('Content-Type: application/json');
+ echo json_encode($input);
+ CRM_Utils_System::civiExit();
+ }
+
/**
* Function to create JSON object
/**
* Function to create JSON object
+ * @deprecated
*
* @param array $params associated array, that needs to be
* converted to JSON array
*
* @param array $params associated array, that needs to be
* converted to JSON array
@@
-63,9
+74,10
@@
class CRM_Utils_JSON {
/**
* Function to encode json format for flexigrid, NOTE: "id" should be present in $params for each row
*
/**
* Function to encode json format for flexigrid, NOTE: "id" should be present in $params for each row
*
- * @param array $params associated array of values rows
- * @param int $page page no for selector
- * @param array $selectorElements selector rows
+ * @param array $params associated array of values rows
+ * @param int $page page no for selector
+ * @param $total
+ * @param array $selectorElements selector rows
*
* @return json encode string
*/
*
* @return json encode string
*/
@@
-126,7
+138,6
@@
class CRM_Utils_JSON {
if ($addcomma) {
$sOutput .= ",";
}
if ($addcomma) {
$sOutput .= ",";
}
-
//CRM-7130 --lets addslashes to only double quotes,
//since we are using it to quote the field value.
//str_replace helps to provide a break for new-line
//CRM-7130 --lets addslashes to only double quotes,
//since we are using it to quote the field value.
//str_replace helps to provide a break for new-line