Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96154824
PhabricatorStandardCustomFieldRemarkup.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, Dec 23, 06:11
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Dec 25, 06:11 (1 d, 19 h)
Engine
blob
Format
Raw Data
Handle
23135574
Attached To
rPH Phabricator
PhabricatorStandardCustomFieldRemarkup.php
View Options
<?php
final
class
PhabricatorStandardCustomFieldRemarkup
extends
PhabricatorStandardCustomField
{
public
function
getFieldType
()
{
return
'remarkup'
;
}
public
function
renderEditControl
(
array
$handles
)
{
return
id
(
new
PhabricatorRemarkupControl
())
->
setLabel
(
$this
->
getFieldName
())
->
setName
(
$this
->
getFieldKey
())
->
setCaption
(
$this
->
getCaption
())
->
setValue
(
$this
->
getFieldValue
());
}
public
function
getStyleForPropertyView
()
{
return
'block'
;
}
public
function
renderPropertyViewValue
(
array
$handles
)
{
$value
=
$this
->
getFieldValue
();
if
(!
strlen
(
$value
))
{
return
null
;
}
// TODO: Once this stabilizes, it would be nice to let fields batch this.
// For now, an extra query here and there on object detail pages isn't the
// end of the world.
$viewer
=
$this
->
getViewer
();
return
PhabricatorMarkupEngine
::
renderOneObject
(
id
(
new
PhabricatorMarkupOneOff
())->
setContent
(
$value
),
'default'
,
$viewer
);
}
public
function
getApplicationTransactionTitle
(
PhabricatorApplicationTransaction
$xaction
)
{
$author_phid
=
$xaction
->
getAuthorPHID
();
// TODO: Expose fancy transactions.
return
pht
(
'%s edited %s.'
,
$xaction
->
renderHandleLink
(
$author_phid
),
$this
->
getFieldName
());
}
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
,
);
}
}
Event Timeline
Log In to Comment