public function respond($data = null, $showNotification = true) { $this->response['data'] = $data; self::fix_output_buffer(); if ($showNotification) { $this->response['notification'] = N2Message::showAjax(); } header("Content-Type: application/json"); if ($this->isError) { header("HTTP/1.0 403 Forbidden"); } echo json_encode($this->response); n2_exit(true); }