Differential D14284 Diff 37384 src/applications/passphrase/controller/PassphraseCredentialViewController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/passphrase/controller/PassphraseCredentialViewController.php
| <?php | <?php | ||||
| final class PassphraseCredentialViewController extends PassphraseController { | final class PassphraseCredentialViewController extends PassphraseController { | ||||
| public function handleRequest(AphrontRequest $request) { | public function handleRequest(AphrontRequest $request) { | ||||
| $viewer = $request->getViewer(); | $viewer = $request->getViewer(); | ||||
| $id = $request->getURIData('id'); | $id = $request->getURIData('id'); | ||||
| $credential = id(new PassphraseCredentialQuery()) | $credential = id(new PassphraseCredentialQuery()) | ||||
| ->setViewer($viewer) | ->setViewer($viewer) | ||||
| ->withIDs(array($id)) | ->withIDs(array($id)) | ||||
| ->executeOne(); | ->executeOne(); | ||||
| if (!$credential) { | if (!$credential) { | ||||
| return new Aphront404Response(); | return new Aphront404Response(); | ||||
| } | } | ||||
| $type = PassphraseCredentialType::getTypeByConstant( | $type = $credential->getImplementation(); | ||||
| $credential->getCredentialType()); | |||||
| if (!$type) { | |||||
| throw new Exception(pht('Credential has invalid type "%s"!', $type)); | |||||
| } | |||||
| $timeline = $this->buildTransactionTimeline( | $timeline = $this->buildTransactionTimeline( | ||||
| $credential, | $credential, | ||||
| new PassphraseCredentialTransactionQuery()); | new PassphraseCredentialTransactionQuery()); | ||||
| $timeline->setShouldTerminate(true); | $timeline->setShouldTerminate(true); | ||||
| $title = pht('%s %s', 'K'.$credential->getID(), $credential->getName()); | $title = pht('%s %s', $credential->getMonogram(), $credential->getName()); | ||||
| $crumbs = $this->buildApplicationCrumbs(); | $crumbs = $this->buildApplicationCrumbs(); | ||||
| $crumbs->addTextCrumb('K'.$credential->getID()); | $crumbs->addTextCrumb($credential->getMonogram()); | ||||
| $crumbs->setBorder(true); | $crumbs->setBorder(true); | ||||
| $header = $this->buildHeaderView($credential); | $header = $this->buildHeaderView($credential); | ||||
| $curtain = $this->buildCurtain($credential, $type); | $curtain = $this->buildCurtain($credential, $type); | ||||
| $subheader = $this->buildSubheaderView($credential); | $subheader = $this->buildSubheaderView($credential); | ||||
| $content = $this->buildPropertySectionView($credential, $type); | $content = $this->buildPropertySectionView($credential, $type); | ||||
| $view = id(new PHUITwoColumnView()) | $view = id(new PHUITwoColumnView()) | ||||
| ▲ Show 20 Lines • Show All 193 Lines • Show Last 20 Lines | |||||