Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92699125
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
Fri, Nov 22, 21:50
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Nov 24, 21:50 (2 d)
Engine
blob
Format
Raw Data
Handle
22489604
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