Changeset View
Changeset View
Standalone View
Standalone View
src/aphront/configuration/AphrontDefaultApplicationConfiguration.php
| Show First 20 Lines • Show All 97 Lines • ▼ Show 20 Lines | if ($request->isAjax() && !$request->isJavelinWorkflow()) { | ||||
| $response->setError( | $response->setError( | ||||
| array( | array( | ||||
| 'code' => get_class($ex), | 'code' => get_class($ex), | ||||
| 'info' => $ex->getMessage(), | 'info' => $ex->getMessage(), | ||||
| )); | )); | ||||
| return $response; | return $response; | ||||
| } | } | ||||
| $is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business'); | |||||
| $user = $request->getUser(); | $user = $request->getUser(); | ||||
| if (!$user) { | if (!$user) { | ||||
| // If we hit an exception very early, we won't have a user. | // If we hit an exception very early, we won't have a user. | ||||
| $user = new PhabricatorUser(); | $user = new PhabricatorUser(); | ||||
| } | } | ||||
| if ($ex instanceof PhabricatorSystemActionRateLimitException) { | if ($ex instanceof PhabricatorSystemActionRateLimitException) { | ||||
| $dialog = id(new AphrontDialogView()) | $dialog = id(new AphrontDialogView()) | ||||
| ▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | if ($ex instanceof PhabricatorPolicyException) { | ||||
| $dialog = new AphrontDialogView(); | $dialog = new AphrontDialogView(); | ||||
| $dialog | $dialog | ||||
| ->setTitle($ex->getTitle()) | ->setTitle($ex->getTitle()) | ||||
| ->setClass('aphront-access-dialog') | ->setClass('aphront-access-dialog') | ||||
| ->setUser($user) | ->setUser($user) | ||||
| ->appendChild($content); | ->appendChild($content); | ||||
| if ($this->getRequest()->isAjax()) { | if ($this->getRequest()->isAjax()) { | ||||
| $dialog->addCancelButton('/', 'Close'); | $dialog->addCancelButton('/', pht('Close')); | ||||
| } else { | } else { | ||||
| $dialog->addCancelButton('/', $is_serious ? 'OK' : 'Away With Thee'); | $dialog->addCancelButton('/', pht('OK')); | ||||
| } | } | ||||
| $response = new AphrontDialogResponse(); | $response = new AphrontDialogResponse(); | ||||
| $response->setDialog($dialog); | $response->setDialog($dialog); | ||||
| return $response; | return $response; | ||||
| } | } | ||||
| if ($ex instanceof AphrontUsageException) { | if ($ex instanceof AphrontUsageException) { | ||||
| ▲ Show 20 Lines • Show All 81 Lines • Show Last 20 Lines | |||||