Differential D15487 Diff 37335 src/applications/diffusion/controller/DiffusionRepositorySymbolsController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionRepositorySymbolsController.php
| Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | if ($request->isFormPost()) { | ||||
| $errors[] = $ex->getMessage(); | $errors[] = $ex->getMessage(); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| $crumbs = $this->buildApplicationCrumbs(); | $crumbs = $this->buildApplicationCrumbs(); | ||||
| $crumbs->addTextCrumb(pht('Edit Symbols')); | $crumbs->addTextCrumb(pht('Edit Symbols')); | ||||
| $title = pht('Edit %s', $repository->getName()); | $title = pht('Edit Symbols (%s)', $repository->getName()); | ||||
| $header = id(new PHUIHeaderView()) | |||||
| ->setHeader($title) | |||||
| ->setHeaderIcon('fa-pencil'); | |||||
| $form = id(new AphrontFormView()) | $form = id(new AphrontFormView()) | ||||
| ->setUser($viewer) | ->setUser($viewer) | ||||
| ->appendRemarkupInstructions($this->getInstructions()) | ->appendRemarkupInstructions($this->getInstructions()) | ||||
| ->appendChild( | ->appendChild( | ||||
| id(new AphrontFormTextControl()) | id(new AphrontFormTextControl()) | ||||
| ->setName('languages') | ->setName('languages') | ||||
| ->setLabel(pht('Indexed Languages')) | ->setLabel(pht('Indexed Languages')) | ||||
| Show All 9 Lines | $form = id(new AphrontFormView()) | ||||
| ->setDatasource(new DiffusionRepositoryDatasource()) | ->setDatasource(new DiffusionRepositoryDatasource()) | ||||
| ->setValue($v_sources)) | ->setValue($v_sources)) | ||||
| ->appendChild( | ->appendChild( | ||||
| id(new AphrontFormSubmitControl()) | id(new AphrontFormSubmitControl()) | ||||
| ->setValue(pht('Save')) | ->setValue(pht('Save')) | ||||
| ->addCancelButton($edit_uri)); | ->addCancelButton($edit_uri)); | ||||
| $object_box = id(new PHUIObjectBoxView()) | $form_box = id(new PHUIObjectBoxView()) | ||||
| ->setHeaderText($title) | ->setHeaderText(pht('Symbols')) | ||||
| ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | |||||
| ->setForm($form) | ->setForm($form) | ||||
| ->setFormErrors($errors); | ->setFormErrors($errors); | ||||
| $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($object_box); | ->appendChild($view); | ||||
| } | } | ||||
| private function getInstructions() { | private function getInstructions() { | ||||
| return pht(<<<EOT | return pht(<<<EOT | ||||
| Configure Symbols for this repository. | Configure Symbols for this repository. | ||||
| See [[%s | Symbol Indexes]] for more information on using symbols. | See [[%s | Symbol Indexes]] for more information on using symbols. | ||||
| EOT | EOT | ||||
| , | , | ||||
| PhabricatorEnv::getDoclink( | PhabricatorEnv::getDoclink( | ||||
| 'Diffusion User Guide: Symbol Indexes')); | 'Diffusion User Guide: Symbol Indexes')); | ||||
| } | } | ||||
| } | } | ||||