diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-09-15 05:50:43 -0700 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-09-15 05:50:43 -0700 |
commit | 69bcf65b9b89a0e4b71d10d80c3095f2aef2ec7d (patch) | |
tree | 808576868c3f075466474c4b08515296190a4be8 | |
parent | 2efe332b495787dc5be77c3191ff319a62a56fca (diff) | |
parent | 7027f386cba772d2a24a96ae7f56d89f3072d9a3 (diff) |
Merge pull request #122 from JohnDoh/render_response
Add a render_response hook, similar to render_page hook.
-rw-r--r-- | program/include/rcmail_output_json.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/program/include/rcmail_output_json.php b/program/include/rcmail_output_json.php index def6ee42c..d0e1eec64 100644 --- a/program/include/rcmail_output_json.php +++ b/program/include/rcmail_output_json.php @@ -227,6 +227,13 @@ class rcmail_output_json extends rcmail_output if (!empty($this->callbacks)) $response['callbacks'] = $this->callbacks; + // trigger generic hook where plugins can put additional content to the response + $hook = $this->app->plugins->exec_hook("render_response", array('response' => $response)); + + // save some memory + $response = $hook['response']; + unset($hook['response']); + echo self::json_serialize($response); } |