| | |
| | | | Author: Thomas Bruederli <roundcube@gmail.com> | |
| | | +-----------------------------------------------------------------------+ |
| | | |
| | | $Id: $ |
| | | $Id$ |
| | | |
| | | */ |
| | | |
| | |
| | | $s_header_sent = true; |
| | | send_nocacheing_headers(); |
| | | header('Content-Type: text/plain; charset=' . $this->get_charset()); |
| | | print '/** ajax response ['.date('d/M/Y h:i:s O')."] **/\n"; |
| | | } |
| | | |
| | | // unset default env vars |
| | |
| | | if (!empty($this->callbacks)) |
| | | $response['callbacks'] = $this->callbacks; |
| | | |
| | | echo json_encode($response); |
| | | echo json_serialize($response); |
| | | } |
| | | |
| | | |
| | |
| | | private function get_js_commands() |
| | | { |
| | | $out = ''; |
| | | |
| | | |
| | | foreach ($this->commands as $i => $args) { |
| | | $method = array_shift($args); |
| | | foreach ($args as $i => $arg) { |
| | | $args[$i] = json_encode($arg); |
| | | $args[$i] = json_serialize($arg); |
| | | } |
| | | |
| | | $out .= sprintf( |