Differential D15008 Diff 36257 src/applications/project/controller/PhabricatorProjectEditPictureController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/controller/PhabricatorProjectEditPictureController.php
Show All 15 Lines | $project = id(new PhabricatorProjectQuery()) | ||||
PhabricatorPolicyCapability::CAN_VIEW, | PhabricatorPolicyCapability::CAN_VIEW, | ||||
PhabricatorPolicyCapability::CAN_EDIT, | PhabricatorPolicyCapability::CAN_EDIT, | ||||
)) | )) | ||||
->executeOne(); | ->executeOne(); | ||||
if (!$project) { | if (!$project) { | ||||
return new Aphront404Response(); | return new Aphront404Response(); | ||||
} | } | ||||
$this->setProject($project); | |||||
$edit_uri = $this->getApplicationURI('profile/'.$project->getID().'/'); | $edit_uri = $this->getApplicationURI('profile/'.$project->getID().'/'); | ||||
$view_uri = $this->getApplicationURI('profile/'.$project->getID().'/'); | $view_uri = $this->getApplicationURI('profile/'.$project->getID().'/'); | ||||
$supported_formats = PhabricatorFile::getTransformableImageFormats(); | $supported_formats = PhabricatorFile::getTransformableImageFormats(); | ||||
$e_file = true; | $e_file = true; | ||||
$errors = array(); | $errors = array(); | ||||
if ($request->isFormPost()) { | if ($request->isFormPost()) { | ||||
▲ Show 20 Lines • Show All 243 Lines • ▼ Show 20 Lines | $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()) | ||||
->setHeaderText(pht('Upload New Picture')) | ->setHeaderText(pht('Upload New Picture')) | ||||
->setForm($upload_form); | ->setForm($upload_form); | ||||
$nav = $this->buildIconNavView($project); | $nav = $this->getProfileMenu(); | ||||
$nav->selectFilter(PhabricatorProject::PANEL_PROFILE); | $nav->selectFilter(PhabricatorProject::PANEL_PROFILE); | ||||
$nav->appendChild($form_box); | |||||
$nav->appendChild($upload_box); | |||||
return $this->buildApplicationPage( | return $this->newPage() | ||||
$nav, | ->setTitle($title) | ||||
->setNavigation($nav) | |||||
->appendChild( | |||||
array( | array( | ||||
'title' => $title, | $form_box, | ||||
$upload_box, | |||||
)); | )); | ||||
} | } | ||||
} | } |