Changeset View
Changeset View
Standalone View
Standalone View
src/applications/paste/editor/PhabricatorPasteEditEngine.php
Show First 20 Lines • Show All 65 Lines • ▼ Show 20 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')) | ||||
->setTransactionType(PhabricatorPasteTransaction::TYPE_TITLE) | ->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 PhabricatorSelectEditField()) | ||||
->setKey('language') | ->setKey('language') | ||||
->setLabel(pht('Language')) | ->setLabel(pht('Language')) | ||||
->setTransactionType(PhabricatorPasteTransaction::TYPE_LANGUAGE) | ->setTransactionType( | ||||
PhabricatorPasteLanguageTransaction::TRANSACTIONTYPE) | |||||
->setAliases(array('lang')) | ->setAliases(array('lang')) | ||||
->setIsCopyable(true) | ->setIsCopyable(true) | ||||
->setOptions($langs) | ->setOptions($langs) | ||||
->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()), | ->setValue($object->getLanguage()), | ||||
id(new PhabricatorTextAreaEditField()) | id(new PhabricatorTextAreaEditField()) | ||||
->setKey('text') | ->setKey('text') | ||||
->setLabel(pht('Text')) | ->setLabel(pht('Text')) | ||||
->setTransactionType(PhabricatorPasteTransaction::TYPE_CONTENT) | ->setTransactionType( | ||||
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.')) | ||||
->setValue($object->getRawContent()), | ->setValue($object->getRawContent()), | ||||
id(new PhabricatorSelectEditField()) | id(new PhabricatorSelectEditField()) | ||||
->setKey('status') | ->setKey('status') | ||||
->setLabel(pht('Status')) | ->setLabel(pht('Status')) | ||||
->setTransactionType(PhabricatorPasteTransaction::TYPE_STATUS) | ->setTransactionType( | ||||
PhabricatorPasteStatusTransaction::TRANSACTIONTYPE) | |||||
->setIsConduitOnly(true) | ->setIsConduitOnly(true) | ||||
->setOptions(PhabricatorPaste::getStatusNameMap()) | ->setOptions(PhabricatorPaste::getStatusNameMap()) | ||||
->setDescription(pht('Active or archived status.')) | ->setDescription(pht('Active or archived status.')) | ||||
->setConduitDescription(pht('Active or archive the paste.')) | ->setConduitDescription(pht('Active or archive the paste.')) | ||||
->setConduitTypeDescription(pht('New paste status constant.')) | ->setConduitTypeDescription(pht('New paste status constant.')) | ||||
->setValue($object->getStatus()), | ->setValue($object->getStatus()), | ||||
); | ); | ||||
} | } | ||||
} | } |