本文整理汇总了PHP中AphrontSideNavFilterView::addIcon方法的典型用法代码示例。如果您正苦于以下问题:PHP AphrontSideNavFilterView::addIcon方法的具体用法?PHP AphrontSideNavFilterView::addIcon怎么用?PHP AphrontSideNavFilterView::addIcon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AphrontSideNavFilterView
的用法示例。
在下文中一共展示了AphrontSideNavFilterView::addIcon方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildIconNavView
public function buildIconNavView(PhabricatorUser $user)
{
$viewer = $this->getViewer();
$picture = $user->getProfileImageURI();
$name = $user->getUsername();
$nav = new AphrontSideNavFilterView();
$nav->setIconNav(true);
$nav->setBaseURI(new PhutilURI('/p/'));
$nav->addIcon("{$name}/", $name, null, $picture);
$class = 'PhabricatorCalendarApplication';
if (PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) {
$nav->addIcon("{$name}/calendar/", pht('Calendar'), 'fa-calendar');
}
$class = 'PhabricatorManiphestApplication';
if (PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) {
$phid = $user->getPHID();
$view_uri = sprintf('/maniphest/?statuses=open()&assigned=%s#R', $phid);
$nav->addIcon('maniphest', pht('Open Tasks'), 'fa-anchor', null, $view_uri);
}
$class = 'PhabricatorDifferentialApplication';
if (PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) {
$username = phutil_escape_uri($name);
$view_uri = '/differential/?authors=' . $username;
$nav->addIcon('differential', pht('Revisions'), 'fa-cog', null, $view_uri);
}
$class = 'PhabricatorAuditApplication';
if (PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) {
$username = phutil_escape_uri($name);
$view_uri = '/audit/?authors=' . $username;
$nav->addIcon('audit', pht('Commits'), 'fa-code', null, $view_uri);
}
return $nav;
}
示例2: buildIconNavView
public function buildIconNavView(PhabricatorProject $project)
{
$this->setProject($project);
$viewer = $this->getViewer();
$id = $project->getID();
$picture = $project->getProfileImageURI();
$name = $project->getName();
$columns = id(new PhabricatorProjectColumnQuery())->setViewer($viewer)->withProjectPHIDs(array($project->getPHID()))->execute();
if ($columns) {
$board_icon = 'fa-columns';
} else {
$board_icon = 'fa-columns grey';
}
$nav = new AphrontSideNavFilterView();
$nav->setIconNav(true);
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
$nav->addIcon("profile/{$id}/", $name, null, $picture);
$class = 'PhabricatorManiphestApplication';
if (PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) {
$phid = $project->getPHID();
$nav->addIcon("board/{$id}/", pht('Workboard'), $board_icon);
$query_uri = urisprintf('/maniphest/?statuses=open()&projects=%s#R', $phid);
$nav->addIcon(null, pht('Open Tasks'), 'fa-anchor', null, $query_uri);
}
$nav->addIcon("feed/{$id}/", pht('Feed'), 'fa-newspaper-o');
$nav->addIcon("members/{$id}/", pht('Members'), 'fa-group');
$nav->addIcon("details/{$id}/", pht('Edit Details'), 'fa-pencil');
return $nav;
}
示例3: buildIconNavView
public function buildIconNavView(PhabricatorProject $project)
{
$this->setProject($project);
$viewer = $this->getViewer();
$id = $project->getID();
$picture = $project->getProfileImageURI();
$name = $project->getName();
$columns = id(new PhabricatorProjectColumnQuery())->setViewer($viewer)->withProjectPHIDs(array($project->getPHID()))->execute();
if ($columns) {
$board_icon = 'fa-columns';
} else {
$board_icon = 'fa-columns grey';
}
$nav = new AphrontSideNavFilterView();
$nav->setIconNav(true);
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
$nav->addIcon("profile/{$id}/", $name, null, $picture);
$class = 'PhabricatorManiphestApplication';
if (PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) {
$phid = $project->getPHID();
$nav->addIcon("board/{$id}/", pht('Workboard'), $board_icon);
$query_uri = urisprintf('/maniphest/?statuses=open()&projects=%s#R', $phid);
$nav->addIcon(null, pht('Open Tasks'), 'fa-anchor', null, $query_uri);
}
$nav->addIcon("feed/{$id}/", pht('Feed'), 'fa-newspaper-o');
$nav->addIcon("members/{$id}/", pht('Members'), 'fa-group');
if (false && PhabricatorEnv::getEnvConfig('phabricator.show-prototypes')) {
if ($project->supportsSubprojects()) {
$subprojects_icon = 'fa-sitemap';
} else {
$subprojects_icon = 'fa-sitemap grey';
}
$key = PhabricatorProjectIconSet::getMilestoneIconKey();
$milestones_icon = PhabricatorProjectIconSet::getIconIcon($key);
if (!$project->supportsMilestones()) {
$milestones_icon = "{$milestones_icon} grey";
}
$nav->addIcon("subprojects/{$id}/", pht('Subprojects'), $subprojects_icon);
$nav->addIcon("milestones/{$id}/", pht('Milestones'), $milestones_icon);
}
return $nav;
}
示例4: buildSprintIconNavView
public function buildSprintIconNavView(PhabricatorProject $project)
{
$viewer = $this->getViewer();
$id = $project->getID();
$picture = $project->getProfileImageURI();
$name = $project->getName();
$enable_phragile = PhabricatorEnv::getEnvConfig('sprint.enable-phragile');
$phragile_base_uri = PhabricatorEnv::getEnvConfig('sprint.phragile-uri');
$phragile_uri = new PhutilURI($phragile_base_uri . $id);
$columns = id(new PhabricatorProjectColumnQuery())->setViewer($viewer)->withProjectPHIDs(array($project->getPHID()))->execute();
if ($columns) {
$board_icon = 'fa-columns';
} else {
$board_icon = 'fa-columns grey';
}
$nav = new AphrontSideNavFilterView();
$nav->setIconNav(true);
if ($this->isSprint($project) !== false) {
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
$nav->addIcon("profile/{$id}/", $name, null, $picture, null);
$nav->addIcon("burn/{$id}/", pht('Burndown'), 'fa-fire', null, null);
if ($enable_phragile) {
$nav->addIcon("sprints/{$id}/", pht('Phragile'), 'fa-pie-chart', null, $phragile_uri);
}
$nav->addIcon("board/{$id}/", pht('Sprint Board'), $board_icon, null, null);
$nav->addIcon('.', pht('Sprint List'), 'fa-bar-chart', null, null);
} else {
$nav->setBaseURI(new PhutilURI($this->getProjectsURI()));
$nav->addIcon("profile/{$id}/", $name, null, $picture);
$nav->addIcon("board/{$id}/", pht('Workboard'), $board_icon);
}
$class = 'PhabricatorManiphestApplication';
if (PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) {
$phid = $project->getPHID();
$query_uri = urisprintf('/maniphest/?statuses=open()&projects=%s#R', $phid);
$nav->addIcon(null, pht('Open Tasks'), 'fa-anchor', null, $query_uri);
}
$nav->addIcon("feed/{$id}/", pht('Feed'), 'fa-newspaper-o', null, null);
$nav->addIcon("members/{$id}/", pht('Members'), 'fa-group', null, null);
$nav->addIcon("details/{$id}/", pht('Edit Details'), 'fa-pencil', null, null);
return $nav;
}