mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-25 04:11:49 +02:00
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>
|
</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();
|
common::egw_footer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user