mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-25 16:19:00 +01:00
fixed after new shutdown handling broken autoloading of tree nodes: json.php is used to send arbitrary JSON data, instead using egw_json_response methods (egw_json_request::isJSONRequest(false) turns that off now)
This commit is contained in:
parent
2f3add4ce9
commit
4ff1a4efd1
@ -76,8 +76,12 @@ class etemplate_widget_tree extends etemplate_widget
|
||||
*/
|
||||
public static function send_quote_json(array $data)
|
||||
{
|
||||
// switch regular JSON response handling off
|
||||
egw_json_request::isJSONRequest(false);
|
||||
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
echo json_encode(self::htmlencode_node($data));
|
||||
|
||||
common::egw_exit();
|
||||
}
|
||||
|
||||
|
@ -18,9 +18,24 @@ class egw_json_request
|
||||
|
||||
private static $_hadJSONRequest = false;
|
||||
|
||||
public static function isJSONRequest()
|
||||
/**
|
||||
* Check if JSON request running or (re)set JSON request flag
|
||||
*
|
||||
* Can be used to:
|
||||
* - detect regular JSON request:
|
||||
* egw_json_request::isJSONRequest()
|
||||
* - switch regular JSON response handling off, which would send arbitrary output via response method "html".
|
||||
* Neccessary if json.php is used to send arbitrary JSON data eg. nodes for foldertree!
|
||||
* egw_json_request::isJSONRequest(false)
|
||||
*
|
||||
* @param boolean $set=null
|
||||
* @return boolean
|
||||
*/
|
||||
public static function isJSONRequest($set=null)
|
||||
{
|
||||
return self::$_hadJSONRequest;
|
||||
$ret = self::$_hadJSONRequest;
|
||||
if (isset($set)) self::$_hadJSONRequest = $set;
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -249,7 +264,7 @@ class egw_json_response
|
||||
{
|
||||
if (!$inst->haveJSONResponse())
|
||||
{
|
||||
error_log(__METHOD__."() adding output with inst->addGeneric('output', '$output')");
|
||||
error_log(__METHOD__."() adding output with inst->addGeneric('html', '$output')");
|
||||
$inst->addGeneric('html', $output);
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user