Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / phame / editor / PhameBlogEditor.php
blobc122d8fa3b1cda57a366c8ec6ad669373ddb85b6
1 <?php
3 final class PhameBlogEditor
4 extends PhabricatorApplicationTransactionEditor {
6 public function getEditorApplicationClass() {
7 return 'PhabricatorPhameApplication';
10 public function getEditorObjectsDescription() {
11 return pht('Phame Blogs');
14 public function getCreateObjectTitle($author, $object) {
15 return pht('%s created this blog.', $author);
18 public function getCreateObjectTitleForFeed($author, $object) {
19 return pht('%s created %s.', $author, $object);
22 public function getTransactionTypes() {
23 $types = parent::getTransactionTypes();
24 $types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;
25 $types[] = PhabricatorTransactions::TYPE_EDIT_POLICY;
27 return $types;
30 protected function shouldSendMail(
31 PhabricatorLiskDAO $object,
32 array $xactions) {
33 return true;
36 protected function shouldPublishFeedStory(
37 PhabricatorLiskDAO $object,
38 array $xactions) {
39 return true;
42 protected function getMailTo(PhabricatorLiskDAO $object) {
43 $phids = array();
44 $phids[] = $this->requireActor()->getPHID();
45 $phids[] = $object->getCreatorPHID();
47 return $phids;
50 protected function buildMailTemplate(PhabricatorLiskDAO $object) {
51 $name = $object->getName();
53 return id(new PhabricatorMetaMTAMail())
54 ->setSubject($name);
57 protected function buildReplyHandler(PhabricatorLiskDAO $object) {
58 return id(new PhameBlogReplyHandler())
59 ->setMailReceiver($object);
62 protected function buildMailBody(
63 PhabricatorLiskDAO $object,
64 array $xactions) {
66 $body = parent::buildMailBody($object, $xactions);
68 $body->addLinkSection(
69 pht('BLOG DETAIL'),
70 PhabricatorEnv::getProductionURI($object->getViewURI()));
72 return $body;
75 public function getMailTagsMap() {
76 return array(
77 PhameBlogTransaction::MAILTAG_DETAILS =>
78 pht("A blog's details change."),
79 PhameBlogTransaction::MAILTAG_SUBSCRIBERS =>
80 pht("A blog's subscribers change."),
81 PhameBlogTransaction::MAILTAG_OTHER =>
82 pht('Other blog activity not listed above occurs.'),
86 protected function getMailSubjectPrefix() {
87 return '[Phame]';
91 protected function supportsSearch() {
92 return true;
95 protected function shouldApplyHeraldRules(
96 PhabricatorLiskDAO $object,
97 array $xactions) {
98 return true;
101 protected function buildHeraldAdapter(
102 PhabricatorLiskDAO $object,
103 array $xactions) {
105 return id(new HeraldPhameBlogAdapter())
106 ->setBlog($object);