Changeset View
Changeset View
Standalone View
Standalone View
src/view/page/menu/PhabricatorMainMenuView.php
Show All 17 Lines | public function setController(PhabricatorController $controller) { | ||||
$this->controller = $controller; | $this->controller = $controller; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getController() { | public function getController() { | ||||
return $this->controller; | return $this->controller; | ||||
} | } | ||||
private function getFaviconURI($type = null) { | |||||
switch ($type) { | |||||
case 'message': | |||||
return celerity_get_resource_uri('/rsrc/favicons/favicon-message.ico'); | |||||
case 'mention': | |||||
return celerity_get_resource_uri('/rsrc/favicons/favicon-mention.ico'); | |||||
default: | |||||
return celerity_get_resource_uri('/rsrc/favicons/favicon.ico'); | |||||
} | |||||
} | |||||
public function render() { | public function render() { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
require_celerity_resource('phabricator-main-menu-view'); | require_celerity_resource('phabricator-main-menu-view'); | ||||
$header_id = celerity_generate_unique_node_id(); | $header_id = celerity_generate_unique_node_id(); | ||||
$menu_bar = array(); | $menu_bar = array(); | ||||
$alerts = array(); | $alerts = array(); | ||||
▲ Show 20 Lines • Show All 401 Lines • ▼ Show 20 Lines | if ($conpherence_data['isInstalled']) { | ||||
'bubbleID' => $message_id, | 'bubbleID' => $message_id, | ||||
'countID' => $message_count_id, | 'countID' => $message_count_id, | ||||
'dropdownID' => $message_dropdown_id, | 'dropdownID' => $message_dropdown_id, | ||||
'loadingText' => pht('Loading...'), | 'loadingText' => pht('Loading...'), | ||||
'uri' => '/conpherence/panel/', | 'uri' => '/conpherence/panel/', | ||||
'countType' => $conpherence_data['countType'], | 'countType' => $conpherence_data['countType'], | ||||
'countNumber' => $message_count_number, | 'countNumber' => $message_count_number, | ||||
'unreadClass' => 'message-unread', | 'unreadClass' => 'message-unread', | ||||
'favicon' => $this->getFaviconURI('default'), | |||||
'message_favicon' => $this->getFaviconURI('message'), | |||||
'mention_favicon' => $this->getFaviconURI('mention'), | |||||
)); | )); | ||||
$message_notification_dropdown = javelin_tag( | $message_notification_dropdown = javelin_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'id' => $message_dropdown_id, | 'id' => $message_dropdown_id, | ||||
'class' => 'phabricator-notification-menu', | 'class' => 'phabricator-notification-menu', | ||||
'sigil' => 'phabricator-notification-menu', | 'sigil' => 'phabricator-notification-menu', | ||||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | if ($notification_data['isInstalled']) { | ||||
'bubbleID' => $bubble_id, | 'bubbleID' => $bubble_id, | ||||
'countID' => $count_id, | 'countID' => $count_id, | ||||
'dropdownID' => $dropdown_id, | 'dropdownID' => $dropdown_id, | ||||
'loadingText' => pht('Loading...'), | 'loadingText' => pht('Loading...'), | ||||
'uri' => '/notification/panel/', | 'uri' => '/notification/panel/', | ||||
'countType' => $notification_data['countType'], | 'countType' => $notification_data['countType'], | ||||
'countNumber' => $count_number, | 'countNumber' => $count_number, | ||||
'unreadClass' => 'alert-unread', | 'unreadClass' => 'alert-unread', | ||||
'favicon' => $this->getFaviconURI('default'), | |||||
'message_favicon' => $this->getFaviconURI('message'), | |||||
'mention_favicon' => $this->getFaviconURI('mention'), | |||||
)); | )); | ||||
$notification_dropdown = javelin_tag( | $notification_dropdown = javelin_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'id' => $dropdown_id, | 'id' => $dropdown_id, | ||||
'class' => 'phabricator-notification-menu', | 'class' => 'phabricator-notification-menu', | ||||
'sigil' => 'phabricator-notification-menu', | 'sigil' => 'phabricator-notification-menu', | ||||
▲ Show 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | if ($viewer && $viewer->getIsAdmin()) { | ||||
'bubbleID' => $setup_id, | 'bubbleID' => $setup_id, | ||||
'countID' => $setup_count_id, | 'countID' => $setup_count_id, | ||||
'dropdownID' => $setup_dropdown_id, | 'dropdownID' => $setup_dropdown_id, | ||||
'loadingText' => pht('Loading...'), | 'loadingText' => pht('Loading...'), | ||||
'uri' => '/config/issue/panel/', | 'uri' => '/config/issue/panel/', | ||||
'countType' => null, | 'countType' => null, | ||||
'countNumber' => null, | 'countNumber' => null, | ||||
'unreadClass' => 'setup-unread', | 'unreadClass' => 'setup-unread', | ||||
'favicon' => $this->getFaviconURI('default'), | |||||
'message_favicon' => $this->getFaviconURI('message'), | |||||
'mention_favicon' => $this->getFaviconURI('mention'), | |||||
)); | )); | ||||
$setup_notification_dropdown = javelin_tag( | $setup_notification_dropdown = javelin_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'id' => $setup_dropdown_id, | 'id' => $setup_dropdown_id, | ||||
'class' => 'phabricator-notification-menu', | 'class' => 'phabricator-notification-menu', | ||||
'sigil' => 'phabricator-notification-menu', | 'sigil' => 'phabricator-notification-menu', | ||||
Show All 24 Lines |