Path: blob/master/src/applications/countdown/editor/PhabricatorCountdownEditEngine.php
12256 views
<?php12final class PhabricatorCountdownEditEngine3extends PhabricatorEditEngine {45const ENGINECONST = 'countdown.countdown';67public function isEngineConfigurable() {8return false;9}1011public function getEngineName() {12return pht('Countdowns');13}1415public function getSummaryHeader() {16return pht('Edit Countdowns');17}1819public function getSummaryText() {20return pht('Creates and edits countdowns.');21}2223public function getEngineApplicationClass() {24return 'PhabricatorCountdownApplication';25}2627protected function newEditableObject() {28return PhabricatorCountdown::initializeNewCountdown(29$this->getViewer());30}3132protected function newObjectQuery() {33return id(new PhabricatorCountdownQuery());34}3536protected function getObjectCreateTitleText($object) {37return pht('Create Countdown');38}3940protected function getObjectCreateButtonText($object) {41return pht('Create Countdown');42}4344protected function getObjectEditTitleText($object) {45return pht('Edit Countdown: %s', $object->getTitle());46}4748protected function getObjectEditShortText($object) {49return pht('Edit Countdown');50}5152protected function getObjectCreateShortText() {53return pht('Create Countdown');54}5556protected function getObjectName() {57return pht('Countdown');58}5960protected function getCommentViewHeaderText($object) {61return pht('Last Words');62}6364protected function getCommentViewButtonText($object) {65return pht('Contemplate Infinity');66}6768protected function getObjectViewURI($object) {69return $object->getURI();70}7172protected function buildCustomEditFields($object) {73$epoch_value = $object->getEpoch();74if ($epoch_value === null) {75$epoch_value = PhabricatorTime::getNow();76}7778return array(79id(new PhabricatorTextEditField())80->setKey('name')81->setLabel(pht('Name'))82->setIsRequired(true)83->setTransactionType(84PhabricatorCountdownTitleTransaction::TRANSACTIONTYPE)85->setDescription(pht('The countdown name.'))86->setConduitDescription(pht('Rename the countdown.'))87->setConduitTypeDescription(pht('New countdown name.'))88->setValue($object->getTitle()),89id(new PhabricatorEpochEditField())90->setKey('epoch')91->setLabel(pht('End Date'))92->setTransactionType(93PhabricatorCountdownEpochTransaction::TRANSACTIONTYPE)94->setDescription(pht('Date when the countdown ends.'))95->setConduitDescription(pht('Change the end date of the countdown.'))96->setConduitTypeDescription(pht('New countdown end date.'))97->setValue($epoch_value),98id(new PhabricatorRemarkupEditField())99->setKey('description')100->setLabel(pht('Description'))101->setTransactionType(102PhabricatorCountdownDescriptionTransaction::TRANSACTIONTYPE)103->setDescription(pht('Description of the countdown.'))104->setConduitDescription(pht('Change the countdown description.'))105->setConduitTypeDescription(pht('New description.'))106->setValue($object->getDescription()),107);108}109110}111112113