Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / countdown / editor / PhabricatorCountdownEditEngine.php
blob844cd6d9dfc5a26b7e40c4c0777466d94b6c33de
1 <?php
3 final class PhabricatorCountdownEditEngine
4 extends PhabricatorEditEngine {
6 const ENGINECONST = 'countdown.countdown';
8 public function isEngineConfigurable() {
9 return false;
12 public function getEngineName() {
13 return pht('Countdowns');
16 public function getSummaryHeader() {
17 return pht('Edit Countdowns');
20 public function getSummaryText() {
21 return pht('Creates and edits countdowns.');
24 public function getEngineApplicationClass() {
25 return 'PhabricatorCountdownApplication';
28 protected function newEditableObject() {
29 return PhabricatorCountdown::initializeNewCountdown(
30 $this->getViewer());
33 protected function newObjectQuery() {
34 return id(new PhabricatorCountdownQuery());
37 protected function getObjectCreateTitleText($object) {
38 return pht('Create Countdown');
41 protected function getObjectCreateButtonText($object) {
42 return pht('Create Countdown');
45 protected function getObjectEditTitleText($object) {
46 return pht('Edit Countdown: %s', $object->getTitle());
49 protected function getObjectEditShortText($object) {
50 return pht('Edit Countdown');
53 protected function getObjectCreateShortText() {
54 return pht('Create Countdown');
57 protected function getObjectName() {
58 return pht('Countdown');
61 protected function getCommentViewHeaderText($object) {
62 return pht('Last Words');
65 protected function getCommentViewButtonText($object) {
66 return pht('Contemplate Infinity');
69 protected function getObjectViewURI($object) {
70 return $object->getURI();
73 protected function buildCustomEditFields($object) {
74 $epoch_value = $object->getEpoch();
75 if ($epoch_value === null) {
76 $epoch_value = PhabricatorTime::getNow();
79 return array(
80 id(new PhabricatorTextEditField())
81 ->setKey('name')
82 ->setLabel(pht('Name'))
83 ->setIsRequired(true)
84 ->setTransactionType(
85 PhabricatorCountdownTitleTransaction::TRANSACTIONTYPE)
86 ->setDescription(pht('The countdown name.'))
87 ->setConduitDescription(pht('Rename the countdown.'))
88 ->setConduitTypeDescription(pht('New countdown name.'))
89 ->setValue($object->getTitle()),
90 id(new PhabricatorEpochEditField())
91 ->setKey('epoch')
92 ->setLabel(pht('End Date'))
93 ->setTransactionType(
94 PhabricatorCountdownEpochTransaction::TRANSACTIONTYPE)
95 ->setDescription(pht('Date when the countdown ends.'))
96 ->setConduitDescription(pht('Change the end date of the countdown.'))
97 ->setConduitTypeDescription(pht('New countdown end date.'))
98 ->setValue($epoch_value),
99 id(new PhabricatorRemarkupEditField())
100 ->setKey('description')
101 ->setLabel(pht('Description'))
102 ->setTransactionType(
103 PhabricatorCountdownDescriptionTransaction::TRANSACTIONTYPE)
104 ->setDescription(pht('Description of the countdown.'))
105 ->setConduitDescription(pht('Change the countdown description.'))
106 ->setConduitTypeDescription(pht('New description.'))
107 ->setValue($object->getDescription()),