Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99409419
PhabricatorCommentEditEngineExtension.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
Fri, Jan 24, 07:40
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Jan 26, 07:40 (2 d)
Engine
blob
Format
Raw Data
Handle
23786786
Attached To
rPH Phabricator
PhabricatorCommentEditEngineExtension.php
View Options
<?php
final
class
PhabricatorCommentEditEngineExtension
extends
PhabricatorEditEngineExtension
{
const
EXTENSIONKEY
=
'transactions.comment'
;
const
EDITKEY
=
'comment'
;
public
function
getExtensionPriority
()
{
return
9000
;
}
public
function
isExtensionEnabled
()
{
return
true
;
}
public
function
getExtensionName
()
{
return
pht
(
'Comments'
);
}
public
function
supportsObject
(
PhabricatorEditEngine
$engine
,
PhabricatorApplicationTransactionInterface
$object
)
{
$xaction
=
$object
->
getApplicationTransactionTemplate
();
try
{
$comment
=
$xaction
->
getApplicationTransactionCommentObject
();
}
catch
(
PhutilMethodNotImplementedException
$ex
)
{
$comment
=
null
;
}
return
(
bool
)
$comment
;
}
public
function
buildCustomEditFields
(
PhabricatorEditEngine
$engine
,
PhabricatorApplicationTransactionInterface
$object
)
{
$comment_type
=
PhabricatorTransactions
::
TYPE_COMMENT
;
// Comments have a lot of special behavior which doesn't always check
// this flag, but we set it for consistency.
$is_interact
=
true
;
$comment_field
=
id
(
new
PhabricatorCommentEditField
())
->
setKey
(
self
::
EDITKEY
)
->
setLabel
(
pht
(
'Comments'
))
->
setAliases
(
array
(
'comments'
))
->
setIsHidden
(
true
)
->
setIsReorderable
(
false
)
->
setIsDefaultable
(
false
)
->
setIsLockable
(
false
)
->
setCanApplyWithoutEditCapability
(
$is_interact
)
->
setTransactionType
(
$comment_type
)
->
setConduitDescription
(
pht
(
'Make comments.'
))
->
setConduitTypeDescription
(
pht
(
'Comment to add, formatted as remarkup.'
))
->
setValue
(
null
);
return
array
(
$comment_field
,
);
}
}
Event Timeline
Log In to Comment