1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 03:50:54 +01:00

Notifications - hide header dropdown if app is uninstalled

Summary: Fixes T5019.

Test Plan: uninstalled notifications and dropdown disappeared too

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T5019

Differential Revision: https://secure.phabricator.com/D9121
This commit is contained in:
Bob Trahan 2014-05-14 10:08:07 -07:00
parent 53e95d37cf
commit 67a5dfa662

View file

@ -38,7 +38,9 @@ final class PhabricatorMainMenuView extends AphrontView {
if ($user->isLoggedIn() && $user->isUserActivated()) {
list($menu, $dropdowns, $aural) = $this->renderNotificationMenu();
if (array_filter($menu)) {
$alerts[] = $menu;
}
$menus = array_merge($menus, $dropdowns);
$app_button = $this->renderApplicationMenuButton($header_id);
$search_button = $this->renderSearchMenuButton($header_id);
@ -281,7 +283,9 @@ final class PhabricatorMainMenuView extends AphrontView {
$message_tag = '';
$message_notification_dropdown = '';
$conpherence = 'PhabricatorApplicationConpherence';
if (PhabricatorApplication::isClassInstalled($conpherence)) {
if (PhabricatorApplication::isClassInstalledForViewer(
$conpherence,
$user)) {
$message_id = celerity_generate_unique_node_id();
$message_count_id = celerity_generate_unique_node_id();
$message_dropdown_id = celerity_generate_unique_node_id();
@ -362,6 +366,12 @@ final class PhabricatorMainMenuView extends AphrontView {
'');
}
$bubble_tag = '';
$notification_dropdown = '';
$notification_app = 'PhabricatorApplicationNotifications';
if (PhabricatorApplication::isClassInstalledForViewer(
$notification_app,
$user)) {
$count_id = celerity_generate_unique_node_id();
$dropdown_id = celerity_generate_unique_node_id();
$bubble_id = celerity_generate_unique_node_id();
@ -433,6 +443,7 @@ final class PhabricatorMainMenuView extends AphrontView {
'style' => 'display: none;',
),
'');
}
$dropdowns = array(
$notification_dropdown,