本文整理汇总了PHP中AphrontSideNavFilterView::addSpacer方法的典型用法代码示例。如果您正苦于以下问题:PHP AphrontSideNavFilterView::addSpacer方法的具体用法?PHP AphrontSideNavFilterView::addSpacer怎么用?PHP AphrontSideNavFilterView::addSpacer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AphrontSideNavFilterView
的用法示例。
在下文中一共展示了AphrontSideNavFilterView::addSpacer方法的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: 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;
}
示例3: 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());
}
示例4: 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());
}
示例5: 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());
}
示例6: 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;
}
示例7: 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;
}
示例8: buildSideNavView
protected function buildSideNavView(PonderQuestion $question = null)
{
$side_nav = new AphrontSideNavFilterView();
$side_nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
if ($question && $question->getID()) {
$side_nav->addFilter(null, 'Q' . $question->getID(), 'Q' . $question->getID());
$side_nav->addSpacer();
}
$side_nav->addLabel('Create');
$side_nav->addFilter('question/ask', 'Ask a Question');
$side_nav->addSpacer();
$side_nav->addLabel('Questions');
$side_nav->addFilter('feed', 'All Questions');
$side_nav->addSpacer();
$side_nav->addLabel('User');
$side_nav->addFilter('questions', 'Your Questions');
$side_nav->addFilter('answers', 'Your Answers');
return $side_nav;
}
示例9: buildSideNavView
public function buildSideNavView(PhabricatorPaste $paste = null)
{
$user = $this->getRequest()->getUser();
$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('edit', 'New Paste', $this->getApplicationURI(), $relative = false, $class = $user->isLoggedIn() ? null : 'disabled');
$nav->addSpacer();
$nav->addLabel('Pastes');
if ($user->isLoggedIn()) {
$nav->addFilter('my', 'My Pastes');
}
$nav->addFilter('all', 'All Pastes');
return $nav;
}
示例10: 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;
}
示例11: 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;
}
示例12: 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->addLabel('Applications');
$categories = $this->loadDirectoryCategories();
foreach ($categories as $category) {
$nav->addFilter('directory/' . $category->getID(), $category->getName());
}
if ($user->getIsAdmin()) {
$nav->addSpacer();
$nav->addFilter('directory/edit', 'Edit Applications...');
}
return $nav;
}
示例13: buildSideNavView
public function buildSideNavView()
{
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
$is_admin = $this->getRequest()->getUser()->getIsAdmin();
if ($is_admin) {
$nav->addLabel('Create Users');
$nav->addFilter('edit', 'Create New User');
if (PhabricatorEnv::getEnvConfig('ldap.auth-enabled') === true) {
$nav->addFilter('ldap', 'Import from LDAP');
}
$nav->addSpacer();
}
$nav->addLabel('Directory');
$nav->addFilter('people', 'User Directory', $this->getApplicationURI());
if ($is_admin) {
$nav->addSpacer();
$nav->addLabel('Logs');
$nav->addFilter('logs', 'Activity Logs');
}
return $nav;
}
示例14: buildBaseSideNav
protected function buildBaseSideNav()
{
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI('/maniphest/view/'));
$request = $this->getRequest();
$user = $request->getUser();
$custom = id(new ManiphestSavedQuery())->loadAllWhere('userPHID = %s ORDER BY isDefault DESC, name ASC', $user->getPHID());
if ($custom) {
$nav->addLabel('Saved Queries');
foreach ($custom as $query) {
if ($query->getIsDefault()) {
$this->defaultQuery = $query;
}
$nav->addFilter('Q:' . $query->getQueryKey(), $query->getName(), '/maniphest/view/custom/?key=' . $query->getQueryKey());
}
$nav->addFilter('saved', 'Edit...', '/maniphest/custom/');
$nav->addSpacer();
}
$nav->addLabel('User Tasks');
$nav->addFilter('action', 'Assigned');
$nav->addFilter('created', 'Created');
$nav->addFilter('subscribed', 'Subscribed');
$nav->addFilter('triage', 'Need Triage');
$nav->addSpacer();
$nav->addLabel('User Projects');
$nav->addFilter('projecttriage', 'Need Triage');
$nav->addFilter('projectall', 'All Tasks');
$nav->addSpacer();
$nav->addLabel('All Tasks');
$nav->addFilter('alltriage', 'Need Triage');
$nav->addFilter('all', 'All Tasks');
$nav->addSpacer();
$nav->addLabel('Custom');
$nav->addFilter('custom', 'Custom Query');
$nav->addSpacer();
$nav->addLabel('Reports');
$nav->addFilter('report', 'Reports', '/maniphest/report/');
return $nav;
}
示例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;
}