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


PHP AphrontSideNavFilterView::setBaseURI方法代码示例

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


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

示例1: 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:truSense,项目名称:phabricator,代码行数:27,代码来源:PhabricatorPeopleController.php

示例2: buildNav

 public function buildNav()
 {
     $user = $this->getRequest()->getUser();
     $nav = new AphrontSideNavFilterView();
     $nav->setBaseURI(new PhutilURI('/'));
     $applications = id(new PhabricatorApplicationQuery())->setViewer($user)->withInstalled(true)->withUnlisted(false)->withLaunchable(true)->execute();
     $pinned = $user->loadPreferences()->getPinnedApplications($applications, $user);
     // Force "Applications" to appear at the bottom.
     $meta_app = 'PhabricatorApplicationsApplication';
     $pinned = array_fuse($pinned);
     unset($pinned[$meta_app]);
     $pinned[$meta_app] = $meta_app;
     $applications[$meta_app] = PhabricatorApplication::getByClass($meta_app);
     $tiles = array();
     $home_app = new PhabricatorHomeApplication();
     $tiles[] = id(new PhabricatorApplicationLaunchView())->setApplication($home_app)->setApplicationStatus($home_app->loadStatus($user))->addClass('phabricator-application-launch-phone-only')->setUser($user);
     foreach ($pinned as $pinned_application) {
         if (empty($applications[$pinned_application])) {
             continue;
         }
         $application = $applications[$pinned_application];
         $tile = id(new PhabricatorApplicationLaunchView())->setApplication($application)->setApplicationStatus($application->loadStatus($user))->setUser($user);
         $tiles[] = $tile;
     }
     $nav->addCustomBlock(phutil_tag('div', array('class' => 'application-tile-group'), $tiles));
     $nav->addFilter('', pht('Customize Applications...'), '/settings/panel/home/');
     $nav->addClass('phabricator-side-menu-home');
     $nav->selectFilter(null);
     return $nav;
 }
开发者ID:denghp,项目名称:phabricator,代码行数:30,代码来源:PhabricatorHomeController.php

示例3: 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

示例4: buildSprintNavView

 /**
  * @param PhutilURI $uri
  */
 public function buildSprintNavView($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;
 }
开发者ID:iwastenotsystems,项目名称:phabricator-extensions-Sprint,代码行数:31,代码来源:SprintController.php

示例5: processRequest

 public function processRequest()
 {
     $classes = id(new PhutilSymbolLoader())->setAncestorClass('PhabricatorUIExample')->loadObjects();
     $classes = msort($classes, 'getName');
     $nav = new AphrontSideNavFilterView();
     $nav->setBaseURI(new PhutilURI($this->getApplicationURI('view/')));
     foreach ($classes as $class => $obj) {
         $name = $obj->getName();
         $nav->addFilter($class, $name);
     }
     $selected = $nav->selectFilter($this->class, head_key($classes));
     $example = $classes[$selected];
     $example->setRequest($this->getRequest());
     $result = $example->renderExample();
     if ($result instanceof AphrontResponse) {
         // This allows examples to generate dialogs, etc., for demonstration.
         return $result;
     }
     require_celerity_resource('phabricator-ui-example-css');
     $crumbs = $this->buildApplicationCrumbs();
     $crumbs->addTextCrumb($example->getName());
     $header = id(new PHUIHeaderView())->setHeader(pht('%s (%s)', $example->getName(), get_class($example)))->setSubheader($example->getDescription())->setNoBackground(true);
     $nav->appendChild(array($crumbs, $header, phutil_tag('br'), $result));
     return $this->buildApplicationPage($nav, array('title' => $example->getName()));
 }
开发者ID:denghp,项目名称:phabricator,代码行数:25,代码来源:PhabricatorUIExampleRenderController.php

示例6: 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

示例7: 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

示例8: newFromMenu

 public static function newFromMenu(PHUIListView $menu)
 {
     $object = new AphrontSideNavFilterView();
     $object->setBaseURI(new PhutilURI('/'));
     $object->menu = $menu;
     return $object;
 }
开发者ID:hrb518,项目名称:phabricator,代码行数:7,代码来源:AphrontSideNavFilterView.php

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

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

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

示例12: handleRequest

 public function handleRequest(AphrontRequest $request)
 {
     $id = $request->getURIData('class');
     $classes = id(new PhutilSymbolLoader())->setAncestorClass('PhabricatorUIExample')->loadObjects();
     $classes = msort($classes, 'getName');
     $nav = new AphrontSideNavFilterView();
     $nav->setBaseURI(new PhutilURI($this->getApplicationURI('view/')));
     foreach ($classes as $class => $obj) {
         $name = $obj->getName();
         $nav->addFilter($class, $name);
     }
     $selected = $nav->selectFilter($id, head_key($classes));
     $example = $classes[$selected];
     $example->setRequest($this->getRequest());
     $result = $example->renderExample();
     if ($result instanceof AphrontResponse) {
         // This allows examples to generate dialogs, etc., for demonstration.
         return $result;
     }
     require_celerity_resource('phabricator-ui-example-css');
     $crumbs = $this->buildApplicationCrumbs();
     $crumbs->addTextCrumb($example->getName());
     $note = id(new PHUIInfoView())->setTitle(pht('%s (%s)', $example->getName(), get_class($example)))->appendChild($example->getDescription())->setSeverity(PHUIInfoView::SEVERITY_NODATA);
     $nav->appendChild(array($crumbs, $note, $result));
     return $this->buildApplicationPage($nav, array('title' => $example->getName()));
 }
开发者ID:JohnnyEstilles,项目名称:phabricator,代码行数:26,代码来源:PhabricatorUIExampleRenderController.php

示例13: 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

示例14: processRequest

 public function processRequest()
 {
     $classes = id(new PhutilSymbolLoader())->setAncestorClass('PhabricatorUIExample')->setConcreteOnly(true)->selectAndLoadSymbols();
     $classes = ipull($classes, 'name', 'name');
     foreach ($classes as $class => $ignored) {
         $classes[$class] = newv($class, array());
     }
     $classes = msort($classes, 'getName');
     $nav = new AphrontSideNavFilterView();
     $nav->setBaseURI(new PhutilURI($this->getApplicationURI('view/')));
     foreach ($classes as $class => $obj) {
         $name = $obj->getName();
         $nav->addFilter($class, $name);
     }
     $selected = $nav->selectFilter($this->class, head_key($classes));
     require_celerity_resource('phabricator-ui-example-css');
     $example = $classes[$selected];
     $example->setRequest($this->getRequest());
     $result = $example->renderExample();
     if ($result instanceof AphrontResponse) {
         // This allows examples to generate dialogs, etc., for demonstration.
         return $result;
     }
     $nav->appendChild('<div class="phabricator-ui-example-header">' . '<h1 class="phabricator-ui-example-name">' . phutil_escape_html($example->getName()) . ' (' . get_class($example) . ')' . '</h1>' . '<p class="phabricator-ui-example-description">' . $example->getDescription() . '</p>' . '</div>');
     $nav->appendChild($result);
     return $this->buildApplicationPage($nav, array('title' => 'UI Example', 'device' => true));
 }
开发者ID:rudimk,项目名称:phabricator,代码行数:27,代码来源:PhabricatorUIExampleRenderController.php

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


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