Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F117010332
HeraldRuleEditor.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
Tue, Jun 10, 20:53
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Jun 12, 20:53 (2 d)
Engine
blob
Format
Raw Data
Handle
26704249
Attached To
rPH Phabricator
HeraldRuleEditor.php
View Options
<?php
final
class
HeraldRuleEditor
extends
PhabricatorApplicationTransactionEditor
{
public
function
getEditorApplicationClass
()
{
return
'PhabricatorHeraldApplication'
;
}
public
function
getEditorObjectsDescription
()
{
return
pht
(
'Herald Rules'
);
}
protected
function
shouldApplyHeraldRules
(
PhabricatorLiskDAO
$object
,
array
$xactions
)
{
return
true
;
}
protected
function
buildHeraldAdapter
(
PhabricatorLiskDAO
$object
,
array
$xactions
)
{
return
id
(
new
HeraldRuleAdapter
())
->
setRule
(
$object
);
}
protected
function
shouldSendMail
(
PhabricatorLiskDAO
$object
,
array
$xactions
)
{
return
true
;
}
protected
function
getMailTo
(
PhabricatorLiskDAO
$object
)
{
$phids
=
array
();
$phids
[]
=
$this
->
getActingAsPHID
();
if
(
$object
->
isPersonalRule
())
{
$phids
[]
=
$object
->
getAuthorPHID
();
}
return
$phids
;
}
protected
function
buildReplyHandler
(
PhabricatorLiskDAO
$object
)
{
return
id
(
new
HeraldRuleReplyHandler
())
->
setMailReceiver
(
$object
);
}
protected
function
buildMailTemplate
(
PhabricatorLiskDAO
$object
)
{
$monogram
=
$object
->
getMonogram
();
$name
=
$object
->
getName
();
$subject
=
pht
(
'%s: %s'
,
$monogram
,
$name
);
return
id
(
new
PhabricatorMetaMTAMail
())
->
setSubject
(
$subject
);
}
protected
function
getMailSubjectPrefix
()
{
return
pht
(
'[Herald]'
);
}
protected
function
buildMailBody
(
PhabricatorLiskDAO
$object
,
array
$xactions
)
{
$body
=
parent
::
buildMailBody
(
$object
,
$xactions
);
$body
->
addLinkSection
(
pht
(
'RULE DETAIL'
),
PhabricatorEnv
::
getProductionURI
(
$object
->
getURI
()));
return
$body
;
}
protected
function
supportsSearch
()
{
return
true
;
}
}
Event Timeline
Log In to Comment