Changeset View
Changeset View
Standalone View
Standalone View
src/applications/paste/editor/PhabricatorPasteEditEngine.php
| Show All 35 Lines | protected function buildCustomEditFields($object) { | ||||
| $langs = array( | $langs = array( | ||||
| '' => pht('(Detect From Filename in Title)'), | '' => pht('(Detect From Filename in Title)'), | ||||
| ) + PhabricatorEnv::getEnvConfig('pygments.dropdown-choices'); | ) + 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')) | ||||
| ->setDescription(pht('Name of the paste.')) | |||||
| ->setTransactionType(PhabricatorPasteTransaction::TYPE_TITLE) | ->setTransactionType(PhabricatorPasteTransaction::TYPE_TITLE) | ||||
| ->setValue($object->getTitle()), | ->setValue($object->getTitle()), | ||||
| id(new PhabricatorSelectEditField()) | id(new PhabricatorSelectEditField()) | ||||
| ->setKey('language') | ->setKey('language') | ||||
| ->setLabel(pht('Language')) | ->setLabel(pht('Language')) | ||||
| ->setDescription( | |||||
| pht( | |||||
| 'Programming language to interpret the paste as for syntax '. | |||||
| 'highlighting. By default, the language is inferred from the '. | |||||
| 'title.')) | |||||
| ->setAliases(array('lang')) | ->setAliases(array('lang')) | ||||
| ->setTransactionType(PhabricatorPasteTransaction::TYPE_LANGUAGE) | ->setTransactionType(PhabricatorPasteTransaction::TYPE_LANGUAGE) | ||||
| ->setValue($object->getLanguage()) | ->setValue($object->getLanguage()) | ||||
| ->setOptions($langs), | ->setOptions($langs), | ||||
| id(new PhabricatorSelectEditField()) | id(new PhabricatorSelectEditField()) | ||||
| ->setKey('status') | ->setKey('status') | ||||
| ->setLabel(pht('Status')) | ->setLabel(pht('Status')) | ||||
| ->setDescription(pht('Archive the paste.')) | |||||
| ->setTransactionType(PhabricatorPasteTransaction::TYPE_STATUS) | ->setTransactionType(PhabricatorPasteTransaction::TYPE_STATUS) | ||||
| ->setValue($object->getStatus()) | ->setValue($object->getStatus()) | ||||
| ->setOptions(PhabricatorPaste::getStatusNameMap()), | ->setOptions(PhabricatorPaste::getStatusNameMap()), | ||||
| id(new PhabricatorTextAreaEditField()) | id(new PhabricatorTextAreaEditField()) | ||||
| ->setKey('text') | ->setKey('text') | ||||
| ->setLabel(pht('Text')) | ->setLabel(pht('Text')) | ||||
| ->setDescription(pht('The main body text of the paste.')) | |||||
| ->setTransactionType(PhabricatorPasteTransaction::TYPE_CONTENT) | ->setTransactionType(PhabricatorPasteTransaction::TYPE_CONTENT) | ||||
| ->setMonospaced(true) | ->setMonospaced(true) | ||||
| ->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_TALL) | ->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_TALL) | ||||
| ->setValue($object->getRawContent()), | ->setValue($object->getRawContent()), | ||||
| ); | ); | ||||
| } | } | ||||
| } | } | ||||