content = $content; return $this; } public function setError($error) { $this->error = $error; return $this; } public function setDisableConsole($disable) { $this->disableConsole = $disable; return $this; } private function getConsole() { if ($this->disableConsole) { $console = null; } else { $request = $this->getRequest(); $console = $request->getApplicationConfiguration()->getConsole(); } return $console; } public function buildResponseString() { $console = $this->getConsole(); if ($console) { Javelin::initBehavior( 'dark-console-ajax', array( 'console' => $console->render($this->getRequest()), 'uri' => (string) $this->getRequest()->getRequestURI(), )); } $response = CelerityAPI::getStaticResourceResponse(); $object = $response->buildAjaxResponse( $this->content, $this->error); $response_json = $this->encodeJSONForHTTPResponse($object); return $this->addJSONShield($response_json, $use_javelin_shield = true); } public function getHeaders() { $headers = array( array('Content-Type', 'text/plain; charset=UTF-8'), ); $headers = array_merge(parent::getHeaders(), $headers); return $headers; } }