From a2e09c950d8716346b151f7980df1b51ebfbdd78 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Tue, 15 Apr 2014 12:35:33 -0400 Subject: [PATCH] Use methods chaining, don't use deprecated row_init method --- program/include/rcmail_output_json.php | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/program/include/rcmail_output_json.php b/program/include/rcmail_output_json.php index def6ee4..fa35824 100644 --- a/program/include/rcmail_output_json.php +++ b/program/include/rcmail_output_json.php @@ -23,7 +23,7 @@ /** * View class to produce JSON responses * - * @package Core + * @package Webmail * @subpackage View */ class rcmail_output_json extends rcmail_output @@ -227,6 +227,13 @@ 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); } -- Gitblit v1.9.1