3 final class AlmanacNetworkViewController
4 extends AlmanacNetworkController
{
6 public function shouldAllowPublic() {
10 public function handleRequest(AphrontRequest
$request) {
11 $viewer = $request->getViewer();
13 $id = $request->getURIData('id');
14 $network = id(new AlmanacNetworkQuery())
19 return new Aphront404Response();
22 $title = pht('Network %s', $network->getName());
24 $curtain = $this->buildCurtain($network);
26 $header = id(new PHUIHeaderView())
28 ->setHeader($network->getName())
29 ->setHeaderIcon('fa-globe')
30 ->setPolicyObject($network);
32 $crumbs = $this->buildApplicationCrumbs();
33 $crumbs->addTextCrumb($network->getName());
34 $crumbs->setBorder(true);
36 $timeline = $this->buildTransactionTimeline(
38 new AlmanacNetworkTransactionQuery());
39 $timeline->setShouldTerminate(true);
41 $view = id(new PHUITwoColumnView())
43 ->setCurtain($curtain)
44 ->setMainColumn(array(
48 return $this->newPage()
58 private function buildCurtain(AlmanacNetwork
$network) {
59 $viewer = $this->getViewer();
61 $can_edit = PhabricatorPolicyFilter
::hasCapability(
64 PhabricatorPolicyCapability
::CAN_EDIT
);
66 $id = $network->getID();
67 $edit_uri = $this->getApplicationURI("network/edit/{$id}/");
69 $curtain = $this->newCurtainView($network);
72 id(new PhabricatorActionView())
73 ->setIcon('fa-pencil')
74 ->setName(pht('Edit Network'))
76 ->setWorkflow(!$can_edit)
77 ->setDisabled(!$can_edit));