Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conpherence/editor/ConpherenceEditEngine.php
- This file was added.
<?php | |||||
final class ConpherenceEditEngine | |||||
extends PhabricatorEditEngine { | |||||
const ENGINECONST = 'conpherence.thread'; | |||||
public function getEngineName() { | |||||
return pht('Conpherence'); | |||||
} | |||||
public function getEngineApplicationClass() { | |||||
epriestley: Until things are more stable, maybe do this:
```
public function isEngineConfigurable() {… | |||||
return 'PhabricatorConpherenceApplication'; | |||||
} | |||||
public function getSummaryHeader() { | |||||
return pht('Configure Conpherence Forms'); | |||||
} | |||||
public function getSummaryText() { | |||||
return pht('Configure creation and editing forms in Conpherence.'); | |||||
} | |||||
protected function newEditableObject() { | |||||
return ConpherenceThread::initializeNewRoom($this->getViewer()); | |||||
} | |||||
protected function newObjectQuery() { | |||||
return new ConpherenceThreadQuery(); | |||||
} | |||||
protected function getObjectCreateTitleText($object) { | |||||
return pht('Create New Room'); | |||||
} | |||||
protected function getObjectEditTitleText($object) { | |||||
return pht('Edit Room: %s', $object->getTitle()); | |||||
} | |||||
protected function getObjectEditShortText($object) { | |||||
return $object->getTitle(); | |||||
} | |||||
protected function getObjectCreateShortText() { | |||||
return pht('Create Room'); | |||||
} | |||||
protected function getObjectName() { | |||||
return pht('Room'); | |||||
} | |||||
protected function getObjectCreateCancelURI($object) { | |||||
return $this->getApplication()->getApplicationURI('/'); | |||||
} | |||||
protected function getEditorURI() { | |||||
return $this->getApplication()->getApplicationURI('edit/'); | |||||
} | |||||
protected function getObjectViewURI($object) { | |||||
return $object->getURI(); | |||||
} | |||||
protected function buildCustomEditFields($object) { | |||||
return array( | |||||
id(new PhabricatorTextEditField()) | |||||
->setKey('name') | |||||
->setLabel(pht('Name')) | |||||
->setDescription(pht('Room name.')) | |||||
->setConduitTypeDescription(pht('New Room name.')) | |||||
->setTransactionType(ConpherenceTransaction::TYPE_TITLE) | |||||
->setValue($object->getTitle()), | |||||
id(new PhabricatorTextEditField()) | |||||
->setKey('topic') | |||||
->setLabel(pht('Topic')) | |||||
->setDescription(pht('Room topic.')) | |||||
->setConduitTypeDescription(pht('New Room topic.')) | |||||
->setTransactionType(ConpherenceTransaction::TYPE_TOPIC) | |||||
->setValue($object->getTopic()), | |||||
id(new PhabricatorUsersEditField()) | |||||
->setKey('participants') | |||||
->setValue($object->getParticipants()) | |||||
->setDescription(pht('Room participants.')) | |||||
->setConduitTypeDescription(pht('New Room participants.')) | |||||
->setTransactionType(ConpherenceTransaction::TYPE_PARTICIPANTS) | |||||
->setLabel(pht('Other Participants')), | |||||
id(new PhabricatorRemarkupEditField()) | |||||
->setKey('message') | |||||
->setLabel(pht('First Message')) | |||||
->setDescription(pht('First Room message.')) | |||||
->setConduitTypeDescription(pht('New Room first message.')) | |||||
->setTransactionType(PhabricatorTransactions::TYPE_COMMENT), | |||||
); | |||||
} | |||||
} | |||||
Not Done Inline ActionsIf you want to offer all these variants, consider a more complete set: user users userPHID userPHIDs member members memberPHID memberPHIDs pariticipant participants participantPHID participantPHIDs ...or just ditch 'em? Not sure there's much value. epriestley: If you want to offer all these variants, consider a more complete set:
```
user
users
userPHID… |
Until things are more stable, maybe do this:
...to prevent people from defining custom forms for now, since we may break them later (or never let you customize them if we take over the whole workflow with private/public specializations).