Changeset View
Changeset View
Standalone View
Standalone View
src/applications/settings/setting/PhabricatorSelectSetting.php
| Show All 11 Lines | final protected function newCustomEditField($object) { | ||||
| $options = $this->getSelectOptions(); | $options = $this->getSelectOptions(); | ||||
| if (isset($options[$default_value])) { | if (isset($options[$default_value])) { | ||||
| $default_label = pht('Default (%s)', $options[$default_value]); | $default_label = pht('Default (%s)', $options[$default_value]); | ||||
| } else { | } else { | ||||
| $default_label = pht('Default (Unknown, "%s")', $default_value); | $default_label = pht('Default (Unknown, "%s")', $default_value); | ||||
| } | } | ||||
| if (empty($options[''])) { | |||||
| $options = array( | $options = array( | ||||
| '' => $default_label, | '' => $default_label, | ||||
| ) + $options; | ) + $options; | ||||
| } | |||||
| return $this->newEditField($object, new PhabricatorSelectEditField()) | return $this->newEditField($object, new PhabricatorSelectEditField()) | ||||
| ->setOptions($options); | ->setOptions($options); | ||||
| } | } | ||||
| final public function validateTransactionValue($value) { | final public function validateTransactionValue($value) { | ||||
| if (!strlen($value)) { | if (!strlen($value)) { | ||||
| return; | return; | ||||
| Show All 25 Lines | |||||