本文整理汇总了PHP中AphrontSideNavFilterView::getMainID方法的典型用法代码示例。如果您正苦于以下问题:PHP AphrontSideNavFilterView::getMainID方法的具体用法?PHP AphrontSideNavFilterView::getMainID怎么用?PHP AphrontSideNavFilterView::getMainID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AphrontSideNavFilterView
的用法示例。
在下文中一共展示了AphrontSideNavFilterView::getMainID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}