Path: blob/master/src/applications/almanac/editor/AlmanacPropertyEditEngine.php
12256 views
<?php12abstract class AlmanacPropertyEditEngine3extends PhabricatorEditEngine {45private $propertyKey;67public function setPropertyKey($property_key) {8$this->propertyKey = $property_key;9return $this;10}1112public function getPropertyKey() {13return $this->propertyKey;14}1516public function isEngineConfigurable() {17return false;18}1920public function isEngineExtensible() {21return false;22}2324public function getEngineName() {25return pht('Almanac Properties');26}2728public function getSummaryHeader() {29return pht('Edit Almanac Property Configurations');30}3132public function getSummaryText() {33return pht('This engine is used to edit Almanac properties.');34}3536public function getEngineApplicationClass() {37return 'PhabricatorAlmanacApplication';38}3940protected function newEditableObject() {41throw new PhutilMethodNotImplementedException();42}4344protected function getObjectCreateTitleText($object) {45return pht('Create Property');46}4748protected function getObjectCreateButtonText($object) {49return pht('Create Property');50}5152protected function getObjectEditTitleText($object) {53return pht('Edit Property: %s', $object->getName());54}5556protected function getObjectEditShortText($object) {57return pht('Edit Property');58}5960protected function getObjectCreateShortText() {61return pht('Create Property');62}6364protected function buildCustomEditFields($object) {65$property_key = $this->getPropertyKey();66$xaction_type = $object->getAlmanacPropertySetTransactionType();6768$specs = $object->getAlmanacPropertyFieldSpecifications();69if (isset($specs[$property_key])) {70$field_template = clone $specs[$property_key];71} else {72$field_template = new PhabricatorTextEditField();73}7475return array(76$field_template77->setKey('value')78->setMetadataValue('almanac.property', $property_key)79->setLabel($property_key)80->setTransactionType($xaction_type)81->setValue($object->getAlmanacPropertyValue($property_key)),82);83}8485}868788