Changeset View
Changeset View
Standalone View
Standalone View
src/applications/base/controller/PhabricatorController.php
Show First 20 Lines • Show All 364 Lines • ▼ Show 20 Lines | public function buildApplicationPage($view, array $options) { | ||||
$application_menu = $this->buildApplicationMenu(); | $application_menu = $this->buildApplicationMenu(); | ||||
if ($application_menu) { | if ($application_menu) { | ||||
$page->setApplicationMenu($application_menu); | $page->setApplicationMenu($application_menu); | ||||
} | } | ||||
return $this->buildPageResponse($page); | return $this->buildPageResponse($page); | ||||
} | } | ||||
public function didProcessRequest($response) { | public function willSendResponse(AphrontResponse $response) { | ||||
// If a bare DialogView is returned, wrap it in a DialogResponse. | |||||
if ($response instanceof AphrontDialogView) { | |||||
$response = id(new AphrontDialogResponse())->setDialog($response); | |||||
} | |||||
$request = $this->getRequest(); | $request = $this->getRequest(); | ||||
$response->setRequest($request); | |||||
$seen = array(); | |||||
while ($response instanceof AphrontProxyResponse) { | |||||
$hash = spl_object_hash($response); | |||||
if (isset($seen[$hash])) { | |||||
$seen[] = get_class($response); | |||||
throw new Exception( | |||||
pht('Cycle while reducing proxy responses: %s', | |||||
implode(' -> ', $seen))); | |||||
} | |||||
$seen[$hash] = get_class($response); | |||||
$response = $response->reduceProxyResponse(); | |||||
} | |||||
if ($response instanceof AphrontDialogResponse) { | if ($response instanceof AphrontDialogResponse) { | ||||
if (!$request->isAjax() && !$request->isQuicksand()) { | if (!$request->isAjax() && !$request->isQuicksand()) { | ||||
$dialog = $response->getDialog(); | $dialog = $response->getDialog(); | ||||
$title = $dialog->getTitle(); | $title = $dialog->getTitle(); | ||||
$short = $dialog->getShortTitle(); | $short = $dialog->getShortTitle(); | ||||
▲ Show 20 Lines • Show All 200 Lines • Show Last 20 Lines |