Changeset View
Changeset View
Standalone View
Standalone View
src/view/page/menu/PhabricatorMainMenuView.php
| Show First 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | if ($user->isLoggedIn()) { | ||||
| $show_search = $user->isUserActivated(); | $show_search = $user->isUserActivated(); | ||||
| } else { | } else { | ||||
| $show_search = PhabricatorEnv::getEnvConfig('policy.allow-public'); | $show_search = PhabricatorEnv::getEnvConfig('policy.allow-public'); | ||||
| } | } | ||||
| if ($show_search) { | if ($show_search) { | ||||
| $search = new PhabricatorMainMenuSearchView(); | $search = new PhabricatorMainMenuSearchView(); | ||||
| $search->setUser($user); | $search->setUser($user); | ||||
| $application = null; | |||||
| $controller = $this->getController(); | |||||
| if ($controller) { | |||||
| $application = $controller->getCurrentApplication(); | |||||
| } | |||||
| if ($application) { | |||||
| $search->setApplication($application); | |||||
| } | |||||
| $result = $search; | $result = $search; | ||||
| $pref_shortcut = PhabricatorUserPreferences::PREFERENCE_SEARCH_SHORTCUT; | $pref_shortcut = PhabricatorUserPreferences::PREFERENCE_SEARCH_SHORTCUT; | ||||
| if ($user->loadPreferences()->getPreference($pref_shortcut, true)) { | if ($user->loadPreferences()->getPreference($pref_shortcut, true)) { | ||||
| $keyboard_config['searchID'] = $search->getID(); | $keyboard_config['searchID'] = $search->getID(); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 362 Lines • Show Last 20 Lines | |||||