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


PHP AphrontSideNavFilterView::addClass方法代码示例

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


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

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

示例2: newAutomaticMenuItems

 private function newAutomaticMenuItems(AphrontSideNavFilterView $nav)
 {
     $items = array();
     // NOTE: We're adding a spacer item for the fixed footer, so that if the
     // menu taller than the page content you can still scroll down the page far
     // enough to access the last item without the content being obscured by the
     // fixed items.
     $items[] = id(new PHUIListItemView())->setHideInApplicationMenu(true)->addClass('phui-profile-menu-spacer');
     $collapse_id = celerity_generate_unique_node_id();
     $viewer = $this->getViewer();
     $collapse_key = PhabricatorUserPreferences::PREFERENCE_PROFILE_MENU_COLLAPSED;
     $preferences = $viewer->loadPreferences();
     $is_collapsed = $preferences->getPreference($collapse_key, false);
     if ($is_collapsed) {
         $nav->addClass('phui-profile-menu-collapsed');
     } else {
         $nav->addClass('phui-profile-menu-expanded');
     }
     if ($viewer->isLoggedIn()) {
         $settings_uri = '/settings/adjust/?key=' . $collapse_key;
     } else {
         $settings_uri = null;
     }
     Javelin::initBehavior('phui-profile-menu', array('menuID' => $nav->getMainID(), 'collapseID' => $collapse_id, 'isCollapsed' => (bool) $is_collapsed, 'settingsURI' => $settings_uri));
     $collapse_icon = id(new PHUIIconCircleView())->addClass('phui-list-item-icon')->addClass('phui-profile-menu-visible-when-expanded')->setIcon('fa-chevron-left');
     $expand_icon = id(new PHUIIconCircleView())->addClass('phui-list-item-icon')->addClass('phui-profile-menu-visible-when-collapsed')->addSigil('has-tooltip')->setMetadata(array('tip' => pht('Expand'), 'align' => 'E'))->setIcon('fa-chevron-right');
     $items[] = id(new PHUIListItemView())->setName('Collapse')->addIcon($collapse_icon)->addIcon($expand_icon)->setID($collapse_id)->addClass('phui-profile-menu-footer')->addClass('phui-profile-menu-footer-1')->setHideInApplicationMenu(true)->setHref('#');
     return $items;
 }
开发者ID:truSense,项目名称:phabricator,代码行数:29,代码来源:PhabricatorProfilePanelEngine.php


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