Remove all "FileHasObject" edge reads and writes
[phabricator.git] / src / applications / conpherence / editor / ConpherenceEditEngine.php
blobf5f850e637e4a763a337d9fd22bc8ef91cb599a0
1 <?php
3 final class ConpherenceEditEngine
4 extends PhabricatorEditEngine {
6 const ENGINECONST = 'conpherence.thread';
8 public function getEngineName() {
9 return pht('Conpherence');
12 public function getEngineApplicationClass() {
13 return 'PhabricatorConpherenceApplication';
16 public function getSummaryHeader() {
17 return pht('Configure Conpherence Forms');
20 public function getSummaryText() {
21 return pht('Configure creation and editing forms in Conpherence.');
24 protected function newEditableObject() {
25 return ConpherenceThread::initializeNewRoom($this->getViewer());
28 protected function newObjectQuery() {
29 return new ConpherenceThreadQuery();
32 protected function getObjectCreateTitleText($object) {
33 return pht('Create New Room');
36 protected function getObjectEditTitleText($object) {
37 return pht('Edit Room: %s', $object->getTitle());
40 protected function getObjectEditShortText($object) {
41 return $object->getTitle();
44 protected function getObjectCreateShortText() {
45 return pht('Create Room');
48 protected function getObjectName() {
49 return pht('Room');
52 protected function getObjectCreateCancelURI($object) {
53 return $this->getApplication()->getApplicationURI('/');
56 protected function getEditorURI() {
57 return $this->getApplication()->getApplicationURI('edit/');
60 protected function getObjectViewURI($object) {
61 return $object->getURI();
64 public function isEngineConfigurable() {
65 return false;
68 protected function buildCustomEditFields($object) {
69 $viewer = $this->getViewer();
71 if ($this->getIsCreate()) {
72 $participant_phids = array($viewer->getPHID());
73 $initial_phids = array();
74 } else {
75 $participant_phids = $object->getParticipantPHIDs();
76 $initial_phids = $participant_phids;
79 // Only show participants on create or conduit, not edit.
80 $show_participants = (bool)$this->getIsCreate();
82 return array(
83 id(new PhabricatorTextEditField())
84 ->setKey('name')
85 ->setLabel(pht('Name'))
86 ->setDescription(pht('Room name.'))
87 ->setConduitTypeDescription(pht('New Room name.'))
88 ->setIsRequired(true)
89 ->setTransactionType(
90 ConpherenceThreadTitleTransaction::TRANSACTIONTYPE)
91 ->setValue($object->getTitle()),
93 id(new PhabricatorTextEditField())
94 ->setKey('topic')
95 ->setLabel(pht('Topic'))
96 ->setDescription(pht('Room topic.'))
97 ->setConduitTypeDescription(pht('New Room topic.'))
98 ->setTransactionType(
99 ConpherenceThreadTopicTransaction::TRANSACTIONTYPE)
100 ->setValue($object->getTopic()),
102 id(new PhabricatorUsersEditField())
103 ->setKey('participants')
104 ->setValue($participant_phids)
105 ->setInitialValue($initial_phids)
106 ->setIsFormField($show_participants)
107 ->setAliases(array('users', 'members', 'participants', 'userPHID'))
108 ->setDescription(pht('Room participants.'))
109 ->setUseEdgeTransactions(true)
110 ->setConduitTypeDescription(pht('New Room participants.'))
111 ->setTransactionType(
112 ConpherenceThreadParticipantsTransaction::TRANSACTIONTYPE)
113 ->setLabel(pht('Initial Participants')),