forked from extern/egroupware
Send any accumulated json responses after flushing etemplate - allows apps to use egw_json_response even when call is not an ajax call
This commit is contained in:
parent
22f2b5599b
commit
ea104a9af5
@ -233,6 +233,18 @@ class etemplate_new extends etemplate_widget_template
|
||||
</script>
|
||||
';
|
||||
}
|
||||
ob_flush();
|
||||
|
||||
// Send any accumulated json responses - after flush to avoid sending the buffer as a response
|
||||
if(egw_json_response::isJSONResponse())
|
||||
{
|
||||
$response = egw_json_response::get();
|
||||
echo '<script>egw.LAB.wait(function() {egw_json_request.prototype.handleResponse(';
|
||||
ob_flush();
|
||||
$response->sendResult();
|
||||
unset($response);
|
||||
echo ')});</script>';
|
||||
}
|
||||
common::egw_footer();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user