Differential D14699 Diff 35551 src/applications/transactions/view/PhabricatorApplicationEditHTTPParameterHelpView.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/view/PhabricatorApplicationEditHTTPParameterHelpView.php
| Show First 20 Lines • Show All 170 Lines • ▼ Show 20 Lines | $alias_table = id(new AphrontTableView($rows)) | ||||
| )) | )) | ||||
| ->setColumnClasses( | ->setColumnClasses( | ||||
| array( | array( | ||||
| 'pri', | 'pri', | ||||
| null, | null, | ||||
| 'wide', | 'wide', | ||||
| )); | )); | ||||
| $template_text = pht(<<<EOTEXT | |||||
| Template Objects | |||||
| ---------------- | |||||
| Instead of specifying each field value individually, you can specify another | |||||
| object to use as a template. Some of the initial fields will be copied from the | |||||
| template object. | |||||
| Specify a template object with the `template` parameter. You can use an ID, | |||||
| PHID, or monogram (for objects which have monograms). For example, you might | |||||
| use URIs like these: | |||||
| ``` | |||||
| %s?template=123 | |||||
| %s?template=PHID-WXYZ-abcdef... | |||||
| %s?template=T123 | |||||
| ``` | |||||
| You can combine the `template` parameter with HTTP parameters: the template | |||||
| object will be copied first, then any HTTP parameters will be read. | |||||
| When using `template`, these fields will be copied: | |||||
| EOTEXT | |||||
| , | |||||
| $uri, | |||||
| $uri, | |||||
| $uri); | |||||
| $yes = id(new PHUIIconView())->setIconFont('fa-check-circle green'); | |||||
| $no = id(new PHUIIconView())->setIconFont('fa-times grey'); | |||||
| $rows = array(); | |||||
| foreach ($fields as $field) { | |||||
| $rows[] = array( | |||||
| $field->getLabel(), | |||||
| $field->getIsCopyable() ? $yes : $no, | |||||
| ); | |||||
| } | |||||
| $template_table = id(new AphrontTableView($rows)) | |||||
| ->setNoDataString( | |||||
| pht('None of the fields on this object support templating.')) | |||||
| ->setHeaders( | |||||
| array( | |||||
| pht('Field'), | |||||
| pht('Will Copy'), | |||||
| )) | |||||
| ->setColumnClasses( | |||||
| array( | |||||
| 'pri', | |||||
| 'wide', | |||||
| )); | |||||
| $select_text = pht(<<<EOTEXT | $select_text = pht(<<<EOTEXT | ||||
| Select Fields | Select Fields | ||||
| ------------- | ------------- | ||||
| Some fields support selection from a specific set of values. When prefilling | Some fields support selection from a specific set of values. When prefilling | ||||
| these fields, use the value in the **Value** column to select the appropriate | these fields, use the value in the **Value** column to select the appropriate | ||||
| setting. | setting. | ||||
| ▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | EOTEXT | ||||
| $types_table = id(new PhabricatorHTTPParameterTypeTableView()) | $types_table = id(new PhabricatorHTTPParameterTypeTableView()) | ||||
| ->setHTTPParameterTypes($types); | ->setHTTPParameterTypes($types); | ||||
| return array( | return array( | ||||
| $this->renderInstructions($intro), | $this->renderInstructions($intro), | ||||
| $main_table, | $main_table, | ||||
| $this->renderInstructions($aliases_text), | $this->renderInstructions($aliases_text), | ||||
| $alias_table, | $alias_table, | ||||
| $this->renderInstructions($template_text), | |||||
| $template_table, | |||||
| $this->renderInstructions($select_text), | $this->renderInstructions($select_text), | ||||
| $select_table, | $select_table, | ||||
| $this->renderInstructions($types_text), | $this->renderInstructions($types_text), | ||||
| $types_table, | $types_table, | ||||
| ); | ); | ||||
| } | } | ||||
| protected function renderInstructions($corpus) { | protected function renderInstructions($corpus) { | ||||
| $viewer = $this->getUser(); | $viewer = $this->getUser(); | ||||
| return new PHUIRemarkupView($viewer, $corpus); | return new PHUIRemarkupView($viewer, $corpus); | ||||
| } | } | ||||
| } | } | ||||