Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101278372
PhabricatorPasteEditor.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, Feb 7, 10:32
Size
2 KB
Mime Type
text/x-php
Expires
Sun, Feb 9, 10:32 (2 d)
Engine
blob
Format
Raw Data
Handle
24129176
Attached To
rPH Phabricator
PhabricatorPasteEditor.php
View Options
<?php
final
class
PhabricatorPasteEditor
extends
PhabricatorApplicationTransactionEditor
{
public
function
getEditorApplicationClass
()
{
return
'PhabricatorPasteApplication'
;
}
public
function
getEditorObjectsDescription
()
{
return
pht
(
'Pastes'
);
}
public
function
getCreateObjectTitle
(
$author
,
$object
)
{
return
pht
(
'%s created this paste.'
,
$author
);
}
public
function
getCreateObjectTitleForFeed
(
$author
,
$object
)
{
return
pht
(
'%s created %s.'
,
$author
,
$object
);
}
public
function
getTransactionTypes
()
{
$types
=
parent
::
getTransactionTypes
();
$types
[]
=
PhabricatorTransactions
::
TYPE_VIEW_POLICY
;
$types
[]
=
PhabricatorTransactions
::
TYPE_EDIT_POLICY
;
$types
[]
=
PhabricatorTransactions
::
TYPE_COMMENT
;
return
$types
;
}
protected
function
shouldSendMail
(
PhabricatorLiskDAO
$object
,
array
$xactions
)
{
if
(
$this
->
getIsNewObject
())
{
return
false
;
}
return
true
;
}
protected
function
getMailSubjectPrefix
()
{
return
PhabricatorEnv
::
getEnvConfig
(
'metamta.paste.subject-prefix'
);
}
protected
function
getMailTo
(
PhabricatorLiskDAO
$object
)
{
return
array
(
$object
->
getAuthorPHID
(),
$this
->
getActingAsPHID
(),
);
}
public
function
getMailTagsMap
()
{
return
array
(
PhabricatorPasteTransaction
::
MAILTAG_CONTENT
=>
pht
(
'Paste title, language or text changes.'
),
PhabricatorPasteTransaction
::
MAILTAG_COMMENT
=>
pht
(
'Someone comments on a paste.'
),
PhabricatorPasteTransaction
::
MAILTAG_OTHER
=>
pht
(
'Other paste activity not listed above occurs.'
),
);
}
protected
function
buildReplyHandler
(
PhabricatorLiskDAO
$object
)
{
return
id
(
new
PasteReplyHandler
())
->
setMailReceiver
(
$object
);
}
protected
function
buildMailTemplate
(
PhabricatorLiskDAO
$object
)
{
$id
=
$object
->
getID
();
$name
=
$object
->
getTitle
();
return
id
(
new
PhabricatorMetaMTAMail
())
->
setSubject
(
"P{$id}: {$name}"
);
}
protected
function
buildMailBody
(
PhabricatorLiskDAO
$object
,
array
$xactions
)
{
$body
=
parent
::
buildMailBody
(
$object
,
$xactions
);
$body
->
addLinkSection
(
pht
(
'PASTE DETAIL'
),
PhabricatorEnv
::
getProductionURI
(
'/P'
.
$object
->
getID
()));
return
$body
;
}
protected
function
shouldPublishFeedStory
(
PhabricatorLiskDAO
$object
,
array
$xactions
)
{
return
true
;
}
}
Event Timeline
Log In to Comment