当前位置: 首页>>代码示例>>PHP>>正文


PHP AphrontSideNavFilterView::addFilter方法代码示例

本文整理汇总了PHP中AphrontSideNavFilterView::addFilter方法的典型用法代码示例。如果您正苦于以下问题:PHP AphrontSideNavFilterView::addFilter方法的具体用法?PHP AphrontSideNavFilterView::addFilter怎么用?PHP AphrontSideNavFilterView::addFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AphrontSideNavFilterView的用法示例。


在下文中一共展示了AphrontSideNavFilterView::addFilter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: buildLocalNavigation

 protected function buildLocalNavigation(PhabricatorProject $project)
 {
     $id = $project->getID();
     $nav_view = new AphrontSideNavFilterView();
     $uri = new PhutilURI('/project/view/' . $id . '/');
     $nav_view->setBaseURI($uri);
     $external_arrow = "↗";
     $tasks_uri = '/maniphest/view/all/?projects=' . $project->getPHID();
     $slug = PhabricatorSlug::normalize($project->getName());
     $phriction_uri = '/w/projects/' . $slug;
     $edit_uri = '/project/edit/' . $id . '/';
     $members_uri = '/project/members/' . $id . '/';
     $nav_view->addFilter('dashboard', 'Dashboard');
     $nav_view->addSpacer();
     $nav_view->addFilter('feed', 'Feed');
     $nav_view->addFilter(null, 'Tasks ' . $external_arrow, $tasks_uri);
     $nav_view->addFilter(null, 'Wiki ' . $external_arrow, $phriction_uri);
     $nav_view->addFilter('people', 'People');
     $nav_view->addFilter('about', 'About');
     $user = $this->getRequest()->getUser();
     $can_edit = PhabricatorPolicyCapability::CAN_EDIT;
     $nav_view->addSpacer();
     if (PhabricatorPolicyFilter::hasCapability($user, $project, $can_edit)) {
         $nav_view->addFilter('edit', "Edit Project…", $edit_uri);
         $nav_view->addFilter('members', "Edit Members…", $members_uri);
     } else {
         $nav_view->addFilter('edit', "Edit Project…", $edit_uri, $relative = false, 'disabled');
         $nav_view->addFilter('members', "Edit Members…", $members_uri, $relative = false, 'disabled');
     }
     return $nav_view;
 }
开发者ID:neoxen,项目名称:phabricator,代码行数:31,代码来源:PhabricatorProjectController.php

示例2: 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;
 }
开发者ID:ramons03,项目名称:phabricator,代码行数:33,代码来源:PhabricatorUserSettingsController.php

示例3: 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());
 }
开发者ID:nexeck,项目名称:phabricator,代码行数:26,代码来源:PhabricatorOAuthServerController.php

示例4: 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;
 }
开发者ID:patelhardik,项目名称:phabricator,代码行数:27,代码来源:PhabricatorPeopleController.php

示例5: buildStandardPageResponse

 public function buildStandardPageResponse($view, array $data)
 {
     $page = $this->buildStandardPageView();
     $page->setApplicationName('Herald');
     $page->setBaseURI('/herald/');
     $page->setTitle(idx($data, 'title'));
     $page->setGlyph("☿");
     $doclink = PhabricatorEnv::getDoclink('article/Herald_User_Guide.html');
     $nav = new AphrontSideNavFilterView();
     $nav->setBaseURI(new PhutilURI('/herald/'))->addLabel('Rules')->addFilter('new', 'Create Rule');
     $rules_map = HeraldContentTypeConfig::getContentTypeMap();
     $first_filter = null;
     foreach ($rules_map as $key => $value) {
         $nav->addFilter('view/' . $key, $value);
         if (!$first_filter) {
             $first_filter = 'view/' . $key;
         }
     }
     $nav->addSpacer()->addLabel('Utilities')->addFilter('test', 'Test Console')->addFilter('transcript', 'Transcripts');
     $user = $this->getRequest()->getUser();
     if ($user->getIsAdmin()) {
         $nav->addSpacer()->addLabel('Admin');
         $view_PHID = nonempty($this->getRequest()->getStr('phid'), null);
         foreach ($rules_map as $key => $value) {
             $nav->addFilter('all/view/' . $key, $value);
         }
     }
     $nav->selectFilter($this->getFilter(), $first_filter);
     $nav->appendChild($view);
     $page->appendChild($nav);
     $tabs = array('help' => array('href' => $doclink, 'name' => 'Help'));
     $page->setTabs($tabs, null);
     $response = new AphrontWebpageResponse();
     return $response->setContent($page->render());
 }
