Changeset View
Changeset View
Standalone View
Standalone View
src/applications/paste/editor/PhabricatorPasteEditEngine.php
| Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | protected function getCommentViewButtonText($object) { | ||||
| return pht('Nom Nom Nom Nom Nom'); | return pht('Nom Nom Nom Nom Nom'); | ||||
| } | } | ||||
| protected function getObjectViewURI($object) { | protected function getObjectViewURI($object) { | ||||
| return '/P'.$object->getID(); | return '/P'.$object->getID(); | ||||
| } | } | ||||
| protected function buildCustomEditFields($object) { | protected function buildCustomEditFields($object) { | ||||
| $langs = array( | |||||
| '' => pht('(Detect From Filename in Title)'), | |||||
| ) + PhabricatorEnv::getEnvConfig('pygments.dropdown-choices'); | |||||
| return array( | return array( | ||||
| id(new PhabricatorTextEditField()) | id(new PhabricatorTextEditField()) | ||||
| ->setKey('title') | ->setKey('title') | ||||
| ->setLabel(pht('Title')) | ->setLabel(pht('Title')) | ||||
| ->setTransactionType(PhabricatorPasteTitleTransaction::TRANSACTIONTYPE) | ->setTransactionType(PhabricatorPasteTitleTransaction::TRANSACTIONTYPE) | ||||
| ->setDescription(pht('The title of the paste.')) | ->setDescription(pht('The title of the paste.')) | ||||
| ->setConduitDescription(pht('Retitle the paste.')) | ->setConduitDescription(pht('Retitle the paste.')) | ||||
| ->setConduitTypeDescription(pht('New paste title.')) | ->setConduitTypeDescription(pht('New paste title.')) | ||||
| ->setValue($object->getTitle()), | ->setValue($object->getTitle()), | ||||
| id(new PhabricatorSelectEditField()) | id(new PhabricatorDatasourceEditField()) | ||||
| ->setKey('language') | ->setKey('language') | ||||
| ->setLabel(pht('Language')) | ->setLabel(pht('Language')) | ||||
| ->setTransactionType( | ->setTransactionType( | ||||
| PhabricatorPasteLanguageTransaction::TRANSACTIONTYPE) | PhabricatorPasteLanguageTransaction::TRANSACTIONTYPE) | ||||
| ->setAliases(array('lang')) | ->setAliases(array('lang')) | ||||
| ->setIsCopyable(true) | ->setIsCopyable(true) | ||||
| ->setOptions($langs) | ->setDatasource(new PasteLanguageSelectDatasource()) | ||||
| ->setDescription( | ->setDescription( | ||||
| pht( | pht( | ||||
| 'Language used for syntax highlighting. By default, inferred '. | 'Language used for syntax highlighting. By default, inferred '. | ||||
| 'from the title.')) | 'from the title.')) | ||||
| ->setConduitDescription( | ->setConduitDescription( | ||||
| pht('Change language used for syntax highlighting.')) | pht('Change language used for syntax highlighting.')) | ||||
| ->setConduitTypeDescription(pht('New highlighting language.')) | ->setConduitTypeDescription(pht('New highlighting language.')) | ||||
| ->setValue($object->getLanguage()), | ->setSingleValue($object->getLanguage()), | ||||
| id(new PhabricatorTextAreaEditField()) | id(new PhabricatorTextAreaEditField()) | ||||
| ->setKey('text') | ->setKey('text') | ||||
epriestley: With the `null` migration, I think you should be able to remove this conditional. | |||||
| ->setLabel(pht('Text')) | ->setLabel(pht('Text')) | ||||
| ->setTransactionType( | ->setTransactionType( | ||||
| PhabricatorPasteContentTransaction::TRANSACTIONTYPE) | PhabricatorPasteContentTransaction::TRANSACTIONTYPE) | ||||
| ->setMonospaced(true) | ->setMonospaced(true) | ||||
| ->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_TALL) | ->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_TALL) | ||||
| ->setDescription(pht('The main body text of the paste.')) | ->setDescription(pht('The main body text of the paste.')) | ||||
| ->setConduitDescription(pht('Change the paste content.')) | ->setConduitDescription(pht('Change the paste content.')) | ||||
| ->setConduitTypeDescription(pht('New body content.')) | ->setConduitTypeDescription(pht('New body content.')) | ||||
| Show All 16 Lines | |||||
With the null migration, I think you should be able to remove this conditional.