Changeset View
Changeset View
Standalone View
Standalone View
src/aphront/response/AphrontAjaxResponse.php
| Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | public function buildResponseString() { | ||||
| // Flatten the response first, so we initialize any behaviors and metadata | // Flatten the response first, so we initialize any behaviors and metadata | ||||
| // we need to. | // we need to. | ||||
| $content = array( | $content = array( | ||||
| 'payload' => $this->content, | 'payload' => $this->content, | ||||
| ); | ); | ||||
| $this->encodeJSONForHTTPResponse($content); | $this->encodeJSONForHTTPResponse($content); | ||||
| $response = CelerityAPI::getStaticResourceResponse(); | $response = CelerityAPI::getStaticResourceResponse(); | ||||
| $request = $this->getRequest(); | |||||
| if ($request) { | |||||
| $viewer = $request->getViewer(); | |||||
| if ($viewer) { | |||||
| $postprocessor_key = $viewer->getPreference( | |||||
| PhabricatorUserPreferences::PREFERENCE_RESOURCE_POSTPROCESSOR); | |||||
| if (strlen($postprocessor_key)) { | |||||
| $response->setPostprocessorKey($postprocessor_key); | |||||
| } | |||||
| } | |||||
| } | |||||
| $object = $response->buildAjaxResponse( | $object = $response->buildAjaxResponse( | ||||
| $content['payload'], | $content['payload'], | ||||
| $this->error); | $this->error); | ||||
| $response_json = $this->encodeJSONForHTTPResponse($object); | $response_json = $this->encodeJSONForHTTPResponse($object); | ||||
| return $this->addJSONShield($response_json); | return $this->addJSONShield($response_json); | ||||
| } | } | ||||
| Show All 9 Lines | |||||