开发者ID:netcomtec,项目名称:phabricator,代码行数:35,代码来源:HeraldController.php

示例6: buildSideNav

 protected function buildSideNav()
 {
     $nav = new AphrontSideNavFilterView();
     $nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
     $nav->addLabel(pht('Tokens'));
     $nav->addFilter('given/', pht('Tokens Given'));
     $nav->addFilter('leaders/', pht('Leader Board'));
     return $nav;
 }
开发者ID:pugong,项目名称:phabricator,代码行数:9,代码来源:PhabricatorTokenController.php

示例7: 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'));
     return $nav;
 }
开发者ID:denghp,项目名称:phabricator,代码行数:9,代码来源:PhabricatorDaemonController.php

示例8: 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('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;
 }
开发者ID:pugong,项目名称:phabricator,代码行数:25,代码来源:PhabricatorConfigController.php

示例9: 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;
 }
开发者ID:rudimk,项目名称:phabricator,代码行数:11,代码来源:PhabricatorMacroController.php

示例10: buildSideNavView

 public function buildSideNavView()
 {
     $nav = new AphrontSideNavFilterView();
     $nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
     // These are only used on mobile.
     $nav->addFilter('blueprint', pht('Blueprints'));
     $nav->addFilter('resource', pht('Resources'));
     $nav->addFilter('lease', pht('Leases'));
     $nav->selectFilter(null);
     return $nav;
 }
开发者ID:remxcode,项目名称:phabricator,代码行数:11,代码来源:DrydockConsoleController.php

示例11: buildSideNav

 protected final function buildSideNav($selected)
 {
     $nav = new AphrontSideNavFilterView();
     $nav->setBaseURI(new PhutilURI('/drydock/'));
     $nav->addFilter('resource', 'Resources');
     $nav->addFilter('lease', 'Leases');
     $nav->addSpacer();
     $nav->addFilter('log', 'Logs');
     $nav->selectFilter($selected, 'resource');
     return $nav;
 }
开发者ID:neoxen,项目名称:phabricator,代码行数:11,代码来源:DrydockController.php

示例12: 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('Site Configuration'));
     $nav->addFilter('/', pht('Option Groups'));
     $nav->addFilter('all/', pht('All Settings'));
     $nav->addFilter('issue/', pht('Setup Issues'));
     $nav->addFilter('welcome/', pht('Welcome Screen'));
     return $nav;
 }
开发者ID:denghp,项目名称:phabricator,代码行数:12,代码来源:PhabricatorConfigController.php

示例13: buildSideNavView

 public function buildSideNavView($for_app = false)
 {
     $user = $this->getRequest()->getUser();
     $nav = new AphrontSideNavFilterView();
     $nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
     if ($for_app) {
         $nav->addFilter('create', pht('New Document'));
         $nav->addFilter('/phriction/', pht('Index'));
     }
     id(new PhrictionSearchEngine())->setViewer($user)->addNavigationItems($nav->getMenu());
     $nav->selectFilter(null);
     return $nav;
 }
开发者ID:pugong,项目名称:phabricator,代码行数:13,代码来源:PhrictionController.php

示例14: buildSideNav

 public function buildSideNav($for_app = false)
 {
     $user = $this->getRequest()->getUser();
     $nav = new AphrontSideNavFilterView();
     $nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
     if ($for_app) {
         $nav->addFilter('create/', pht('Create Document'));
     }
     id(new LegalpadDocumentSearchEngine())->setViewer($user)->addNavigationItems($nav->getMenu());
     $nav->addLabel(pht('Signatures'));
     $nav->addFilter('signatures/', pht('Find Signatures'));
     return $nav;
 }
开发者ID:truSense,项目名称:phabricator,代码行数:13,代码来源:LegalpadController.php

示例15: buildNav

 public function buildNav()
 {
     $user = $this->getRequest()->getUser();
     $nav = new AphrontSideNavFilterView();
     $nav->setBaseURI(new PhutilURI('/'));
     $nav->addLabel('Phabricator');
     $nav->addFilter('home', 'Tactical Command', '/');
     $nav->addFilter('jump', 'Jump Nav');
     $nav->addFilter('feed', 'Feed');
     $nav->addSpacer();
     $nav->addFilter('applications', 'More Stuff');
     return $nav;
 }
开发者ID:rudimk,项目名称:phabricator,代码行数:13,代码来源:PhabricatorDirectoryController.php


注:本文中的AphrontSideNavFilterView::addFilter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。