Remove all "FileHasObject" edge reads and writes
[phabricator.git] / src / applications / ponder / editor / PonderQuestionEditEngine.php
blob640f657ad1b6e1b69e727938c01d865b8832b089
1 <?php
3 final class PonderQuestionEditEngine
4 extends PhabricatorEditEngine {
6 const ENGINECONST = 'ponder.question';
8 public function getEngineName() {
9 return pht('Ponder Question');
12 public function getEngineApplicationClass() {
13 return 'PhabricatorPonderApplication';
16 public function getSummaryHeader() {
17 return pht('Configure Ponder Question Forms');
20 public function getSummaryText() {
21 return pht('Configure creation and editing forms in Ponder Questions.');
24 public function isEngineConfigurable() {
25 return false;
28 protected function newEditableObject() {
29 return PonderQuestion::initializeNewQuestion($this->getViewer());
32 protected function newObjectQuery() {
33 return new PonderQuestionQuery();
36 protected function getObjectCreateTitleText($object) {
37 return pht('Create New Question');
40 protected function getObjectEditTitleText($object) {
41 return pht('Edit Question: %s', $object->getTitle());
44 protected function getObjectEditShortText($object) {
45 return $object->getTitle();
48 protected function getObjectCreateShortText() {
49 return pht('New Question');
52 protected function getObjectName() {
53 return pht('Question');
56 protected function getObjectCreateCancelURI($object) {
57 return $this->getApplication()->getApplicationURI('/');
60 protected function getEditorURI() {
61 return $this->getApplication()->getApplicationURI('question/edit/');
64 protected function getObjectViewURI($object) {
65 return $object->getViewURI();
68 protected function buildCustomEditFields($object) {
70 return array(
71 id(new PhabricatorTextEditField())
72 ->setKey('title')
73 ->setLabel(pht('Question'))
74 ->setDescription(pht('Question title.'))
75 ->setConduitTypeDescription(pht('New question title.'))
76 ->setTransactionType(
77 PonderQuestionTitleTransaction::TRANSACTIONTYPE)
78 ->setValue($object->getTitle())
79 ->setIsRequired(true),
80 id(new PhabricatorRemarkupEditField())
81 ->setKey('content')
82 ->setLabel(pht('Details'))
83 ->setDescription(pht('Long details of the question.'))
84 ->setConduitTypeDescription(pht('New question details.'))
85 ->setValue($object->getContent())
86 ->setTransactionType(
87 PonderQuestionContentTransaction::TRANSACTIONTYPE),
88 id(new PhabricatorRemarkupEditField())
89 ->setKey('answerWiki')
90 ->setLabel(pht('Answer Summary'))
91 ->setDescription(pht('Answer summary of the question.'))
92 ->setConduitTypeDescription(pht('New question answer summary.'))
93 ->setValue($object->getAnswerWiki())
94 ->setTransactionType(
95 PonderQuestionAnswerWikiTransaction::TRANSACTIONTYPE),
96 id(new PhabricatorSelectEditField())
97 ->setKey('status')
98 ->setLabel(pht('Status'))
99 ->setDescription(pht('Status of the question.'))
100 ->setConduitTypeDescription(pht('New question status.'))
101 ->setValue($object->getStatus())
102 ->setTransactionType(
103 PonderQuestionStatusTransaction::TRANSACTIONTYPE)
104 ->setOptions(PonderQuestionStatus::getQuestionStatusMap()),