user = $user; return $this; } public function setScope($scope) { $this->scope = $scope; return $this; } public function getID() { if (!$this->id) { $this->id = celerity_generate_unique_node_id(); } return $this->id; } public function render() { $user = $this->user; $search_id = $this->getID(); $input = phutil_render_tag( 'input', array( 'type' => 'text', 'name' => 'query', 'id' => $search_id, )); $scope = $this->scope; Javelin::initBehavior( 'placeholder', array( 'id' => $search_id, 'text' => PhabricatorSearchScope::getScopePlaceholder($scope), )); $scope_input = phutil_render_tag( 'input', array( 'type' => 'hidden', 'name' => 'scope', 'value' => $scope, )); $form = phabricator_render_form( $user, array( 'action' => '/search/', 'method' => 'POST', ), '
'. $input. ''. $scope_input. '
'); $group = new PhabricatorMainMenuGroupView(); $group->addClass('phabricator-main-menu-search'); $group->appendChild($form); return $group->render(); } }