本文整理汇总了PHP中PhabricatorFile::getBestURI方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorFile::getBestURI方法的具体用法?PHP PhabricatorFile::getBestURI怎么用?PHP PhabricatorFile::getBestURI使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhabricatorFile
的用法示例。
在下文中一共展示了PhabricatorFile::getBestURI方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildActionView
private function buildActionView(PhabricatorUser $viewer, PhabricatorPaste $paste, PhabricatorFile $file)
{
$can_edit = PhabricatorPolicyFilter::hasCapability($viewer, $paste, PhabricatorPolicyCapability::CAN_EDIT);
$can_fork = $viewer->isLoggedIn();
$fork_uri = $this->getApplicationURI('/create/?parent=' . $paste->getID());
return id(new PhabricatorActionListView())->setUser($viewer)->setObject($paste)->setObjectURI($this->getRequest()->getRequestURI())->addAction(id(new PhabricatorActionView())->setName(pht('Edit Paste'))->setIcon('fa-pencil')->setDisabled(!$can_edit)->setWorkflow(!$can_edit)->setHref($this->getApplicationURI('/edit/' . $paste->getID() . '/')))->addAction(id(new PhabricatorActionView())->setName(pht('Fork This Paste'))->setIcon('fa-code-fork')->setDisabled(!$can_fork)->setWorkflow(!$can_fork)->setHref($fork_uri))->addAction(id(new PhabricatorActionView())->setName(pht('View Raw File'))->setIcon('fa-file-text-o')->setHref($file->getBestURI()));
}
示例2: renderFileLink
private function renderFileLink(PhabricatorFile $file, PhabricatorObjectHandle $handle, array $options)
{
return id(new PhabricatorFileLinkView())->setFilePHID($file->getPHID())->setFileName($this->assertFlatText($options['name']))->setFileDownloadURI($file->getDownloadURI())->setFileViewURI($file->getBestURI())->setFileViewable((bool) $options['viewable']);
}
示例3: buildActionView
private function buildActionView(PhabricatorPaste $paste, PhabricatorFile $file)
{
return id(new PhabricatorActionListView())->addAction(id(new PhabricatorActionView())->setName(pht('Fork This Paste'))->setIcon('fork')->setHref($this->getApplicationURI('?fork=' . $paste->getID())))->addAction(id(new PhabricatorActionView())->setName(pht('View Raw File'))->setIcon('file')->setHref($file->getBestURI()));
}
示例4: getFileDictionary
private function getFileDictionary(PhabricatorFile $file)
{
return array('id' => $file->getID(), 'phid' => $file->getPHID(), 'uri' => $file->getBestURI());
}
示例5: renderImageStage
protected function renderImageStage(PhabricatorFile $file)
{
return phutil_tag('div', array('class' => 'differential-image-stage'), phutil_tag('img', array('src' => $file->getBestURI())));
}
示例6: buildActionView
private function buildActionView(PhabricatorUser $user, PhabricatorPaste $paste, PhabricatorFile $file)
{
$can_edit = PhabricatorPolicyFilter::hasCapability($user, $paste, PhabricatorPolicyCapability::CAN_EDIT);
return id(new PhabricatorActionListView())->setUser($user)->setObject($paste)->addAction(id(new PhabricatorActionView())->setName(pht('Fork This Paste'))->setIcon('fork')->setHref($this->getApplicationURI('?parent=' . $paste->getID())))->addAction(id(new PhabricatorActionView())->setName(pht('View Raw File'))->setIcon('file')->setHref($file->getBestURI()))->addAction(id(new PhabricatorActionView())->setName(pht('Edit Paste'))->setIcon('edit')->setDisabled(!$can_edit)->setWorkflow(!$can_edit)->setHref($this->getApplicationURI('/edit/' . $paste->getID() . '/')));
}