@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at upstream/main 96 lines 2.5 kB view raw
1<?php 2 3final class PhabricatorPackagesPublisherEditEngine 4 extends PhabricatorPackagesEditEngine { 5 6 const ENGINECONST = 'packages.publisher'; 7 8 public function getEngineName() { 9 return pht('Package Publishers'); 10 } 11 12 public function getSummaryHeader() { 13 return pht('Edit Package Publisher Configurations'); 14 } 15 16 public function getSummaryText() { 17 return pht('This engine is used to edit Packages publishers.'); 18 } 19 20 protected function newEditableObject() { 21 $viewer = $this->getViewer(); 22 return PhabricatorPackagesPublisher::initializeNewPublisher($viewer); 23 } 24 25 protected function newObjectQuery() { 26 return new PhabricatorPackagesPublisherQuery(); 27 } 28 29 protected function getObjectCreateTitleText($object) { 30 return pht('Create Publisher'); 31 } 32 33 protected function getObjectCreateButtonText($object) { 34 return pht('Create Publisher'); 35 } 36 37 protected function getObjectEditTitleText($object) { 38 return pht('Edit Publisher: %s', $object->getName()); 39 } 40 41 protected function getObjectEditShortText($object) { 42 return pht('Edit Publisher'); 43 } 44 45 protected function getObjectCreateShortText() { 46 return pht('Create Publisher'); 47 } 48 49 protected function getObjectName() { 50 return pht('Publisher'); 51 } 52 53 protected function getEditorURI() { 54 return '/packages/publisher/edit/'; 55 } 56 57 protected function getObjectCreateCancelURI($object) { 58 return '/packages/publisher/'; 59 } 60 61 protected function getObjectViewURI($object) { 62 return $object->getURI(); 63 } 64 65 protected function getCreateNewObjectPolicy() { 66 return $this->getApplication()->getPolicy( 67 PhabricatorPackagesCreatePublisherCapability::CAPABILITY); 68 } 69 70 protected function buildCustomEditFields($object) { 71 $fields = array(); 72 73 $fields[] = id(new PhabricatorTextEditField()) 74 ->setKey('name') 75 ->setLabel(pht('Name')) 76 ->setDescription(pht('Name of the publisher.')) 77 ->setTransactionType( 78 PhabricatorPackagesPublisherNameTransaction::TRANSACTIONTYPE) 79 ->setIsRequired(true) 80 ->setValue($object->getName()); 81 82 if ($this->getIsCreate()) { 83 $fields[] = id(new PhabricatorTextEditField()) 84 ->setKey('publisherKey') 85 ->setLabel(pht('Publisher Key')) 86 ->setDescription(pht('Unique key to identify the publisher.')) 87 ->setTransactionType( 88 PhabricatorPackagesPublisherKeyTransaction::TRANSACTIONTYPE) 89 ->setIsRequired(true) 90 ->setValue($object->getPublisherKey()); 91 } 92 93 return $fields; 94 } 95 96}