Differential D15487 Diff 37335 src/applications/diffusion/controller/DiffusionRepositoryEditBranchesController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionRepositoryEditBranchesController.php
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | public function handleRequest(AphrontRequest $request) { | ||||
| } | } | ||||
| $content = array(); | $content = array(); | ||||
| $crumbs = $this->buildApplicationCrumbs(); | $crumbs = $this->buildApplicationCrumbs(); | ||||
| $crumbs->addTextCrumb(pht('Edit Branches')); | $crumbs->addTextCrumb(pht('Edit Branches')); | ||||
| $title = pht('Edit Branches (%s)', $repository->getName()); | $title = pht('Edit Branches (%s)', $repository->getName()); | ||||
| $header = id(new PHUIHeaderView()) | |||||
| ->setHeader($title) | |||||
| ->setHeaderIcon('fa-pencil'); | |||||
| $policies = id(new PhabricatorPolicyQuery()) | $policies = id(new PhabricatorPolicyQuery()) | ||||
| ->setViewer($viewer) | ->setViewer($viewer) | ||||
| ->setObject($repository) | ->setObject($repository) | ||||
| ->execute(); | ->execute(); | ||||
| $rows = array(); | $rows = array(); | ||||
| $rows[] = array( | $rows[] = array( | ||||
| ▲ Show 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | public function handleRequest(AphrontRequest $request) { | ||||
| } | } | ||||
| $form->appendChild( | $form->appendChild( | ||||
| id(new AphrontFormSubmitControl()) | id(new AphrontFormSubmitControl()) | ||||
| ->setValue(pht('Save Branches')) | ->setValue(pht('Save Branches')) | ||||
| ->addCancelButton($edit_uri)); | ->addCancelButton($edit_uri)); | ||||
| $form_box = id(new PHUIObjectBoxView()) | $form_box = id(new PHUIObjectBoxView()) | ||||
| ->setHeaderText(pht('Branches')) | |||||
| ->setValidationException($validation_exception) | ->setValidationException($validation_exception) | ||||
| ->setHeaderText($title) | ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ||||
| ->setForm($form); | ->setForm($form); | ||||
| $view = id(new PHUITwoColumnView()) | |||||
| ->setHeader($header) | |||||
| ->setFooter(array( | |||||
| $form_box, | |||||
| )); | |||||
| return $this->newPage() | return $this->newPage() | ||||
| ->setTitle($title) | ->setTitle($title) | ||||
| ->setCrumbs($crumbs) | ->setCrumbs($crumbs) | ||||
| ->appendChild($form_box); | ->appendChild($view); | ||||
| } | } | ||||
| private function processBranches($string) { | private function processBranches($string) { | ||||
| $lines = phutil_split_lines($string, $retain_endings = false); | $lines = phutil_split_lines($string, $retain_endings = false); | ||||
| foreach ($lines as $key => $line) { | foreach ($lines as $key => $line) { | ||||
| $lines[$key] = trim($line); | $lines[$key] = trim($line); | ||||
| if (!strlen($lines[$key])) { | if (!strlen($lines[$key])) { | ||||
| unset($lines[$key]); | unset($lines[$key]); | ||||
| } | } | ||||
| } | } | ||||
| return array_values($lines); | return array_values($lines); | ||||
| } | } | ||||
| } | } | ||||