Differential D14508 Diff 35176 src/applications/transactions/storage/PhabricatorEditEngineConfiguration.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/storage/PhabricatorEditEngineConfiguration.php
| Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | public function applyConfigurationToFields( | ||||
| $fields = $this->reorderFields($fields); | $fields = $this->reorderFields($fields); | ||||
| $preamble = $this->getPreamble(); | $preamble = $this->getPreamble(); | ||||
| if (strlen($preamble)) { | if (strlen($preamble)) { | ||||
| $fields = array( | $fields = array( | ||||
| 'config.preamble' => id(new PhabricatorInstructionsEditField()) | 'config.preamble' => id(new PhabricatorInstructionsEditField()) | ||||
| ->setKey('config.preamble') | ->setKey('config.preamble') | ||||
| ->setIsReorderable(false) | ->setIsReorderable(false) | ||||
| ->setIsDefaultable(false) | |||||
| ->setValue($preamble), | ->setValue($preamble), | ||||
| ) + $fields; | ) + $fields; | ||||
| } | } | ||||
| return $fields; | return $fields; | ||||
| } | } | ||||
| private function reorderFields(array $fields) { | private function reorderFields(array $fields) { | ||||
| ▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | final class PhabricatorEditEngineConfiguration | ||||
| public function setFieldOrder(array $field_order) { | public function setFieldOrder(array $field_order) { | ||||
| return $this->setProperty('order', $field_order); | return $this->setProperty('order', $field_order); | ||||
| } | } | ||||
| public function getFieldOrder() { | public function getFieldOrder() { | ||||
| return $this->getProperty('order', array()); | return $this->getProperty('order', array()); | ||||
| } | } | ||||
| public function getFieldDefault($key) { | |||||
| $defaults = $this->getProperty('defaults', array()); | |||||
| return idx($defaults, $key); | |||||
| } | |||||
| public function setFieldDefault($key, $value) { | |||||
| $defaults = $this->getProperty('defaults', array()); | |||||
| $defaults[$key] = $value; | |||||
| return $this->setProperty('defaults', $defaults); | |||||
| } | |||||
| /* -( PhabricatorPolicyInterface )----------------------------------------- */ | /* -( PhabricatorPolicyInterface )----------------------------------------- */ | ||||
| public function getCapabilities() { | public function getCapabilities() { | ||||
| return array( | return array( | ||||
| PhabricatorPolicyCapability::CAN_VIEW, | PhabricatorPolicyCapability::CAN_VIEW, | ||||
| PhabricatorPolicyCapability::CAN_EDIT, | PhabricatorPolicyCapability::CAN_EDIT, | ||||
| ▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines | |||||