Path: blob/master/src/applications/conpherence/editor/ConpherenceEditEngine.php
12256 views
<?php12final class ConpherenceEditEngine3extends PhabricatorEditEngine {45const ENGINECONST = 'conpherence.thread';67public function getEngineName() {8return pht('Conpherence');9}1011public function getEngineApplicationClass() {12return 'PhabricatorConpherenceApplication';13}1415public function getSummaryHeader() {16return pht('Configure Conpherence Forms');17}1819public function getSummaryText() {20return pht('Configure creation and editing forms in Conpherence.');21}2223protected function newEditableObject() {24return ConpherenceThread::initializeNewRoom($this->getViewer());25}2627protected function newObjectQuery() {28return new ConpherenceThreadQuery();29}3031protected function getObjectCreateTitleText($object) {32return pht('Create New Room');33}3435protected function getObjectEditTitleText($object) {36return pht('Edit Room: %s', $object->getTitle());37}3839protected function getObjectEditShortText($object) {40return $object->getTitle();41}4243protected function getObjectCreateShortText() {44return pht('Create Room');45}4647protected function getObjectName() {48return pht('Room');49}5051protected function getObjectCreateCancelURI($object) {52return $this->getApplication()->getApplicationURI('/');53}5455protected function getEditorURI() {56return $this->getApplication()->getApplicationURI('edit/');57}5859protected function getObjectViewURI($object) {60return $object->getURI();61}6263public function isEngineConfigurable() {64return false;65}6667protected function buildCustomEditFields($object) {68$viewer = $this->getViewer();6970if ($this->getIsCreate()) {71$participant_phids = array($viewer->getPHID());72$initial_phids = array();73} else {74$participant_phids = $object->getParticipantPHIDs();75$initial_phids = $participant_phids;76}7778// Only show participants on create or conduit, not edit.79$show_participants = (bool)$this->getIsCreate();8081return array(82id(new PhabricatorTextEditField())83->setKey('name')84->setLabel(pht('Name'))85->setDescription(pht('Room name.'))86->setConduitTypeDescription(pht('New Room name.'))87->setIsRequired(true)88->setTransactionType(89ConpherenceThreadTitleTransaction::TRANSACTIONTYPE)90->setValue($object->getTitle()),9192id(new PhabricatorTextEditField())93->setKey('topic')94->setLabel(pht('Topic'))95->setDescription(pht('Room topic.'))96->setConduitTypeDescription(pht('New Room topic.'))97->setTransactionType(98ConpherenceThreadTopicTransaction::TRANSACTIONTYPE)99->setValue($object->getTopic()),100101id(new PhabricatorUsersEditField())102->setKey('participants')103->setValue($participant_phids)104->setInitialValue($initial_phids)105->setIsFormField($show_participants)106->setAliases(array('users', 'members', 'participants', 'userPHID'))107->setDescription(pht('Room participants.'))108->setUseEdgeTransactions(true)109->setConduitTypeDescription(pht('New Room participants.'))110->setTransactionType(111ConpherenceThreadParticipantsTransaction::TRANSACTIONTYPE)112->setLabel(pht('Initial Participants')),113114);115}116117}118119120