1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 05:20:56 +01: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:
epriestley 2015-04-27 08:15:51 -07:00
parent 52b9e5ec14
commit ae192e5328
2 changed files with 17 additions and 19 deletions

View file

@ -79,21 +79,19 @@ final class PhabricatorHelpApplication extends PhabricatorApplication {
PhabricatorUser $viewer,
PhabricatorController $controller = null) {
if (!$controller) {
return null;
}
$application = $controller->getCurrentApplication();
if (!$application) {
return null;
$application = null;
if ($controller) {
$application = $controller->getCurrentApplication();
}
$view = null;
$help_items = $application->getHelpMenuItems($viewer);
if ($help_items) {
$view = new PHUIListView();
foreach ($help_items as $item) {
$view->addMenuItem($item);
if ($application) {
$help_items = $application->getHelpMenuItems($viewer);
if ($help_items) {
$view = new PHUIListView();
foreach ($help_items as $item) {
$view->addMenuItem($item);
}
}
}

View file

@ -72,6 +72,13 @@ final class PhabricatorMainMenuView extends AphrontView {
phutil_implode_html(' ', $aural));
}
$applications = PhabricatorApplication::getAllInstalledApplications();
foreach ($applications as $application) {
$menus[] = $application->buildMainMenuExtraNodes(
$user,
$this->getController());
}
$application_menu = $this->renderApplicationMenu();
$classes = array();
$classes[] = 'phabricator-main-menu';
@ -476,13 +483,6 @@ final class PhabricatorMainMenuView extends AphrontView {
$message_notification_dropdown,
);
$applications = PhabricatorApplication::getAllInstalledApplications();
foreach ($applications as $application) {
$dropdowns[] = $application->buildMainMenuExtraNodes(
$this->getUser(),
$this->getController());
}
return array(
array(
$bubble_tag,