Changeset View
Changeset View
Standalone View
Standalone View
src/view/page/menu/PhabricatorMainMenuSearchView.php
| Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | $target = javelin_tag( | ||||
| 'div', | 'div', | ||||
| array( | array( | ||||
| 'id' => $target_id, | 'id' => $target_id, | ||||
| 'class' => 'phabricator-main-menu-search-target', | 'class' => 'phabricator-main-menu-search-target', | ||||
| ), | ), | ||||
| ''); | ''); | ||||
| $search_datasource = new PhabricatorSearchDatasource(); | $search_datasource = new PhabricatorSearchDatasource(); | ||||
| $scope_key = PhabricatorUserPreferences::PREFERENCE_SEARCH_SCOPE; | $scope_key = PhabricatorSearchScopeSetting::SETTINGKEY; | ||||
| Javelin::initBehavior( | Javelin::initBehavior( | ||||
| 'phabricator-search-typeahead', | 'phabricator-search-typeahead', | ||||
| array( | array( | ||||
| 'id' => $target_id, | 'id' => $target_id, | ||||
| 'input' => $search_id, | 'input' => $search_id, | ||||
| 'button' => $button_id, | 'button' => $button_id, | ||||
| 'selectorID' => $selector_id, | 'selectorID' => $selector_id, | ||||
| ▲ Show 20 Lines • Show All 110 Lines • ▼ Show 20 Lines | private function buildModeSelector($selector_id, $application_id) { | ||||
| ); | ); | ||||
| $items[] = array( | $items[] = array( | ||||
| 'icon' => 'fa-book', | 'icon' => 'fa-book', | ||||
| 'name' => pht('User Guide: Search'), | 'name' => pht('User Guide: Search'), | ||||
| 'href' => PhabricatorEnv::getDoclink('Search User Guide'), | 'href' => PhabricatorEnv::getDoclink('Search User Guide'), | ||||
| ); | ); | ||||
| $scope_key = PhabricatorUserPreferences::PREFERENCE_SEARCH_SCOPE; | $scope_key = PhabricatorSearchScopeSetting::SETTINGKEY; | ||||
| $current_value = $viewer->loadPreferences()->getPreference( | $current_value = $viewer->getUserSetting($scope_key); | ||||
| $scope_key, | |||||
| 'all'); | |||||
| $current_icon = 'fa-globe'; | $current_icon = 'fa-globe'; | ||||
| foreach ($items as $item) { | foreach ($items as $item) { | ||||
| if (idx($item, 'value') == $current_value) { | if (idx($item, 'value') == $current_value) { | ||||
| $current_icon = $item['icon']; | $current_icon = $item['icon']; | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| Show All 40 Lines | |||||