本文整理匯總了PHP中PhabricatorFile::getMonogram方法的典型用法代碼示例。如果您正苦於以下問題:PHP PhabricatorFile::getMonogram方法的具體用法?PHP PhabricatorFile::getMonogram怎麽用?PHP PhabricatorFile::getMonogram使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PhabricatorFile
的用法示例。
在下文中一共展示了PhabricatorFile::getMonogram方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: renderCommentForm
private function renderCommentForm(PhabricatorFile $file)
{
$viewer = $this->getViewer();
if (!$viewer->isLoggedIn()) {
$login_href = id(new PhutilURI('/auth/start/'))->setQueryParam('next', '/' . $file->getMonogram());
return id(new PHUIFormLayoutView())->addClass('phui-comment-panel-empty')->appendChild(id(new PHUIButtonView())->setTag('a')->setText(pht('Login to Comment'))->setHref((string) $login_href));
}
$draft = PhabricatorDraft::newFromUserAndKey($viewer, $file->getPHID());
$post_uri = $this->getApplicationURI('thread/' . $file->getPHID() . '/');
$form = id(new AphrontFormView())->setUser($viewer)->setAction($post_uri)->addSigil('lightbox-comment-form')->addClass('lightbox-comment-form')->setWorkflow(true)->appendChild(id(new PhabricatorRemarkupControl())->setUser($viewer)->setName('comment')->setValue($draft->getDraft()))->appendChild(id(new AphrontFormSubmitControl())->setValue(pht('Comment')));
$view = phutil_tag_div('phui-comment-panel', $form);
return $view;
}
示例2: writeChunk
private function writeChunk(PhabricatorFile $file, PhabricatorFileStorageEngine $engine)
{
$offset = $this->getTotalBytesWritten();
$max_length = $engine->getChunkSize();
$rope = $this->getRope();
$data = $rope->getPrefixBytes($max_length);
$actual_length = strlen($data);
$rope->removeBytesFromHead($actual_length);
$chunk_data = PhabricatorFile::newFromFileData($data, array('name' => $file->getMonogram() . '.chunk-' . $offset, 'viewPolicy' => PhabricatorPolicies::POLICY_NOONE));
$chunk = PhabricatorFileChunk::initializeNewChunk($file->getStorageHandle(), $offset, $offset + $actual_length);
$chunk->setDataFilePHID($chunk_data->getPHID())->save();
$this->setTotalBytesWritten($offset + $actual_length);
return $chunk;
}
示例3: 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'])->setFileMonogram($file->getMonogram());
}