Changeset View
Changeset View
Standalone View
Standalone View
src/applications/badges/editor/PhabricatorBadgesEditEngine.php
Show First 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | final class PhabricatorBadgesEditEngine | ||||
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('Badge name.')) | ->setDescription(pht('Badge name.')) | ||||
->setConduitTypeDescription(pht('New badge name.')) | |||||
->setTransactionType(PhabricatorBadgesTransaction::TYPE_NAME) | ->setTransactionType(PhabricatorBadgesTransaction::TYPE_NAME) | ||||
->setValue($object->getName()), | ->setValue($object->getName()), | ||||
id(new PhabricatorTextEditField()) | id(new PhabricatorTextEditField()) | ||||
->setKey('flavor') | ->setKey('flavor') | ||||
->setLabel(pht('Flavor text')) | ->setLabel(pht('Flavor text')) | ||||
->setDescription(pht('Short description of the badge.')) | ->setDescription(pht('Short description of the badge.')) | ||||
->setConduitTypeDescription(pht('New badge flavor.')) | |||||
->setValue($object->getFlavor()) | ->setValue($object->getFlavor()) | ||||
->setTransactionType(PhabricatorBadgesTransaction::TYPE_FLAVOR), | ->setTransactionType(PhabricatorBadgesTransaction::TYPE_FLAVOR), | ||||
id(new PhabricatorIconSetEditField()) | id(new PhabricatorIconSetEditField()) | ||||
->setKey('icon') | ->setKey('icon') | ||||
->setLabel(pht('Icon')) | ->setLabel(pht('Icon')) | ||||
->setIconSet(new PhabricatorBadgesIconSet()) | ->setIconSet(new PhabricatorBadgesIconSet()) | ||||
->setTransactionType(PhabricatorBadgesTransaction::TYPE_ICON) | ->setTransactionType(PhabricatorBadgesTransaction::TYPE_ICON) | ||||
->setConduitDescription(pht('Change the badge icon.')) | ->setConduitDescription(pht('Change the badge icon.')) | ||||
->setConduitTypeDescription(pht('New badge icon.')) | ->setConduitTypeDescription(pht('New badge icon.')) | ||||
->setValue($object->getIcon()), | ->setValue($object->getIcon()), | ||||
id(new PhabricatorSelectEditField()) | id(new PhabricatorSelectEditField()) | ||||
->setKey('quality') | ->setKey('quality') | ||||
->setLabel(pht('Quality')) | ->setLabel(pht('Quality')) | ||||
->setDescription(pht('Color and rarity of the badge.')) | |||||
->setConduitTypeDescription(pht('New badge quality.')) | |||||
->setValue($object->getQuality()) | ->setValue($object->getQuality()) | ||||
->setTransactionType(PhabricatorBadgesTransaction::TYPE_QUALITY) | ->setTransactionType(PhabricatorBadgesTransaction::TYPE_QUALITY) | ||||
->setOptions(PhabricatorBadgesQuality::getDropdownQualityMap()), | ->setOptions(PhabricatorBadgesQuality::getDropdownQualityMap()), | ||||
id(new PhabricatorRemarkupEditField()) | id(new PhabricatorRemarkupEditField()) | ||||
->setKey('description') | ->setKey('description') | ||||
->setLabel(pht('Description')) | ->setLabel(pht('Description')) | ||||
->setDescription(pht('Badge long description.')) | ->setDescription(pht('Badge long description.')) | ||||
->setConduitTypeDescription(pht('New badge description.')) | |||||
->setTransactionType(PhabricatorBadgesTransaction::TYPE_DESCRIPTION) | ->setTransactionType(PhabricatorBadgesTransaction::TYPE_DESCRIPTION) | ||||
->setValue($object->getDescription()), | ->setValue($object->getDescription()), | ||||
); | ); | ||||
} | } | ||||
} | } |