Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F106877859
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
Tue, Apr 1, 23:09
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Apr 3, 23:09 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
25295253
Attached To
rPH Phabricator
PhabricatorMainMenuSearchView.php
View Options
<?php
final
class
PhabricatorMainMenuSearchView
extends
AphrontView
{
private
$id
;
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
();
$button_id
=
celerity_generate_unique_node_id
();
$input
=
phutil_tag
(
'input'
,
array
(
'type'
=>
'text'
,
'name'
=>
'query'
,
'id'
=>
$search_id
,
'autocomplete'
=>
'off'
,
));
$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
,
'button'
=>
$button_id
,
'src'
=>
'/typeahead/common/mainsearch/'
,
'limit'
=>
10
,
'placeholder'
=>
pht
(
'Search'
),
));
$primary_input
=
phutil_tag
(
'input'
,
array
(
'type'
=>
'hidden'
,
'name'
=>
'search:primary'
,
'value'
=>
'true'
,
));
$form
=
phabricator_form
(
$user
,
array
(
'action'
=>
'/search/'
,
'method'
=>
'POST'
,
),
phutil_tag_div
(
'phabricator-main-menu-search-container'
,
array
(
$input
,
phutil_tag
(
'button'
,
array
(
'id'
=>
$button_id
),
pht
(
'Search'
)),
$primary_input
,
$target
,
)));
return
$form
;
}
}
Event Timeline
Log In to Comment