本文整理匯總了PHP中PHUIObjectBoxView::setBackground方法的典型用法代碼示例。如果您正苦於以下問題:PHP PHUIObjectBoxView::setBackground方法的具體用法?PHP PHUIObjectBoxView::setBackground怎麽用?PHP PHUIObjectBoxView::setBackground使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PHUIObjectBoxView
的用法示例。
在下文中一共展示了PHUIObjectBoxView::setBackground方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: buildTagListTable
private function buildTagListTable(DiffusionRequest $drequest)
{
$viewer = $this->getViewer();
$repository = $drequest->getRepository();
switch ($repository->getVersionControlSystem()) {
case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
// no tags in SVN
return null;
}
$tag_limit = 15;
$tags = array();
$tags = DiffusionRepositoryTag::newFromConduit($this->callConduitWithDiffusionRequest('diffusion.tagsquery', array('commit' => null, 'limit' => $tag_limit + 1)));
if (!$tags) {
return null;
}
$more_tags = count($tags) > $tag_limit;
$tags = array_slice($tags, 0, $tag_limit);
$commits = id(new DiffusionCommitQuery())->setViewer($viewer)->withIdentifiers(mpull($tags, 'getCommitIdentifier'))->withRepository($repository)->needCommitData(true)->execute();
$view = id(new DiffusionTagListView())->setUser($viewer)->setDiffusionRequest($drequest)->setTags($tags)->setCommits($commits);
$phids = $view->getRequiredHandlePHIDs();
$handles = $this->loadViewerHandles($phids);
$view->setHandles($handles);
$panel = new PHUIObjectBoxView();
$header = new PHUIHeaderView();
$header->setHeader(pht('Tags'));
if ($more_tags) {
$header->setSubHeader(pht('Showing the %d most recent tags.', $tag_limit));
}
$button = new PHUIButtonView();
$button->setText(pht('Show All Tags'));
$button->setTag('a');
$button->setIcon('fa-tag');
$button->setHref($drequest->generateURI(array('action' => 'tags')));
$header->addActionLink($button);
$panel->setHeader($header);
$panel->setTable($view);
$panel->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
return $panel;
}