Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99654959
PhabricatorStandardCustomFieldLink.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
Sun, Jan 26, 00:28
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Jan 28, 00:28 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23839437
Attached To
rPH Phabricator
PhabricatorStandardCustomFieldLink.php
View Options
<?php
final
class
PhabricatorStandardCustomFieldLink
extends
PhabricatorStandardCustomField
{
public
function
getFieldType
()
{
return
'link'
;
}
public
function
buildFieldIndexes
()
{
$indexes
=
array
();
$value
=
$this
->
getFieldValue
();
if
(
strlen
(
$value
))
{
$indexes
[]
=
$this
->
newStringIndex
(
$value
);
}
return
$indexes
;
}
public
function
renderPropertyViewValue
(
array
$handles
)
{
$value
=
$this
->
getFieldValue
();
if
(!
strlen
(
$value
))
{
return
null
;
}
if
(!
PhabricatorEnv
::
isValidRemoteURIForLink
(
$value
))
{
return
$value
;
}
return
phutil_tag
(
'a'
,
array
(
'href'
=>
$value
,
'target'
=>
'_blank'
),
$value
);
}
public
function
readApplicationSearchValueFromRequest
(
PhabricatorApplicationSearchEngine
$engine
,
AphrontRequest
$request
)
{
return
$request
->
getStr
(
$this
->
getFieldKey
());
}
public
function
applyApplicationSearchConstraintToQuery
(
PhabricatorApplicationSearchEngine
$engine
,
PhabricatorCursorPagedPolicyAwareQuery
$query
,
$value
)
{
if
(
strlen
(
$value
))
{
$query
->
withApplicationSearchContainsConstraint
(
$this
->
newStringIndex
(
null
),
$value
);
}
}
public
function
appendToApplicationSearchForm
(
PhabricatorApplicationSearchEngine
$engine
,
AphrontFormView
$form
,
$value
)
{
$form
->
appendChild
(
id
(
new
AphrontFormTextControl
())
->
setLabel
(
$this
->
getFieldName
())
->
setName
(
$this
->
getFieldKey
())
->
setValue
(
$value
));
}
public
function
shouldAppearInHerald
()
{
return
true
;
}
public
function
getHeraldFieldConditions
()
{
return
array
(
HeraldAdapter
::
CONDITION_CONTAINS
,
HeraldAdapter
::
CONDITION_NOT_CONTAINS
,
HeraldAdapter
::
CONDITION_IS
,
HeraldAdapter
::
CONDITION_IS_NOT
,
HeraldAdapter
::
CONDITION_REGEXP
,
);
}
protected
function
getHTTPParameterType
()
{
return
new
AphrontStringHTTPParameterType
();
}
}
Event Timeline
Log In to Comment