Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diviner/controller/DivinerBookEditController.php
| Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | public function handleRequest(AphrontRequest $request) { | ||||
| $form = id(new AphrontFormView()) | $form = id(new AphrontFormView()) | ||||
| ->setUser($viewer) | ->setUser($viewer) | ||||
| ->appendControl( | ->appendControl( | ||||
| id(new AphrontFormTokenizerControl()) | id(new AphrontFormTokenizerControl()) | ||||
| ->setDatasource(new PhabricatorProjectDatasource()) | ->setDatasource(new PhabricatorProjectDatasource()) | ||||
| ->setName('projectPHIDs') | ->setName('projectPHIDs') | ||||
| ->setLabel(pht('Projects')) | ->setLabel(pht('Projects')) | ||||
| ->setValue($book->getProjectPHIDs())) | ->setValue($book->getProjectPHIDs())) | ||||
| ->appendControl( | |||||
| id(new AphrontFormTokenizerControl()) | |||||
| ->setDatasource(new DiffusionRepositoryDatasource()) | |||||
| ->setName('repositoryPHIDs') | |||||
| ->setLabel(pht('Repository')) | |||||
| ->setDisableBehavior(true) | |||||
| ->setLimit(1) | |||||
| ->setValue($book->getRepositoryPHID() | |||||
| ? array($book->getRepositoryPHID()) | |||||
| : null)) | |||||
joshuaspence: This seems really gross | |||||
epriestleyUnsubmitted Not Done Inline ActionsYeah, we end up doing this in a fair number of places. It would probably be OK to just let you setValue() a string and convert it into an array (only if the limit is 1?), or maybe add setSingleValue()? We could clean up a few things. epriestley: Yeah, we end up doing this in a fair number of places.
It would probably be OK to just let you… | |||||
| ->appendChild( | ->appendChild( | ||||
| id(new AphrontFormPolicyControl()) | id(new AphrontFormPolicyControl()) | ||||
| ->setName('viewPolicy') | ->setName('viewPolicy') | ||||
| ->setPolicyObject($book) | ->setPolicyObject($book) | ||||
| ->setCapability($view_capability) | ->setCapability($view_capability) | ||||
| ->setPolicies($policies) | ->setPolicies($policies) | ||||
| ->setCaption($book->describeAutomaticCapability($view_capability))) | ->setCaption($book->describeAutomaticCapability($view_capability))) | ||||
| ->appendChild( | ->appendChild( | ||||
| Show All 32 Lines | |||||
This seems really gross