Differential D7751 Diff 17565 src/applications/phragment/controller/PhragmentSnapshotCreateController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phragment/controller/PhragmentSnapshotCreateController.php
Show All 15 Lines | public function processRequest() { | ||||
if ($parents === null) { | if ($parents === null) { | ||||
return new Aphront404Response(); | return new Aphront404Response(); | ||||
} | } | ||||
$fragment = nonempty(last($parents), null); | $fragment = nonempty(last($parents), null); | ||||
if ($fragment === null) { | if ($fragment === null) { | ||||
return new Aphront404Response(); | return new Aphront404Response(); | ||||
} | } | ||||
PhabricatorPolicyFilter::requireCapability( | |||||
$viewer, | |||||
$fragment, | |||||
PhabricatorPolicyCapability::CAN_EDIT); | |||||
$children = id(new PhragmentFragmentQuery()) | $children = id(new PhragmentFragmentQuery()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->needLatestVersion(true) | ->needLatestVersion(true) | ||||
->withLeadingPath($fragment->getPath().'/') | ->withLeadingPath($fragment->getPath().'/') | ||||
->execute(); | ->execute(); | ||||
$error_view = null; | $error_view = null; | ||||
▲ Show 20 Lines • Show All 124 Lines • ▼ Show 20 Lines | public function processRequest() { | ||||
$box = id(new PHUIObjectBoxView()) | $box = id(new PHUIObjectBoxView()) | ||||
->setHeaderText(pht('Create Snapshot of %s', $fragment->getName())) | ->setHeaderText(pht('Create Snapshot of %s', $fragment->getName())) | ||||
->setFormError($error_view) | ->setFormError($error_view) | ||||
->setForm($form); | ->setForm($form); | ||||
return $this->buildApplicationPage( | return $this->buildApplicationPage( | ||||
array( | array( | ||||
$crumbs, | $crumbs, | ||||
$this->renderConfigurationWarningIfRequired(), | |||||
$box), | $box), | ||||
array( | array( | ||||
'title' => pht('Create Fragment'), | 'title' => pht('Create Fragment'), | ||||
'device' => true)); | 'device' => true)); | ||||
} | } | ||||
} | } |