Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / phame / editor / PhameBlogEditEngine.php
blobe11dec684790a77f9aa80536f9b9d108f022db57
1 <?php
3 final class PhameBlogEditEngine
4 extends PhabricatorEditEngine {
6 const ENGINECONST = 'phame.blog';
8 public function getEngineName() {
9 return pht('Blogs');
12 public function getEngineApplicationClass() {
13 return 'PhabricatorPhameApplication';
16 public function getSummaryHeader() {
17 return pht('Configure Phame Blog Forms');
20 public function getSummaryText() {
21 return pht('Configure how blogs in Phame are created and edited.');
24 protected function newEditableObject() {
25 return PhameBlog::initializeNewBlog($this->getViewer());
28 protected function newObjectQuery() {
29 return id(new PhameBlogQuery())
30 ->needProfileImage(true);
33 protected function getObjectCreateTitleText($object) {
34 return pht('Create New Blog');
37 protected function getObjectEditTitleText($object) {
38 return pht('Edit %s', $object->getName());
41 protected function getObjectEditShortText($object) {
42 return $object->getName();
45 protected function getObjectCreateShortText() {
46 return pht('Create Blog');
49 protected function getObjectName() {
50 return pht('Blog');
53 protected function getObjectCreateCancelURI($object) {
54 return $this->getApplication()->getApplicationURI('blog/');
57 protected function getEditorURI() {
58 return $this->getApplication()->getApplicationURI('blog/edit/');
61 protected function getObjectViewURI($object) {
62 return $object->getManageURI();
65 protected function getCreateNewObjectPolicy() {
66 return $this->getApplication()->getPolicy(
67 PhameBlogCreateCapability::CAPABILITY);
70 protected function buildCustomEditFields($object) {
71 return array(
72 id(new PhabricatorTextEditField())
73 ->setKey('name')
74 ->setLabel(pht('Name'))
75 ->setDescription(pht('Blog name.'))
76 ->setConduitDescription(pht('Retitle the blog.'))
77 ->setConduitTypeDescription(pht('New blog title.'))
78 ->setTransactionType(PhameBlogNameTransaction::TRANSACTIONTYPE)
79 ->setIsRequired(true)
80 ->setValue($object->getName()),
81 id(new PhabricatorTextEditField())
82 ->setKey('subtitle')
83 ->setLabel(pht('Subtitle'))
84 ->setDescription(pht('Blog subtitle.'))
85 ->setConduitDescription(pht('Change the blog subtitle.'))
86 ->setConduitTypeDescription(pht('New blog subtitle.'))
87 ->setTransactionType(PhameBlogSubtitleTransaction::TRANSACTIONTYPE)
88 ->setValue($object->getSubtitle()),
89 id(new PhabricatorRemarkupEditField())
90 ->setKey('description')
91 ->setLabel(pht('Description'))
92 ->setDescription(pht('Blog description.'))
93 ->setConduitDescription(pht('Change the blog description.'))
94 ->setConduitTypeDescription(pht('New blog description.'))
95 ->setTransactionType(PhameBlogDescriptionTransaction::TRANSACTIONTYPE)
96 ->setValue($object->getDescription()),
97 id(new PhabricatorTextEditField())
98 ->setKey('domainFullURI')
99 ->setLabel(pht('Full Domain URI'))
100 ->setControlInstructions(pht('Set Full Domain URI if you plan to '.
101 'serve this blog on another hosted domain. Parent Site Name and '.
102 'Parent Site URI are optional but helpful since they provide '.
103 'a link from the blog back to your parent site.'))
104 ->setDescription(pht('Blog full domain URI.'))
105 ->setConduitDescription(pht('Change the blog full domain URI.'))
106 ->setConduitTypeDescription(pht('New blog full domain URI.'))
107 ->setValue($object->getDomainFullURI())
108 ->setTransactionType(PhameBlogFullDomainTransaction::TRANSACTIONTYPE),
109 id(new PhabricatorTextEditField())
110 ->setKey('parentSite')
111 ->setLabel(pht('Parent Site Name'))
112 ->setDescription(pht('Blog parent site name.'))
113 ->setConduitDescription(pht('Change the blog parent site name.'))
114 ->setConduitTypeDescription(pht('New blog parent site name.'))
115 ->setValue($object->getParentSite())
116 ->setTransactionType(PhameBlogParentSiteTransaction::TRANSACTIONTYPE),
117 id(new PhabricatorTextEditField())
118 ->setKey('parentDomain')
119 ->setLabel(pht('Parent Site URI'))
120 ->setDescription(pht('Blog parent domain name.'))
121 ->setConduitDescription(pht('Change the blog parent domain.'))
122 ->setConduitTypeDescription(pht('New blog parent domain.'))
123 ->setValue($object->getParentDomain())
124 ->setTransactionType(PhameBlogParentDomainTransaction::TRANSACTIONTYPE),
125 id(new PhabricatorSelectEditField())
126 ->setKey('status')
127 ->setLabel(pht('Status'))
128 ->setTransactionType(PhameBlogStatusTransaction::TRANSACTIONTYPE)
129 ->setIsFormField(false)
130 ->setOptions(PhameBlog::getStatusNameMap())
131 ->setDescription(pht('Active or archived status.'))
132 ->setConduitDescription(pht('Active or archive the blog.'))
133 ->setConduitTypeDescription(pht('New blog status constant.'))
134 ->setValue($object->getStatus()),