@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<?php
2
3final class HarbormasterBuildableEditEngine
4 extends PhabricatorEditEngine {
5
6 const ENGINECONST = 'harbormaster.buildable';
7
8 public function isEngineConfigurable() {
9 return false;
10 }
11
12 public function getEngineName() {
13 return pht('Harbormaster Buildables');
14 }
15
16 public function getSummaryHeader() {
17 return pht('Edit Harbormaster Buildable Configurations');
18 }
19
20 public function getSummaryText() {
21 return pht('This engine is used to edit Harbormaster buildables.');
22 }
23
24 public function getEngineApplicationClass() {
25 return PhabricatorHarbormasterApplication::class;
26 }
27
28 protected function newEditableObject() {
29 $viewer = $this->getViewer();
30 return HarbormasterBuildable::initializeNewBuildable($viewer);
31 }
32
33 protected function newObjectQuery() {
34 return new HarbormasterBuildableQuery();
35 }
36
37 protected function newEditableObjectForDocumentation() {
38 $object = new DifferentialRevision();
39
40 return $this->newEditableObject()
41 ->attachBuildableObject($object);
42 }
43
44 protected function getObjectCreateTitleText($object) {
45 return pht('Create Buildable');
46 }
47
48 protected function getObjectCreateButtonText($object) {
49 return pht('Create Buildable');
50 }
51
52 protected function getObjectEditTitleText($object) {
53 return pht('Edit Buildable: %s', $object->getName());
54 }
55
56 protected function getObjectEditShortText($object) {
57 return pht('Edit Buildable');
58 }
59
60 protected function getObjectCreateShortText() {
61 return pht('Create Buildable');
62 }
63
64 protected function getObjectName() {
65 return pht('Buildable');
66 }
67
68 protected function getEditorURI() {
69 return '/harbormaster/buildable/edit/';
70 }
71
72 protected function getObjectCreateCancelURI($object) {
73 return '/harbormaster/';
74 }
75
76 protected function getObjectViewURI($object) {
77 return $object->getURI();
78 }
79
80 protected function buildCustomEditFields($object) {
81 return array();
82 }
83
84}