本文整理汇总了PHP中AphrontSideNavFilterView::addLabel方法的典型用法代码示例。如果您正苦于以下问题:PHP AphrontSideNavFilterView::addLabel方法的具体用法?PHP AphrontSideNavFilterView::addLabel怎么用?PHP AphrontSideNavFilterView::addLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AphrontSideNavFilterView
的用法示例。
在下文中一共展示了AphrontSideNavFilterView::addLabel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderSideNavFilterView
private function renderSideNavFilterView($filter)
{
$base_uri = new PhutilURI('/phame/');
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI($base_uri);
$nav->addLabel('Drafts');
$nav->addFilter('post/new', 'New Draft');
$nav->addFilter('draft', 'My Drafts');
foreach ($this->getSideNavExtraDraftFilters() as $draft_filter) {
$nav->addFilter($draft_filter['key'], $draft_filter['name'], idx($draft_filter, 'uri'));
}
$nav->addSpacer();
$nav->addLabel('Posts');
$nav->addFilter('post', 'My Posts');
$nav->addFilter('post/all', 'All Posts', $base_uri);
foreach ($this->getSideNavExtraPostFilters() as $post_filter) {
$nav->addFilter($post_filter['key'], $post_filter['name'], idx($post_filter, 'uri'));
}
$nav->addSpacer();
$nav->addLabel('Blogs');
foreach ($this->getSideNavBlogFilters() as $blog_filter) {
$nav->addFilter($blog_filter['key'], $blog_filter['name'], idx($blog_filter, 'uri'));
}
$nav->selectFilter($filter);
return $nav;
}
示例2: buildStandardPageResponse
public function buildStandardPageResponse($view, array $data)
{
$user = $this->getRequest()->getUser();
$page = $this->buildStandardPageView();
$page->setApplicationName('OAuth Server');
$page->setBaseURI('/oauthserver/');
$page->setTitle(idx($data, 'title'));
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI('/oauthserver/'));
$nav->addLabel('Client Authorizations');
$nav->addFilter('clientauthorization', 'My Authorizations');
$nav->addSpacer();
$nav->addLabel('Clients');
$nav->addFilter('client/create', 'Create Client');
foreach ($this->getExtraClientFilters() as $filter) {
$nav->addFilter($filter['url'], $filter['label']);
}
$nav->addFilter('client', 'My Clients');
$nav->selectFilter($this->getFilter(), 'clientauthorization');
$nav->appendChild($view);
$page->appendChild($nav);
$doc_href = PhabricatorEnv::getDoclink('article/Using_the_Phabricator_OAuth_Server.html');
$page->setTabs(array('help' => array('name' => 'Help', 'href' => $doc_href)), null);
$response = new AphrontWebpageResponse();
return $response->setContent($page->render());
}
示例3: buildSideNavView
protected function buildSideNavView(PhabricatorFileImageMacro $macro = null)
{
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
$nav->addLabel('Create');
$nav->addFilter('edit', 'Create Macro');
$nav->addSpacer();
$nav->addLabel('Macros');
$nav->addFilter('', 'All Macros');
return $nav;
}
示例4: buildSideNavView
protected function buildSideNavView()
{
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
$nav->addLabel(pht('Daemons'));
$nav->addFilter('/', pht('Console'));
$nav->addFilter('log', pht('All Daemons'));
$nav->addLabel(pht('Bulk Jobs'));
$nav->addFilter('bulk', pht('Manage Bulk Jobs'));
return $nav;
}
示例5: buildSideNavView
protected function buildSideNavView()
{
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
$nav->addLabel('Daemons');
$nav->addFilter('', 'Console', $this->getApplicationURI());
$nav->addFilter('log/running', 'Running Daemons');
$nav->addFilter('log', 'All Daemons');
$nav->addFilter('log/combined', 'Combined Log');
$nav->addSpacer();
$nav->addLabel('Event Timeline');
$nav->addFilter('timeline', 'Timeline');
return $nav;
}
示例6: renderSideNavFilterView
protected function renderSideNavFilterView()
{
$base_uri = new PhutilURI($this->getApplicationURI());
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI($base_uri);
$nav->addLabel(pht('Posts'));
$nav->addFilter('post/all', pht('Latest Posts'));
$nav->addFilter('post/draft', pht('My Drafts'));
$nav->addFilter('post', pht('My Posts'));
$nav->addLabel(pht('Blogs'));
$nav->addFilter('blog/user', pht('Joinable Blogs'));
$nav->addFilter('blog/all', pht('All Blogs'));
$nav->selectFilter(null);
return $nav;
}
示例7: buildSideNavView
public function buildSideNavView()
{
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
$nav->addLabel('Mail Logs');
$nav->addFilter('sent', 'Sent Mail', $this->getApplicationURI());
$nav->addFilter('received', 'Received Mail');
$nav->addSpacer();
if ($this->getRequest()->getUser()->getIsAdmin()) {
$nav->addLabel('Diagnostics');
$nav->addFilter('send', 'Send Test');
$nav->addFilter('receive', 'Receive Test');
}
return $nav;
}
示例8: buildStandardPageResponse
public function buildStandardPageResponse($view, array $data)
{
$page = $this->buildStandardPageView();
$page->setApplicationName('Conduit');
$page->setBaseURI('/conduit/');
$page->setTitle(idx($data, 'title'));
$page->setGlyph("⇵");
if ($this->showSideNav()) {
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI('/conduit/'));
$method_filters = $this->getMethodFilters();
foreach ($method_filters as $group => $methods) {
$nav->addLabel($group);
foreach ($methods as $method) {
$method_name = $method['full_name'];
$display_name = $method_name;
switch ($method['status']) {
case ConduitAPIMethod::METHOD_STATUS_DEPRECATED:
$display_name = '(' . $display_name . ')';
break;
}
$nav->addFilter('method/' . $method_name, $display_name);
}
$nav->addSpacer();
}
$nav->selectFilter($this->getFilter());
$nav->appendChild($view);
$body = $nav;
} else {
$body = $view;
}
$page->appendChild($body);
$response = new AphrontWebpageResponse();
return $response->setContent($page->render());
}
示例9: buildSideNavView
public function buildSideNavView(PhabricatorPaste $paste = null)
{
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI('filter/')));
if ($paste) {
$nav->addFilter('paste', 'P' . $paste->getID(), '/P' . $paste->getID());
$nav->addSpacer();
}
$nav->addLabel('Create');
$nav->addFilter('create', 'New Paste');
$nav->addSpacer();
$nav->addLabel('Pastes');
$nav->addFilter('my', 'My Pastes');
$nav->addFilter('all', 'All Pastes');
return $nav;
}
示例10: buildSideNavView
public function buildSideNavView()
{
$nav = new AphrontSideNavFilterView();
$base_uri = new PhutilURI('/owners/');
$nav->setBaseURI($base_uri);
$nav->addLabel(pht('Packages'));
$this->getExtraPackageViews($nav);
$nav->addFilter('view/owned', pht('Owned'));
$nav->addFilter('view/projects', pht('Projects'));
$nav->addFilter('view/all', pht('All'));
$nav->selectFilter($this->getSideNavFilter(), 'view/owned');
$filter = $nav->getSelectedFilter();
switch ($filter) {
case 'view/owned':
$title = pht('Owned Packages');
break;
case 'view/all':
$title = pht('All Packages');
break;
case 'view/projects':
$title = pht('Projects');
break;
case 'new':
$title = pht('New Package');
break;
default:
$title = pht('Package');
break;
}
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($title);
$crumbs->addAction(id(new PHUIListItemView())->setName(pht('Create Package'))->setHref('/owners/new/')->setIcon('fa-plus-square'));
$nav->setCrumbs($crumbs);
return $nav;
}
示例11: buildSideNavView
public function buildSideNavView($for_app = false)
{
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
$name = null;
if ($for_app) {
$name = $this->getRequest()->getURIData('username');
if ($name) {
$nav->setBaseURI(new PhutilURI('/p/'));
$nav->addFilter("{$name}/", $name);
$nav->addFilter("{$name}/calendar/", pht('Calendar'));
}
}
if (!$name) {
$viewer = $this->getRequest()->getUser();
id(new PhabricatorPeopleSearchEngine())->setViewer($viewer)->addNavigationItems($nav->getMenu());
if ($viewer->getIsAdmin()) {
$nav->addLabel(pht('User Administration'));
if (PhabricatorLDAPAuthProvider::getLDAPProvider()) {
$nav->addFilter('ldap', pht('Import from LDAP'));
}
$nav->addFilter('logs', pht('Activity Logs'));
$nav->addFilter('invite', pht('Email Invitations'));
}
}
return $nav;
}
示例12: renderSideNav
private function renderSideNav($oauth_providers)
{
$sidenav = new AphrontSideNavFilterView();
$sidenav->setBaseURI(new PhutilURI('/settings/page/'))->addLabel('Account Information')->addFilter('account', 'Account')->addFilter('profile', 'Profile')->addSpacer()->addLabel('Email')->addFilter('email', 'Email Address')->addFilter('emailpref', 'Email Preferences')->addSpacer()->addLabel('Authentication');
if (PhabricatorEnv::getEnvConfig('account.editable') && PhabricatorEnv::getEnvConfig('auth.password-auth-enabled')) {
$sidenav->addFilter('password', 'Password');
}
$sidenav->addFilter('conduit', 'Conduit Certificate');
if (PhabricatorUserSSHKeysSettingsPanelController::isEnabled()) {
$sidenav->addFilter('sshkeys', 'SSH Public Keys');
}
$sidenav->addSpacer();
$sidenav->addLabel('Application Settings');
$sidenav->addFilter('preferences', 'Display Preferences');
$sidenav->addFilter('search', 'Search Preferences');
$items = array();
foreach ($oauth_providers as $provider) {
if (!$provider->isProviderEnabled()) {
continue;
}
$key = $provider->getProviderKey();
$name = $provider->getProviderName();
$items[$key] = $name . ' Account';
}
if ($items) {
$sidenav->addSpacer();
$sidenav->addLabel('Linked Accounts');
foreach ($items as $key => $name) {
$sidenav->addFilter($key, $name);
}
}
return $sidenav;
}
示例13: buildSideNavView
/**
* @param PhutilURI $uri
*/
public function buildSideNavView($viewer, $uri, $for_app = false)
{
$request = $this->getRequest();
$id = $request->getURIData('id');
$slug = $request->getURIData('slug');
if ($slug) {
$id = $this->getProjectIDfromSlug($slug, $viewer);
}
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI($uri);
if ($for_app) {
if ($id) {
$nav->addFilter("profile/{$id}/", pht('Profile'));
$nav->addFilter("board/{$id}/", pht('Workboard'));
$nav->addFilter("members/{$id}/", pht('Members'));
$nav->addFilter("feed/{$id}/", pht('Feed'));
$nav->addFilter("details/{$id}/", pht('Edit Details'));
}
$nav->addFilter('create', pht('Create Project'));
}
id(new PhabricatorProjectSearchEngine())->setViewer($viewer)->addNavigationItems($nav->getMenu());
if ($viewer->isLoggedIn()) {
$nav->addLabel(pht('Sprints'));
$nav->addFilter('report/list', pht('Sprint List'));
}
$nav->selectFilter(null);
return $nav;
}
示例14: renderSideNavFilterView
private function renderSideNavFilterView($filter)
{
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI('/phame/'));
$nav->addLabel('Drafts');
$nav->addFilter('post/new', 'New Draft');
$nav->addFilter('draft', 'My Drafts');
$nav->addSpacer();
$nav->addLabel('Posts');
$nav->addFilter('post', 'My Posts');
foreach ($this->getSideNavExtraPostFilters() as $post_filter) {
$nav->addFilter($post_filter['key'], $post_filter['name']);
}
$nav->selectFilter($filter, 'post');
return $nav;
}
示例15: buildSideNavView
public function buildSideNavView($filter = null, $for_app = false)
{
$user = $this->getRequest()->getUser();
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
$nav->addLabel(pht('Configuration'));
$nav->addFilter('/', pht('Browse Settings'));
$nav->addFilter('all/', pht('All Settings'));
$nav->addFilter('history/', pht('Settings History'));
$nav->addLabel(pht('Setup'));
$nav->addFilter('issue/', pht('Setup Issues'));
$nav->addLabel(pht('Database'));
$nav->addFilter('database/', pht('Database Status'));
$nav->addFilter('dbissue/', pht('Database Issues'));
$nav->addLabel(pht('Cache'));
$nav->addFilter('cache/', pht('Cache Status'));
$nav->addLabel(pht('Cluster'));
$nav->addFilter('cluster/databases/', pht('Database Servers'));
$nav->addFilter('cluster/notifications/', pht('Notification Servers'));
$nav->addFilter('cluster/repositories/', pht('Repository Servers'));
$nav->addLabel(pht('Welcome'));
$nav->addFilter('welcome/', pht('Welcome Screen'));
$nav->addLabel(pht('Modules'));
$modules = PhabricatorConfigModule::getAllModules();
foreach ($modules as $key => $module) {
$nav->addFilter('module/' . $key . '/', $module->getModuleName());
}
return $nav;
}