Differential D17967 Diff 43215 src/applications/project/controller/PhabricatorProjectEditPictureController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/controller/PhabricatorProjectEditPictureController.php
Show All 17 Lines | $project = id(new PhabricatorProjectQuery()) | ||||
)) | )) | ||||
->executeOne(); | ->executeOne(); | ||||
if (!$project) { | if (!$project) { | ||||
return new Aphront404Response(); | return new Aphront404Response(); | ||||
} | } | ||||
$this->setProject($project); | $this->setProject($project); | ||||
$edit_uri = $this->getApplicationURI('profile/'.$project->getID().'/'); | $manage_uri = $this->getApplicationURI('manage/'.$project->getID().'/'); | ||||
$view_uri = $this->getApplicationURI('profile/'.$project->getID().'/'); | |||||
amckinley: I guess this variable was unused? | |||||
$supported_formats = PhabricatorFile::getTransformableImageFormats(); | $supported_formats = PhabricatorFile::getTransformableImageFormats(); | ||||
$e_file = true; | $e_file = true; | ||||
$errors = array(); | $errors = array(); | ||||
if ($request->isFormPost()) { | if ($request->isFormPost()) { | ||||
$phid = $request->getStr('phid'); | $phid = $request->getStr('phid'); | ||||
$is_default = false; | $is_default = false; | ||||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | if ($request->isFormPost()) { | ||||
$editor = id(new PhabricatorProjectTransactionEditor()) | $editor = id(new PhabricatorProjectTransactionEditor()) | ||||
->setActor($viewer) | ->setActor($viewer) | ||||
->setContentSourceFromRequest($request) | ->setContentSourceFromRequest($request) | ||||
->setContinueOnMissingFields(true) | ->setContinueOnMissingFields(true) | ||||
->setContinueOnNoEffect(true); | ->setContinueOnNoEffect(true); | ||||
$editor->applyTransactions($project, $xactions); | $editor->applyTransactions($project, $xactions); | ||||
return id(new AphrontRedirectResponse())->setURI($edit_uri); | return id(new AphrontRedirectResponse())->setURI($manage_uri); | ||||
} | } | ||||
} | } | ||||
$title = pht('Edit Project Picture'); | $title = pht('Edit Project Picture'); | ||||
$form = id(new PHUIFormLayoutView()) | $form = id(new PHUIFormLayoutView()) | ||||
->setUser($viewer); | ->setUser($viewer); | ||||
▲ Show 20 Lines • Show All 136 Lines • ▼ Show 20 Lines | $upload_form = id(new AphrontFormView()) | ||||
id(new AphrontFormFileControl()) | id(new AphrontFormFileControl()) | ||||
->setName('picture') | ->setName('picture') | ||||
->setLabel(pht('Upload Picture')) | ->setLabel(pht('Upload Picture')) | ||||
->setError($e_file) | ->setError($e_file) | ||||
->setCaption( | ->setCaption( | ||||
pht('Supported formats: %s', implode(', ', $supported_formats)))) | pht('Supported formats: %s', implode(', ', $supported_formats)))) | ||||
->appendChild( | ->appendChild( | ||||
id(new AphrontFormSubmitControl()) | id(new AphrontFormSubmitControl()) | ||||
->addCancelButton($edit_uri) | ->addCancelButton($manage_uri) | ||||
->setValue(pht('Upload Picture'))); | ->setValue(pht('Upload Picture'))); | ||||
$form_box = id(new PHUIObjectBoxView()) | $form_box = id(new PHUIObjectBoxView()) | ||||
->setHeaderText($title) | ->setHeaderText($title) | ||||
->setFormErrors($errors) | ->setFormErrors($errors) | ||||
->setForm($form); | ->setForm($form); | ||||
$upload_box = id(new PHUIObjectBoxView()) | $upload_box = id(new PHUIObjectBoxView()) | ||||
▲ Show 20 Lines • Show All 81 Lines • Show Last 20 Lines |
I guess this variable was unused?