Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/controller/PhabricatorFileInfoController.php
Show All 33 Lines | $file = id(new PhabricatorFileQuery()) | ||||
->withIDs(array($this->id)) | ->withIDs(array($this->id)) | ||||
->executeOne(); | ->executeOne(); | ||||
if (!$file) { | if (!$file) { | ||||
return new Aphront404Response(); | return new Aphront404Response(); | ||||
} | } | ||||
$phid = $file->getPHID(); | $phid = $file->getPHID(); | ||||
$handle_phids = array_merge( | |||||
array($file->getAuthorPHID()), | |||||
$file->getObjectPHIDs()); | |||||
$this->loadHandles($handle_phids); | |||||
$header = id(new PHUIHeaderView()) | $header = id(new PHUIHeaderView()) | ||||
->setUser($user) | ->setUser($user) | ||||
->setPolicyObject($file) | ->setPolicyObject($file) | ||||
->setHeader($file->getName()); | ->setHeader($file->getName()); | ||||
$ttl = $file->getTTL(); | $ttl = $file->getTTL(); | ||||
if ($ttl !== null) { | if ($ttl !== null) { | ||||
$ttl_tag = id(new PHUITagView()) | $ttl_tag = id(new PHUITagView()) | ||||
▲ Show 20 Lines • Show All 125 Lines • ▼ Show 20 Lines | final class PhabricatorFileInfoController extends PhabricatorFileController { | ||||
private function buildPropertyViews( | private function buildPropertyViews( | ||||
PHUIObjectBoxView $box, | PHUIObjectBoxView $box, | ||||
PhabricatorFile $file, | PhabricatorFile $file, | ||||
PhabricatorActionListView $actions) { | PhabricatorActionListView $actions) { | ||||
$request = $this->getRequest(); | $request = $this->getRequest(); | ||||
$user = $request->getUser(); | $user = $request->getUser(); | ||||
$properties = id(new PHUIPropertyListView()); | $properties = id(new PHUIPropertyListView()); | ||||
$properties->setActionList($actions); | $properties->setActionList($actions); | ||||
$box->addPropertyList($properties, pht('Details')); | $box->addPropertyList($properties, pht('Details')); | ||||
if ($file->getAuthorPHID()) { | if ($file->getAuthorPHID()) { | ||||
$properties->addProperty( | $properties->addProperty( | ||||
pht('Author'), | pht('Author'), | ||||
$this->getHandle($file->getAuthorPHID())->renderLink()); | $user->renderHandle($file->getAuthorPHID())); | ||||
} | } | ||||
$properties->addProperty( | $properties->addProperty( | ||||
pht('Created'), | pht('Created'), | ||||
phabricator_datetime($file->getDateCreated(), $user)); | phabricator_datetime($file->getDateCreated(), $user)); | ||||
$finfo = id(new PHUIPropertyListView()); | $finfo = id(new PHUIPropertyListView()); | ||||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | private function buildPropertyViews( | ||||
$phids = $file->getObjectPHIDs(); | $phids = $file->getObjectPHIDs(); | ||||
if ($phids) { | if ($phids) { | ||||
$attached = new PHUIPropertyListView(); | $attached = new PHUIPropertyListView(); | ||||
$box->addPropertyList($attached, pht('Attached')); | $box->addPropertyList($attached, pht('Attached')); | ||||
$attached->addProperty( | $attached->addProperty( | ||||
pht('Attached To'), | pht('Attached To'), | ||||
$this->renderHandlesForPHIDs($phids)); | $user->renderHandleList($phids)); | ||||
} | } | ||||
if ($file->isViewableImage()) { | if ($file->isViewableImage()) { | ||||
$image = phutil_tag( | $image = phutil_tag( | ||||
'img', | 'img', | ||||
array( | array( | ||||
'src' => $file->getViewURI(), | 'src' => $file->getViewURI(), | ||||
▲ Show 20 Lines • Show All 96 Lines • Show Last 20 Lines |