Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F104550117
PhabricatorMainMenuSearchView.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Mar 10, 09:29
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Mar 12, 09:29 (2 d)
Engine
blob
Format
Raw Data
Handle
24810305
Attached To
rPH Phabricator
PhabricatorMainMenuSearchView.php
View Options
<?php
final
class
PhabricatorMainMenuSearchView
extends
AphrontView
{
private
$scope
;
private
$id
;
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
;
$target_id
=
celerity_generate_unique_node_id
();
$search_id
=
$this
->
getID
();
$input
=
phutil_tag
(
'input'
,
array
(
'type'
=>
'text'
,
'name'
=>
'query'
,
'id'
=>
$search_id
,
'autocomplete'
=>
'off'
,
));
$scope
=
$this
->
scope
;
$target
=
javelin_tag
(
'div'
,
array
(
'id'
=>
$target_id
,
'class'
=>
'phabricator-main-menu-search-target'
,
),
''
);
Javelin
::
initBehavior
(
'phabricator-search-typeahead'
,
array
(
'id'
=>
$target_id
,
'input'
=>
$search_id
,
'src'
=>
'/typeahead/common/mainsearch/'
,
'limit'
=>
10
,
'placeholder'
=>
PhabricatorSearchScope
::
getScopePlaceholder
(
$scope
),
));
$scope_input
=
phutil_tag
(
'input'
,
array
(
'type'
=>
'hidden'
,
'name'
=>
'scope'
,
'value'
=>
$scope
,
));
$form
=
phabricator_form
(
$user
,
array
(
'action'
=>
'/search/'
,
'method'
=>
'POST'
,
),
hsprintf
(
'<div class="phabricator-main-menu-search-container">'
.
'%s<button>Search</button>%s%s'
.
'</div>'
,
$input
,
$scope_input
,
$target
));
return
$form
;
}
}
Event Timeline
Log In to Comment