Changeset View
Changeset View
Standalone View
Standalone View
src/view/page/menu/PhabricatorMainMenuView.php
Show First 20 Lines • Show All 589 Lines • ▼ Show 20 Lines | if ($viewer && $viewer->getIsAdmin()) { | ||||
'class' => 'phabricator-notification-menu', | 'class' => 'phabricator-notification-menu', | ||||
'sigil' => 'phabricator-notification-menu', | 'sigil' => 'phabricator-notification-menu', | ||||
'style' => 'display: none;', | 'style' => 'display: none;', | ||||
), | ), | ||||
''); | ''); | ||||
} | } | ||||
} | } | ||||
$user_dropdown = null; | |||||
$user_tag = null; | |||||
if ($viewer->isLoggedIn()) { | |||||
if (!$viewer->getIsEmailVerified()) { | |||||
$bubble_id = celerity_generate_unique_node_id(); | |||||
$count_id = celerity_generate_unique_node_id(); | |||||
$dropdown_id = celerity_generate_unique_node_id(); | |||||
$settings_uri = id(new PhabricatorEmailAddressesSettingsPanel()) | |||||
->setViewer($viewer) | |||||
->setUser($viewer) | |||||
->getPanelURI(); | |||||
$user_icon = javelin_tag( | |||||
'span', | |||||
array( | |||||
'class' => 'phabricator-main-menu-setup-icon phui-icon-view '. | |||||
'phui-font-fa fa-user', | |||||
'sigil' => 'menu-icon', | |||||
)); | |||||
$user_count = javelin_tag( | |||||
'span', | |||||
array( | |||||
'class' => 'phabricator-main-menu-setup-count', | |||||
'id' => $count_id, | |||||
), | |||||
1); | |||||
$user_tag = phutil_tag( | |||||
'a', | |||||
array( | |||||
'href' => $settings_uri, | |||||
'class' => 'setup-unread', | |||||
'id' => $bubble_id, | |||||
), | |||||
array( | |||||
$user_icon, | |||||
$user_count, | |||||
)); | |||||
Javelin::initBehavior( | |||||
'aphlict-dropdown', | |||||
array( | |||||
'bubbleID' => $bubble_id, | |||||
'countID' => $count_id, | |||||
'dropdownID' => $dropdown_id, | |||||
'loadingText' => pht('Loading...'), | |||||
'uri' => '/settings/issue/', | |||||
'unreadClass' => 'setup-unread', | |||||
)); | |||||
$user_dropdown = javelin_tag( | |||||
'div', | |||||
array( | |||||
'id' => $dropdown_id, | |||||
'class' => 'phabricator-notification-menu', | |||||
'sigil' => 'phabricator-notification-menu', | |||||
'style' => 'display: none;', | |||||
)); | |||||
} | |||||
} | |||||
$dropdowns = array( | $dropdowns = array( | ||||
$notification_dropdown, | $notification_dropdown, | ||||
$message_notification_dropdown, | $message_notification_dropdown, | ||||
$setup_notification_dropdown, | $setup_notification_dropdown, | ||||
$user_dropdown, | |||||
); | ); | ||||
return array( | return array( | ||||
array( | array( | ||||
$bubble_tag, | $bubble_tag, | ||||
$message_tag, | $message_tag, | ||||
$setup_tag, | $setup_tag, | ||||
$user_tag, | |||||
), | ), | ||||
$dropdowns, | $dropdowns, | ||||
$aural, | $aural, | ||||
); | ); | ||||
} | } | ||||
} | } |