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) { | private static function getFavicons() { | ||||
| switch ($type) { | $refs = array(); | ||||
| case 'message': | |||||
| return celerity_get_resource_uri('/rsrc/favicons/favicon-message.ico'); | $refs['favicon'] = id(new PhabricatorFaviconRef()) | ||||
| case 'mention': | ->setWidth(64) | ||||
| return celerity_get_resource_uri('/rsrc/favicons/favicon-mention.ico'); | ->setHeight(64); | ||||
| default: | |||||
| return celerity_get_resource_uri('/rsrc/favicons/favicon.ico'); | $refs['message_favicon'] = id(new PhabricatorFaviconRef()) | ||||
| } | ->setWidth(64) | ||||
| ->setHeight(64) | |||||
| ->setEmblems( | |||||
| array( | |||||
| 'dot-pink', | |||||
| null, | |||||
| null, | |||||
| null, | |||||
| )); | |||||
| id(new PhabricatorFaviconRefQuery()) | |||||
| ->withRefs($refs) | |||||
| ->execute(); | |||||
| return mpull($refs, 'getURI'); | |||||
| } | } | ||||
| 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(); | ||||
| ▲ Show 20 Lines • Show All 380 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'), | ) + self::getFavicons()); | ||||
| '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', | ||||
| 'style' => 'display: none;', | 'style' => 'display: none;', | ||||
| ▲ Show 20 Lines • Show All 61 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'), | ) + self::getFavicons()); | ||||
| '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', | ||||
| 'style' => 'display: none;', | 'style' => 'display: none;', | ||||
| ▲ Show 20 Lines • Show All 65 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'), | ) + self::getFavicons()); | ||||
| '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', | ||||
| 'style' => 'display: none;', | 'style' => 'display: none;', | ||||
| ▲ Show 20 Lines • Show All 122 Lines • Show Last 20 Lines | |||||