Differential D12207 Diff 29357 src/applications/phragment/controller/PhragmentSnapshotViewController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phragment/controller/PhragmentSnapshotViewController.php
Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | final class PhragmentSnapshotViewController extends PhragmentController { | ||||
protected function createSnapshotView($snapshot) { | protected function createSnapshotView($snapshot) { | ||||
if ($snapshot === null) { | if ($snapshot === null) { | ||||
return null; | return null; | ||||
} | } | ||||
$viewer = $this->getRequest()->getUser(); | $viewer = $this->getRequest()->getUser(); | ||||
$phids = array(); | |||||
$phids[] = $snapshot->getPrimaryFragmentPHID(); | |||||
$this->loadHandles($phids); | |||||
$header = id(new PHUIHeaderView()) | $header = id(new PHUIHeaderView()) | ||||
->setHeader(pht('"%s" Snapshot', $snapshot->getName())) | ->setHeader(pht('"%s" Snapshot', $snapshot->getName())) | ||||
->setPolicyObject($snapshot) | ->setPolicyObject($snapshot) | ||||
->setUser($viewer); | ->setUser($viewer); | ||||
$zip_uri = $this->getApplicationURI( | $zip_uri = $this->getApplicationURI( | ||||
'zip@'.$snapshot->getName(). | 'zip@'.$snapshot->getName(). | ||||
'/'.$snapshot->getPrimaryFragment()->getPath()); | '/'.$snapshot->getPrimaryFragment()->getPath()); | ||||
Show All 35 Lines | $properties = id(new PHUIPropertyListView()) | ||||
->setObject($snapshot) | ->setObject($snapshot) | ||||
->setActionList($actions); | ->setActionList($actions); | ||||
$properties->addProperty( | $properties->addProperty( | ||||
pht('Name'), | pht('Name'), | ||||
$snapshot->getName()); | $snapshot->getName()); | ||||
$properties->addProperty( | $properties->addProperty( | ||||
pht('Fragment'), | pht('Fragment'), | ||||
$this->renderHandlesForPHIDs(array($snapshot->getPrimaryFragmentPHID()))); | $viewer->renderHandle($snapshot->getPrimaryFragmentPHID())); | ||||
return id(new PHUIObjectBoxView()) | return id(new PHUIObjectBoxView()) | ||||
->setHeader($header) | ->setHeader($header) | ||||
->addPropertyList($properties); | ->addPropertyList($properties); | ||||
} | } | ||||
} | } |