protected function buildPasteInfoDictionary(PhabricatorPaste $paste)
 {
     $content = null;
     $file = id(new PhabricatorFile())->loadOneWhere('phid = %s', $paste->getFilePHID());
     if ($file) {
         $content = $file->loadFileData();
     }
     return array('id' => $paste->getID(), 'objectName' => 'P' . $paste->getID(), 'phid' => $paste->getPHID(), 'authorPHID' => $paste->getAuthorPHID(), 'filePHID' => $paste->getFilePHID(), 'title' => $paste->getTitle(), 'dateCreated' => $paste->getDateCreated(), 'language' => $paste->getLanguage(), 'uri' => PhabricatorEnv::getProductionURI('/P' . $paste->getID()), 'parentPHID' => $paste->getParentPHID(), 'content' => $content);
 }
 private function buildSubheaderView(PhabricatorPaste $paste)
 {
     $viewer = $this->getViewer();
     $author = $viewer->renderHandle($paste->getAuthorPHID())->render();
     $date = phabricator_datetime($paste->getDateCreated(), $viewer);
     $author = phutil_tag('strong', array(), $author);
     $author_info = id(new PhabricatorPeopleQuery())->setViewer($viewer)->withPHIDs(array($paste->getAuthorPHID()))->needProfileImage(true)->executeOne();
     $image_uri = $author_info->getProfileImageURI();
     $image_href = '/p/' . $author_info->getUsername();
     $content = pht('Authored by %s on %s.', $author, $date);
     return id(new PHUIHeadThingView())->setImage($image_uri)->setImageHref($image_href)->setContent($content);
 }
 private function buildPropertyView(PhabricatorPaste $paste, array $child_phids)
 {
     $user = $this->getRequest()->getUser();
     $properties = new PhabricatorPropertyListView();
     $properties->addProperty(pht('Author'), $this->getHandle($paste->getAuthorPHID())->renderLink());
     $properties->addProperty(pht('Created'), phabricator_datetime($paste->getDateCreated(), $user));
     if ($paste->getParentPHID()) {
         $properties->addProperty(pht('Forked From'), $this->getHandle($paste->getParentPHID())->renderLink());
     }
     if ($child_phids) {
         $properties->addProperty(pht('Forks'), $this->renderHandlesForPHIDs($child_phids));
     }
     return $properties;
 }
 private function buildPropertyView(PhabricatorPaste $paste, array $child_phids)
 {
     $user = $this->getRequest()->getUser();
     $properties = new PhabricatorPropertyListView();
     $properties->addProperty(pht('Author'), $this->getHandle($paste->getAuthorPHID())->renderLink());
     $properties->addProperty(pht('Created'), phabricator_datetime($paste->getDateCreated(), $user));
     if ($paste->getParentPHID()) {
         $properties->addProperty(pht('Forked From'), $this->getHandle($paste->getParentPHID())->renderLink());
     }
     if ($child_phids) {
         $properties->addProperty(pht('Forks'), $this->renderHandlesForPHIDs($child_phids));
     }
     $descriptions = PhabricatorPolicyQuery::renderPolicyDescriptions($user, $paste);
     $properties->addProperty(pht('Visible To'), $descriptions[PhabricatorPolicyCapability::CAN_VIEW]);
     return $properties;
 }
 protected function buildPasteInfoDictionary(PhabricatorPaste $paste)
 {
     return array('id' => $paste->getID(), 'objectName' => 'P' . $paste->getID(), 'phid' => $paste->getPHID(), 'authorPHID' => $paste->getAuthorPHID(), 'filePHID' => $paste->getFilePHID(), 'title' => $paste->getTitle(), 'dateCreated' => $paste->getDateCreated(), 'language' => $paste->getLanguage(), 'uri' => PhabricatorEnv::getProductionURI('/P' . $paste->getID()), 'parentPHID' => $paste->getParentPHID(), 'content' => $paste->getRawContent());
 }