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) { $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); }
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()); }