mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 13:17:24 +02:00
JS helper - a bit more flexible
This commit is contained in:
@@ -182,7 +182,7 @@ class e_jshelper
|
|||||||
$this->addResponseAction($action, $data_array);
|
$this->addResponseAction($action, $data_array);
|
||||||
}
|
}
|
||||||
|
|
||||||
echo $this->buildXmlResponse();
|
if(null !== $action) echo $this->buildXmlResponse();
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,8 +191,9 @@ class e_jshelper
|
|||||||
*
|
*
|
||||||
* @return string JSON response
|
* @return string JSON response
|
||||||
*/
|
*/
|
||||||
function buildJsonResponse()
|
function buildJsonResponse($data = null)
|
||||||
{
|
{
|
||||||
|
if(null !== $data) return "/*-secure-\n".json_encode($data)."\n*/";
|
||||||
return "/*-secure-\n".json_encode($this->getResponseActions(true))."\n*/";
|
return "/*-secure-\n".json_encode($this->getResponseActions(true))."\n*/";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,7 +210,7 @@ class e_jshelper
|
|||||||
{
|
{
|
||||||
$this->addResponseAction($action, $data_array);
|
$this->addResponseAction($action, $data_array);
|
||||||
}
|
}
|
||||||
echo $this->buildJSONResponse();
|
if(null !== $action) echo $this->buildJSONResponse();
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user