Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15188254
D16677.id40140.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Referenced Files
None
Subscribers
None
D16677.id40140.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -289,6 +289,7 @@
'ConpherenceCreateThreadConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceCreateThreadConduitAPIMethod.php',
'ConpherenceDAO' => 'applications/conpherence/storage/ConpherenceDAO.php',
'ConpherenceDurableColumnView' => 'applications/conpherence/view/ConpherenceDurableColumnView.php',
+ 'ConpherenceEditEngine' => 'applications/conpherence/editor/ConpherenceEditEngine.php',
'ConpherenceEditor' => 'applications/conpherence/editor/ConpherenceEditor.php',
'ConpherenceFormDragAndDropUploadControl' => 'applications/conpherence/view/ConpherenceFormDragAndDropUploadControl.php',
'ConpherenceFulltextQuery' => 'applications/conpherence/query/ConpherenceFulltextQuery.php',
@@ -307,6 +308,7 @@
'ConpherenceQueryThreadConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceQueryThreadConduitAPIMethod.php',
'ConpherenceQueryTransactionConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceQueryTransactionConduitAPIMethod.php',
'ConpherenceReplyHandler' => 'applications/conpherence/mail/ConpherenceReplyHandler.php',
+ 'ConpherenceRoomEditController' => 'applications/conpherence/controller/ConpherenceRoomEditController.php',
'ConpherenceRoomListController' => 'applications/conpherence/controller/ConpherenceRoomListController.php',
'ConpherenceRoomPictureController' => 'applications/conpherence/controller/ConpherenceRoomPictureController.php',
'ConpherenceRoomTestCase' => 'applications/conpherence/__tests__/ConpherenceRoomTestCase.php',
@@ -4765,6 +4767,7 @@
'ConpherenceCreateThreadConduitAPIMethod' => 'ConpherenceConduitAPIMethod',
'ConpherenceDAO' => 'PhabricatorLiskDAO',
'ConpherenceDurableColumnView' => 'AphrontTagView',
+ 'ConpherenceEditEngine' => 'PhabricatorEditEngine',
'ConpherenceEditor' => 'PhabricatorApplicationTransactionEditor',
'ConpherenceFormDragAndDropUploadControl' => 'AphrontFormControl',
'ConpherenceFulltextQuery' => 'PhabricatorOffsetPagedQuery',
@@ -4783,6 +4786,7 @@
'ConpherenceQueryThreadConduitAPIMethod' => 'ConpherenceConduitAPIMethod',
'ConpherenceQueryTransactionConduitAPIMethod' => 'ConpherenceConduitAPIMethod',
'ConpherenceReplyHandler' => 'PhabricatorMailReplyHandler',
+ 'ConpherenceRoomEditController' => 'ConpherenceController',
'ConpherenceRoomListController' => 'ConpherenceController',
'ConpherenceRoomPictureController' => 'ConpherenceController',
'ConpherenceRoomTestCase' => 'ConpherenceTestCase',
diff --git a/src/applications/conpherence/application/PhabricatorConpherenceApplication.php b/src/applications/conpherence/application/PhabricatorConpherenceApplication.php
--- a/src/applications/conpherence/application/PhabricatorConpherenceApplication.php
+++ b/src/applications/conpherence/application/PhabricatorConpherenceApplication.php
@@ -45,6 +45,8 @@
=> 'ConpherenceColumnViewController',
'new/'
=> 'ConpherenceNewRoomController',
+ $this->getEditRoutePattern('edit/')
+ => 'ConpherenceRoomEditController',
'picture/(?P<id>[1-9]\d*)/'
=> 'ConpherenceRoomPictureController',
'search/(?:query/(?P<queryKey>[^/]+)/)?'
diff --git a/src/applications/conpherence/controller/ConpherenceRoomEditController.php b/src/applications/conpherence/controller/ConpherenceRoomEditController.php
new file mode 100644
--- /dev/null
+++ b/src/applications/conpherence/controller/ConpherenceRoomEditController.php
@@ -0,0 +1,11 @@
+<?php
+
+final class ConpherenceRoomEditController
+ extends ConpherenceController {
+
+ public function handleRequest(AphrontRequest $request) {
+ return id(new ConpherenceEditEngine())
+ ->setController($this)
+ ->buildResponse();
+ }
+}
diff --git a/src/applications/conpherence/editor/ConpherenceEditEngine.php b/src/applications/conpherence/editor/ConpherenceEditEngine.php
new file mode 100644
--- /dev/null
+++ b/src/applications/conpherence/editor/ConpherenceEditEngine.php
@@ -0,0 +1,101 @@
+<?php
+
+final class ConpherenceEditEngine
+ extends PhabricatorEditEngine {
+
+ const ENGINECONST = 'conpherence.thread';
+
+ public function getEngineName() {
+ return pht('Conpherence');
+ }
+
+ public function getEngineApplicationClass() {
+ 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),
+
+ );
+ }
+
+}
diff --git a/src/applications/conpherence/storage/ConpherenceThread.php b/src/applications/conpherence/storage/ConpherenceThread.php
--- a/src/applications/conpherence/storage/ConpherenceThread.php
+++ b/src/applications/conpherence/storage/ConpherenceThread.php
@@ -73,6 +73,10 @@
return parent::save();
}
+ public function getURI() {
+ return '/'.$this->getMonogram();
+ }
+
public function getMonogram() {
return 'Z'.$this->getID();
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Feb 22, 1:31 PM (1 h, 6 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7180777
Default Alt Text
D16677.id40140.diff (7 KB)
Attached To
Mode
D16677: Update Conpherence to use EditEngine
Attached
Detach File
Event Timeline
Log In to Comment