Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93592209
PhabricatorSubscriptionsEditEngineExtension.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
Sat, Nov 30, 00:19
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Dec 2, 00:19 (2 d)
Engine
blob
Format
Raw Data
Handle
22669311
Attached To
rPH Phabricator
PhabricatorSubscriptionsEditEngineExtension.php
View Options
<?php
final
class
PhabricatorSubscriptionsEditEngineExtension
extends
PhabricatorEditEngineExtension
{
const
EXTENSIONKEY
=
'subscriptions.subscribers'
;
public
function
getExtensionPriority
()
{
return
750
;
}
public
function
isExtensionEnabled
()
{
return
true
;
}
public
function
getExtensionName
()
{
return
pht
(
'Subscriptions'
);
}
public
function
supportsObject
(
PhabricatorEditEngine
$engine
,
PhabricatorApplicationTransactionInterface
$object
)
{
return
(
$object
instanceof
PhabricatorSubscribableInterface
);
}
public
function
buildCustomEditFields
(
PhabricatorEditEngine
$engine
,
PhabricatorApplicationTransactionInterface
$object
)
{
$subscribers_type
=
PhabricatorTransactions
::
TYPE_SUBSCRIBERS
;
$object_phid
=
$object
->
getPHID
();
if
(
$object_phid
)
{
$sub_phids
=
PhabricatorSubscribersQuery
::
loadSubscribersForPHID
(
$object_phid
);
}
else
{
// TODO: Allow applications to provide default subscribers? Maniphest
// does this at a minimum.
$sub_phids
=
array
();
}
$subscribers_field
=
id
(
new
PhabricatorSubscribersEditField
())
->
setKey
(
'subscriberPHIDs'
)
->
setLabel
(
pht
(
'Subscribers'
))
->
setEditTypeKey
(
'subscribers'
)
->
setDescription
(
pht
(
'Manage subscribers.'
))
->
setAliases
(
array
(
'subscriber'
,
'subscribers'
))
->
setIsCopyable
(
true
)
->
setUseEdgeTransactions
(
true
)
->
setEdgeTransactionDescriptions
(
pht
(
'Add subscribers.'
),
pht
(
'Remove subscribers.'
),
pht
(
'Set subscribers, overwriting current value.'
))
->
setCommentActionLabel
(
pht
(
'Add Subscribers'
))
->
setTransactionType
(
$subscribers_type
)
->
setValue
(
$sub_phids
);
return
array
(
$subscribers_field
,
);
}
}
Event Timeline
Log In to Comment