mirror of
https://we.phorge.it/source/phorge.git
synced 2025-04-01 23:18:15 +02:00
Always render extra menu nodes, even when logged out
Summary: Fixes T7915. This code is a little janky, but make it work for now. Currently, we render "extra" nodes (dropdowns, etc) only if the user is logged in. Instead, always render them. Test Plan: - No more "phabricator-help-menu" error in console when logged out. - Search selector now works when logged out. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T7915 Differential Revision: https://secure.phabricator.com/D12572
This commit is contained in:
parent
52b9e5ec14
commit
ae192e5328
2 changed files with 17 additions and 19 deletions
|
@ -79,16 +79,13 @@ final class PhabricatorHelpApplication extends PhabricatorApplication {
|
||||||
PhabricatorUser $viewer,
|
PhabricatorUser $viewer,
|
||||||
PhabricatorController $controller = null) {
|
PhabricatorController $controller = null) {
|
||||||
|
|
||||||
if (!$controller) {
|
$application = null;
|
||||||
return null;
|
if ($controller) {
|
||||||
}
|
|
||||||
|
|
||||||
$application = $controller->getCurrentApplication();
|
$application = $controller->getCurrentApplication();
|
||||||
if (!$application) {
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$view = null;
|
$view = null;
|
||||||
|
if ($application) {
|
||||||
$help_items = $application->getHelpMenuItems($viewer);
|
$help_items = $application->getHelpMenuItems($viewer);
|
||||||
if ($help_items) {
|
if ($help_items) {
|
||||||
$view = new PHUIListView();
|
$view = new PHUIListView();
|
||||||
|
@ -96,6 +93,7 @@ final class PhabricatorHelpApplication extends PhabricatorApplication {
|
||||||
$view->addMenuItem($item);
|
$view->addMenuItem($item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return phutil_tag(
|
return phutil_tag(
|
||||||
'div',
|
'div',
|
||||||
|
|
|
@ -72,6 +72,13 @@ final class PhabricatorMainMenuView extends AphrontView {
|
||||||
phutil_implode_html(' ', $aural));
|
phutil_implode_html(' ', $aural));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$applications = PhabricatorApplication::getAllInstalledApplications();
|
||||||
|
foreach ($applications as $application) {
|
||||||
|
$menus[] = $application->buildMainMenuExtraNodes(
|
||||||
|
$user,
|
||||||
|
$this->getController());
|
||||||
|
}
|
||||||
|
|
||||||
$application_menu = $this->renderApplicationMenu();
|
$application_menu = $this->renderApplicationMenu();
|
||||||
$classes = array();
|
$classes = array();
|
||||||
$classes[] = 'phabricator-main-menu';
|
$classes[] = 'phabricator-main-menu';
|
||||||
|
@ -476,13 +483,6 @@ final class PhabricatorMainMenuView extends AphrontView {
|
||||||
$message_notification_dropdown,
|
$message_notification_dropdown,
|
||||||
);
|
);
|
||||||
|
|
||||||
$applications = PhabricatorApplication::getAllInstalledApplications();
|
|
||||||
foreach ($applications as $application) {
|
|
||||||
$dropdowns[] = $application->buildMainMenuExtraNodes(
|
|
||||||
$this->getUser(),
|
|
||||||
$this->getController());
|
|
||||||
}
|
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
array(
|
array(
|
||||||
$bubble_tag,
|
$bubble_tag,
|
||||||
|
|
Loading…
Add table
Reference in a new issue