Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92731492
PhameBlogEditor.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 23, 05:47
Size
2 KB
Mime Type
text/x-php
Expires
Mon, Nov 25, 05:47 (2 d)
Engine
blob
Format
Raw Data
Handle
22490049
Attached To
rPH Phabricator
PhameBlogEditor.php
View Options
<?php
final
class
PhameBlogEditor
extends
PhabricatorApplicationTransactionEditor
{
public
function
getEditorApplicationClass
()
{
return
'PhabricatorPhameApplication'
;
}
public
function
getEditorObjectsDescription
()
{
return
pht
(
'Phame Blogs'
);
}
public
function
getCreateObjectTitle
(
$author
,
$object
)
{
return
pht
(
'%s created this blog.'
,
$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
;
return
$types
;
}
protected
function
shouldSendMail
(
PhabricatorLiskDAO
$object
,
array
$xactions
)
{
return
true
;
}
protected
function
shouldPublishFeedStory
(
PhabricatorLiskDAO
$object
,
array
$xactions
)
{
return
true
;
}
protected
function
getMailTo
(
PhabricatorLiskDAO
$object
)
{
$phids
=
array
();
$phids
[]
=
$this
->
requireActor
()->
getPHID
();
$phids
[]
=
$object
->
getCreatorPHID
();
return
$phids
;
}
protected
function
buildMailTemplate
(
PhabricatorLiskDAO
$object
)
{
$phid
=
$object
->
getPHID
();
$name
=
$object
->
getName
();
return
id
(
new
PhabricatorMetaMTAMail
())
->
setSubject
(
$name
)
->
addHeader
(
'Thread-Topic'
,
$phid
);
}
protected
function
buildReplyHandler
(
PhabricatorLiskDAO
$object
)
{
return
id
(
new
PhameBlogReplyHandler
())
->
setMailReceiver
(
$object
);
}
protected
function
buildMailBody
(
PhabricatorLiskDAO
$object
,
array
$xactions
)
{
$body
=
parent
::
buildMailBody
(
$object
,
$xactions
);
$body
->
addLinkSection
(
pht
(
'BLOG DETAIL'
),
PhabricatorEnv
::
getProductionURI
(
$object
->
getViewURI
()));
return
$body
;
}
public
function
getMailTagsMap
()
{
return
array
(
PhameBlogTransaction
::
MAILTAG_DETAILS
=>
pht
(
"A blog's details change."
),
PhameBlogTransaction
::
MAILTAG_SUBSCRIBERS
=>
pht
(
"A blog's subscribers change."
),
PhameBlogTransaction
::
MAILTAG_OTHER
=>
pht
(
'Other blog activity not listed above occurs.'
),
);
}
protected
function
getMailSubjectPrefix
()
{
return
'[Phame]'
;
}
protected
function
supportsSearch
()
{
return
true
;
}
protected
function
shouldApplyHeraldRules
(
PhabricatorLiskDAO
$object
,
array
$xactions
)
{
return
true
;
}
protected
function
buildHeraldAdapter
(
PhabricatorLiskDAO
$object
,
array
$xactions
)
{
return
id
(
new
HeraldPhameBlogAdapter
())
->
setBlog
(
$object
);
}
}
Event Timeline
Log In to Comment