Differential D14503 Diff 35174 src/applications/transactions/editor/PhabricatorEditEngineConfigurationEditEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/editor/PhabricatorEditEngineConfigurationEditEngine.php
| Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | protected function getObjectEditShortText($object) { | ||||
| return pht('Form %d', $object->getID()); | return pht('Form %d', $object->getID()); | ||||
| } | } | ||||
| protected function getObjectCreateShortText() { | protected function getObjectCreateShortText() { | ||||
| return pht('Create Form'); | return pht('Create Form'); | ||||
| } | } | ||||
| protected function getObjectViewURI($object) { | protected function getObjectViewURI($object) { | ||||
| $engine_key = $this->getTargetEngine()->getEngineKey(); | |||||
| $id = $object->getID(); | $id = $object->getID(); | ||||
| return "/transactions/editengine/{$engine_key}/view/{$id}/"; | return $this->getURI("view/{$id}/"); | ||||
| } | } | ||||
| protected function getObjectEditURI($object) { | protected function getEditorURI() { | ||||
| $engine_key = $this->getTargetEngine()->getEngineKey(); | return $this->getURI('edit/'); | ||||
| $id = $object->getID(); | |||||
| return "/transactions/editengine/{$engine_key}/edit/{$id}/"; | |||||
| } | } | ||||
| protected function getObjectCreateCancelURI($object) { | protected function getObjectCreateCancelURI($object) { | ||||
| return $this->getURI(); | |||||
| } | |||||
| private function getURI($path = null) { | |||||
| $engine_key = $this->getTargetEngine()->getEngineKey(); | $engine_key = $this->getTargetEngine()->getEngineKey(); | ||||
| return "/transactions/editengine/{$engine_key}/"; | return "/transactions/editengine/{$engine_key}/{$path}"; | ||||
| } | } | ||||
| protected function buildCustomEditFields($object) { | protected function buildCustomEditFields($object) { | ||||
| return array( | return array( | ||||
| id(new PhabricatorTextEditField()) | id(new PhabricatorTextEditField()) | ||||
| ->setKey('name') | ->setKey('name') | ||||
| ->setLabel(pht('Name')) | ->setLabel(pht('Name')) | ||||
| ->setDescription(pht('Name of the form.')) | ->setDescription(pht('Name of the form.')) | ||||
| ->setTransactionType( | ->setTransactionType( | ||||
| PhabricatorEditEngineConfigurationTransaction::TYPE_NAME) | PhabricatorEditEngineConfigurationTransaction::TYPE_NAME) | ||||
| ->setValue($object->getName()), | ->setValue($object->getName()), | ||||
| id(new PhabricatorRemarkupEditField()) | |||||
| ->setKey('preamble') | |||||
| ->setLabel(pht('Preamble')) | |||||
| ->setDescription(pht('Optional instructions, shown above the form.')) | |||||
| ->setTransactionType( | |||||
| PhabricatorEditEngineConfigurationTransaction::TYPE_PREAMBLE) | |||||
| ->setValue($object->getPreamble()), | |||||
| ); | ); | ||||
| } | } | ||||
| } | } | ||||