Changeset View
Changeset View
Standalone View
Standalone View
src/view/page/menu/PhabricatorMainMenuSearchView.php
| Show First 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | $form = phabricator_form( | ||||
| phutil_tag_div('phabricator-main-menu-search-container', array( | phutil_tag_div('phabricator-main-menu-search-container', array( | ||||
| $input, | $input, | ||||
| phutil_tag( | phutil_tag( | ||||
| 'button', | 'button', | ||||
| array( | array( | ||||
| 'id' => $button_id, | 'id' => $button_id, | ||||
| 'class' => 'phui-icon-view phui-font-fa fa-search', | 'class' => 'phui-icon-view phui-font-fa fa-search', | ||||
| ), | ), | ||||
| $search_text), | array( | ||||
| $selector, | $selector, | ||||
| $search_text, | |||||
| )), | |||||
| $primary_input, | $primary_input, | ||||
| $target, | $target, | ||||
| ))); | ))); | ||||
| return $form; | return $form; | ||||
| } | } | ||||
| private function buildModeSelector($selector_id, $application_id) { | private function buildModeSelector($selector_id, $application_id) { | ||||
| $viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
| $items = array(); | $items = array(); | ||||
| $items[] = array( | $items[] = array( | ||||
| 'name' => pht('Search'), | 'name' => pht('Search'), | ||||
| ); | ); | ||||
| $items[] = array( | $items[] = array( | ||||
| 'icon' => 'fa-globe', | 'icon' => 'fa-globe', | ||||
| 'name' => pht('Search All Documents'), | 'name' => pht('All Documents'), | ||||
| 'value' => 'all', | 'value' => 'all', | ||||
| ); | ); | ||||
| $application_value = null; | $application_value = null; | ||||
| $application_icon = self::DEFAULT_APPLICATION_ICON; | $application_icon = self::DEFAULT_APPLICATION_ICON; | ||||
| $application = $this->getApplication(); | $application = $this->getApplication(); | ||||
| if ($application) { | if ($application) { | ||||
| $application_value = get_class($application); | $application_value = get_class($application); | ||||
| if ($application->getApplicationSearchDocumentTypes()) { | if ($application->getApplicationSearchDocumentTypes()) { | ||||
| $application_icon = $application->getIcon(); | $application_icon = $application->getIcon(); | ||||
| } | } | ||||
| } | } | ||||
| $items[] = array( | $items[] = array( | ||||
| 'icon' => $application_icon, | 'icon' => $application_icon, | ||||
| 'name' => pht('Search Current Application'), | 'name' => pht('Current Application'), | ||||
| 'value' => PhabricatorSearchController::SCOPE_CURRENT_APPLICATION, | 'value' => PhabricatorSearchController::SCOPE_CURRENT_APPLICATION, | ||||
| ); | ); | ||||
| $items[] = array( | $items[] = array( | ||||
| 'name' => pht('Saved Queries'), | 'name' => pht('Saved Queries'), | ||||
| ); | ); | ||||
| ▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines | |||||