本文整理汇总了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;
}
示例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;
}