Differential D15487 Diff 37335 src/applications/diffusion/controller/DiffusionRepositoryEditEncodingController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionRepositoryEditEncodingController.php
| Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | if ($request->isFormPost()) { | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| $crumbs = $this->buildApplicationCrumbs(); | $crumbs = $this->buildApplicationCrumbs(); | ||||
| $crumbs->addTextCrumb(pht('Edit Encoding')); | $crumbs->addTextCrumb(pht('Edit Encoding')); | ||||
| $title = pht('Edit %s', $repository->getName()); | $title = pht('Edit %s', $repository->getName()); | ||||
| $header = id(new PHUIHeaderView()) | |||||
| ->setHeader($title) | |||||
| ->setHeaderIcon('fa-pencil'); | |||||
| $form = id(new AphrontFormView()) | $form = id(new AphrontFormView()) | ||||
| ->setUser($user) | ->setUser($user) | ||||
| ->appendRemarkupInstructions($this->getEncodingInstructions()) | ->appendRemarkupInstructions($this->getEncodingInstructions()) | ||||
| ->appendChild( | ->appendChild( | ||||
| id(new AphrontFormTextControl()) | id(new AphrontFormTextControl()) | ||||
| ->setName('encoding') | ->setName('encoding') | ||||
| ->setLabel(pht('Text Encoding')) | ->setLabel(pht('Text Encoding')) | ||||
| ->setValue($v_encoding) | ->setValue($v_encoding) | ||||
| ->setError($e_encoding)) | ->setError($e_encoding)) | ||||
| ->appendChild( | ->appendChild( | ||||
| id(new AphrontFormSubmitControl()) | id(new AphrontFormSubmitControl()) | ||||
| ->setValue(pht('Save Encoding')) | ->setValue(pht('Save Encoding')) | ||||
| ->addCancelButton($edit_uri)); | ->addCancelButton($edit_uri)); | ||||
| $object_box = id(new PHUIObjectBoxView()) | $form_box = id(new PHUIObjectBoxView()) | ||||
| ->setHeaderText($title) | ->setHeaderText(pht('Encoding')) | ||||
| ->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 getEncodingInstructions() { | private function getEncodingInstructions() { | ||||
| return pht(<<<EOT | return pht(<<<EOT | ||||
| If source code in this repository uses a character encoding other than UTF-8 | If source code in this repository uses a character encoding other than UTF-8 | ||||
| (for example, `ISO-8859-1`), specify it here. | (for example, `ISO-8859-1`), specify it here. | ||||
| **Normally, you can leave this field blank.** If your source code is written in | **Normally, you can leave this field blank.** If your source code is written in | ||||
| Show All 13 Lines | |||||