mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +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);
|
||||
}
|
||||
|
||||
echo $this->buildXmlResponse();
|
||||
if(null !== $action) echo $this->buildXmlResponse();
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -191,8 +191,9 @@ class e_jshelper
|
||||
*
|
||||
* @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*/";
|
||||
}
|
||||
|
||||
@@ -209,7 +210,7 @@ class e_jshelper
|
||||
{
|
||||
$this->addResponseAction($action, $data_array);
|
||||
}
|
||||
echo $this->buildJSONResponse();
|
||||
if(null !== $action) echo $this->buildJSONResponse();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user