Path: blob/master/src/applications/files/controller/PhabricatorFileUICurtainListController.php
12242 views
<?php12final class PhabricatorFileUICurtainListController3extends PhabricatorFileController {45public function shouldAllowPublic() {6return true;7}89public function handleRequest(AphrontRequest $request) {10$viewer = $request->getViewer();1112$object_phid = $request->getURIData('phid');1314$object = id(new PhabricatorObjectQuery())15->setViewer($viewer)16->withPHIDs(array($object_phid))17->executeOne();18if (!$object) {19return new Aphront404Response();20}2122$attachments = id(new PhabricatorFileAttachmentQuery())23->setViewer($viewer)24->withObjectPHIDs(array($object->getPHID()))25->needFiles(true)26->execute();2728$handles = $viewer->loadHandles(array($object_phid));29$object_handle = $handles[$object_phid];3031$file_phids = mpull($attachments, 'getFilePHID');32$file_handles = $viewer->loadHandles($file_phids);3334$list = id(new PHUIObjectItemListView())35->setUser($viewer);36foreach ($attachments as $attachment) {37$file_phid = $attachment->getFilePHID();38$handle = $file_handles[$file_phid];3940$item = id(new PHUIObjectItemView())41->setHeader($handle->getFullName())42->setHref($handle->getURI())43->setDisabled($handle->isDisabled());4445if ($handle->getImageURI()) {46$item->setImageURI($handle->getImageURI());47}4849$list->addItem($item);50}5152return $this->newDialog()53->setViewer($viewer)54->setWidth(AphrontDialogView::WIDTH_FORM)55->setTitle(pht('Referenced Files'))56->setObjectList($list)57->addCancelButton($object_handle->getURI(), pht('Close'));58}5960}616263