Differential D14515 Diff 35178 src/applications/transactions/controller/PhabricatorEditEngineConfigurationLockController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/controller/PhabricatorEditEngineConfigurationLockController.php
| Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | foreach ($fields as $field) { | ||||
| $key = $field->getKey(); | $key = $field->getKey(); | ||||
| $label = $field->getLabel(); | $label = $field->getLabel(); | ||||
| if (!strlen($label)) { | if (!strlen($label)) { | ||||
| $label = $key; | $label = $key; | ||||
| } | } | ||||
| if ($field->getIsHidden()) { | |||||
| $value = $lock_hidden; | |||||
| } else if ($field->getIsLocked()) { | |||||
| $value = $lock_locked; | |||||
| } else { | |||||
| $value = $lock_visible; | |||||
| } | |||||
| $form->appendControl( | $form->appendControl( | ||||
| id(new AphrontFormSelectControl()) | id(new AphrontFormSelectControl()) | ||||
| ->setName('locks['.$key.']') | ->setName('locks['.$key.']') | ||||
| ->setLabel($label) | ->setLabel($label) | ||||
| ->setValue(idx($locks, $key, $lock_visible)) | ->setValue($value) | ||||
| ->setOptions($map)); | ->setOptions($map)); | ||||
| } | } | ||||
| return $this->newDialog() | return $this->newDialog() | ||||
| ->setTitle(pht('Lock / Hide Fields')) | ->setTitle(pht('Lock / Hide Fields')) | ||||
| ->setWidth(AphrontDialogView::WIDTH_FORM) | ->setWidth(AphrontDialogView::WIDTH_FORM) | ||||
| ->appendForm($form) | ->appendForm($form) | ||||
| ->addSubmitButton(pht('Save Changes')) | ->addSubmitButton(pht('Save Changes')) | ||||
| ->addCancelButton($cancel_uri); | ->addCancelButton($cancel_uri); | ||||
| } | } | ||||
| } | } | ||||