Changeset View
Changeset View
Standalone View
Standalone View
src/applications/almanac/editor/AlmanacPropertyEditEngine.php
| Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | abstract class AlmanacPropertyEditEngine | ||||
| protected function getObjectCreateShortText() { | protected function getObjectCreateShortText() { | ||||
| return pht('Create Property'); | return pht('Create Property'); | ||||
| } | } | ||||
| protected function buildCustomEditFields($object) { | protected function buildCustomEditFields($object) { | ||||
| $property_key = $this->getPropertyKey(); | $property_key = $this->getPropertyKey(); | ||||
| $xaction_type = $object->getAlmanacPropertySetTransactionType(); | $xaction_type = $object->getAlmanacPropertySetTransactionType(); | ||||
| $specs = $object->getAlmanacPropertyFieldSpecifications(); | |||||
| if (isset($specs[$property_key])) { | |||||
| $field_template = clone $specs[$property_key]; | |||||
| } else { | |||||
| $field_template = new PhabricatorTextEditField(); | |||||
| } | |||||
| return array( | return array( | ||||
| id(new PhabricatorTextEditField()) | $field_template | ||||
| ->setKey('value') | ->setKey('value') | ||||
| ->setMetadataValue('almanac.property', $property_key) | ->setMetadataValue('almanac.property', $property_key) | ||||
| ->setLabel($property_key) | ->setLabel($property_key) | ||||
| ->setTransactionType($xaction_type) | ->setTransactionType($xaction_type) | ||||
| ->setValue($object->getAlmanacPropertyValue($property_key)), | ->setValue($object->getAlmanacPropertyValue($property_key)), | ||||
| ); | ); | ||||
| } | } | ||||
| } | } | ||||