Changeset View
Changeset View
Standalone View
Standalone View
src/aphront/response/Aphront404Response.php
<?php | <?php | ||||
final class Aphront404Response extends AphrontHTMLResponse { | final class Aphront404Response extends AphrontHTMLResponse { | ||||
public function getHTTPResponseCode() { | public function getHTTPResponseCode() { | ||||
return 404; | return 404; | ||||
} | } | ||||
public function buildResponseString() { | public function buildResponseString() { | ||||
$request = $this->getRequest(); | $request = $this->getRequest(); | ||||
$user = $request->getUser(); | $viewer = $request->getViewer(); | ||||
$dialog = id(new AphrontDialogView()) | $dialog = id(new AphrontDialogView()) | ||||
->setUser($user) | ->setViewer($viewer) | ||||
->setTitle(pht('404 Not Found')) | ->setTitle(pht('404 Not Found')) | ||||
->addCancelButton('/', pht('Focus')) | ->addCancelButton('/', pht('Return to Charted Waters')) | ||||
->appendParagraph( | ->appendParagraph( | ||||
pht( | pht( | ||||
'Do not dwell in the past, do not dream of the future, '. | 'You arrive at your destination, but there is nothing here.')) | ||||
'concentrate the mind on the present moment.')); | ->appendParagraph( | ||||
pht( | |||||
'Perhaps the real treasure was the friends you made '. | |||||
'along the way.')); | |||||
$view = id(new PhabricatorStandardPageView()) | $view = id(new PhabricatorStandardPageView()) | ||||
->setTitle(pht('404 Not Found')) | ->setTitle(pht('404 Not Found')) | ||||
->setRequest($request) | ->setRequest($request) | ||||
->setDeviceReady(true) | ->setDeviceReady(true) | ||||
->appendChild($dialog); | ->appendChild($dialog); | ||||
return $view->render(); | return $view->render(); | ||||
} | } | ||||
} | } |