Redesign header menus and search
Summary: Still lots to fix here, punting up since I'm running into a few roadblocks. TODO: [] Sort Personal/Global correctly [] Quicksand in Help Items correctly on page changes Test Plan: Verify new menus work on desktop, tablet, mobile. Test logged in menus, logged out menus. Logging out via a menu, verify each link works as expected. Help menus get build when using an app like Maniphest, Differential. Check that search works, preferences still save. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T12107 Differential Revision: https://secure.phabricator.com/D17209
This commit is contained in:
@@ -31,7 +31,6 @@ final class PhabricatorHelpDocumentationController
|
||||
$list->addItem(
|
||||
id(new PHUIObjectItemView())
|
||||
->setHeader($item->getName())
|
||||
->setWorkflow($item->getWorkflow())
|
||||
->setHref($item->getHref()));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
<?php
|
||||
|
||||
final class PhabricatorHelpMainMenuBarExtension
|
||||
extends PhabricatorMainMenuBarExtension {
|
||||
|
||||
const MAINMENUBARKEY = 'help';
|
||||
|
||||
public function isExtensionEnabledForViewer(PhabricatorUser $viewer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function buildMainMenus() {
|
||||
$application = $this->getApplication();
|
||||
if (!$application) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$viewer = $this->getViewer();
|
||||
$help_links = $application->getHelpMenuItems($viewer);
|
||||
if (!$help_links) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$help_id = celerity_generate_unique_node_id();
|
||||
|
||||
Javelin::initBehavior(
|
||||
'aphlict-dropdown',
|
||||
array(
|
||||
'bubbleID' => $help_id,
|
||||
'dropdownID' => 'phabricator-help-menu',
|
||||
'local' => true,
|
||||
'desktop' => true,
|
||||
'right' => true,
|
||||
));
|
||||
|
||||
$help_name = pht('%s Help', $application->getName());
|
||||
|
||||
$help_item = id(new PHUIListItemView())
|
||||
->setIcon('fa-book')
|
||||
->addClass('core-menu-item')
|
||||
->setID($help_id)
|
||||
->setName($help_name)
|
||||
->setHref('/help/documentation/'.get_class($application).'/')
|
||||
->setAural($help_name);
|
||||
|
||||
$view = new PHUIListView();
|
||||
foreach ($help_links as $help_link) {
|
||||
$view->addMenuItem($help_link);
|
||||
}
|
||||
|
||||
$dropdown_menu = phutil_tag(
|
||||
'div',
|
||||
array(
|
||||
'id' => 'phabricator-help-menu',
|
||||
'class' => 'phabricator-main-menu-dropdown phui-list-sidenav',
|
||||
'style' => 'display: none',
|
||||
),
|
||||
$view);
|
||||
|
||||
$help_menu = id(new PHUIMainMenuView())
|
||||
->setOrder(200)
|
||||
->setMenuBarItem($help_item)
|
||||
->appendChild($dropdown_menu);
|
||||
|
||||
return array(
|
||||
$help_menu,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user