Changeset View
Changeset View
Standalone View
Standalone View
src/view/page/menu/PhabricatorMainMenuView.php
| Show All 21 Lines | final class PhabricatorMainMenuView extends AphrontView { | ||||
| public function getController() { | public function getController() { | ||||
| return $this->controller; | return $this->controller; | ||||
| } | } | ||||
| public function render() { | public function render() { | ||||
| $user = $this->user; | $user = $this->user; | ||||
| require_celerity_resource('phabricator-main-menu-view'); | require_celerity_resource('phabricator-main-menu-view'); | ||||
| require_celerity_resource('sprite-main-header-css'); | |||||
| $header_id = celerity_generate_unique_node_id(); | $header_id = celerity_generate_unique_node_id(); | ||||
| $menus = array(); | $menus = array(); | ||||
| $alerts = array(); | $alerts = array(); | ||||
| $search_button = ''; | $search_button = ''; | ||||
| $app_button = ''; | $app_button = ''; | ||||
| $aural = null; | $aural = null; | ||||
| Show All 37 Lines | public function render() { | ||||
| foreach ($applications as $application) { | foreach ($applications as $application) { | ||||
| $menus[] = $application->buildMainMenuExtraNodes( | $menus[] = $application->buildMainMenuExtraNodes( | ||||
| $user, | $user, | ||||
| $this->getController()); | $this->getController()); | ||||
| } | } | ||||
| $application_menu = $this->renderApplicationMenu(); | $application_menu = $this->renderApplicationMenu(); | ||||
| $classes = array(); | $classes = array(); | ||||
| $classes[] = 'phabricator-main-menu'; | $classes[] = 'phabricator-main-menu sprite-main-header'; | ||||
| $classes[] = 'phabricator-main-menu-background'; | $classes[] = 'phabricator-main-menu-background'; | ||||
| return phutil_tag( | return phutil_tag( | ||||
| 'div', | 'div', | ||||
| array( | array( | ||||
| 'class' => implode(' ', $classes), | 'class' => implode(' ', $classes), | ||||
| 'id' => $header_id, | 'id' => $header_id, | ||||
| ), | ), | ||||
| ▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | return javelin_tag( | ||||
| 'a', | 'a', | ||||
| array( | array( | ||||
| 'class' => 'phabricator-main-menu-expand-button '. | 'class' => 'phabricator-main-menu-expand-button '. | ||||
| 'phabricator-expand-search-menu', | 'phabricator-expand-search-menu', | ||||
| 'sigil' => 'jx-toggle-class', | 'sigil' => 'jx-toggle-class', | ||||
| 'meta' => array( | 'meta' => array( | ||||
| 'map' => array( | 'map' => array( | ||||
| $header_id => 'phabricator-application-menu-expanded', | $header_id => 'phabricator-application-menu-expanded', | ||||
| $button_id => 'sky', | $button_id => 'menu-icon-selected', | ||||
| ), | ), | ||||
| ), | ), | ||||
| ), | ), | ||||
| phutil_tag( | phutil_tag( | ||||
| 'span', | 'span', | ||||
| array( | array( | ||||
| 'class' => 'phabricator-menu-button-icon phui-icon-view '. | 'class' => 'phabricator-menu-button-icon phui-icon-view '. | ||||
| 'phui-font-fa fa-bars', | 'phui-font-fa fa-bars', | ||||
| ▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | return javelin_tag( | ||||
| 'a', | 'a', | ||||
| array( | array( | ||||
| 'class' => 'phabricator-main-menu-search-button '. | 'class' => 'phabricator-main-menu-search-button '. | ||||
| 'phabricator-expand-application-menu', | 'phabricator-expand-application-menu', | ||||
| 'sigil' => 'jx-toggle-class', | 'sigil' => 'jx-toggle-class', | ||||
| 'meta' => array( | 'meta' => array( | ||||
| 'map' => array( | 'map' => array( | ||||
| $header_id => 'phabricator-search-menu-expanded', | $header_id => 'phabricator-search-menu-expanded', | ||||
| $button_id => 'sky', | $button_id => 'menu-icon-selected', | ||||
| ), | ), | ||||
| ), | ), | ||||
| ), | ), | ||||
| phutil_tag( | phutil_tag( | ||||
| 'span', | 'span', | ||||
| array( | array( | ||||
| 'class' => 'phabricator-menu-button-icon phui-icon-view '. | 'class' => 'phabricator-menu-button-icon phui-icon-view '. | ||||
| 'phui-font-fa fa-search', | 'phui-font-fa fa-search', | ||||
| Show All 34 Lines | if ($custom_header) { | ||||
| } | } | ||||
| } | } | ||||
| if ($logo_uri) { | if ($logo_uri) { | ||||
| $style_logo = | $style_logo = | ||||
| 'background-size: 96px 40px; '. | 'background-size: 96px 40px; '. | ||||
| 'background-position: 0px 0px; '. | 'background-position: 0px 0px; '. | ||||
| 'background-image: url('.$logo_uri.');'; | 'background-image: url('.$logo_uri.');'; | ||||
| } | } | ||||
| } | } else { | ||||
| $color = PhabricatorEnv::getEnvConfig('ui.header-color'); | $color = PhabricatorEnv::getEnvConfig('ui.header-color'); | ||||
| if ($color == 'light') { | |||||
| $color = 'dark'; | |||||
| } else { | |||||
| $color = 'light'; | |||||
| } | |||||
| } | |||||
| return phutil_tag( | return phutil_tag( | ||||
| 'a', | 'a', | ||||
| array( | array( | ||||
| 'class' => 'phabricator-main-menu-brand', | 'class' => 'phabricator-main-menu-brand', | ||||
| 'href' => '/', | 'href' => '/', | ||||
| ), | ), | ||||
| array( | array( | ||||
| ▲ Show 20 Lines • Show All 210 Lines • Show Last 20 Lines | |||||