Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php
| Show First 20 Lines • Show All 138 Lines • ▼ Show 20 Lines | $table = id(new AphrontTableView($rows)) | ||||
| 'pri wide', | 'pri wide', | ||||
| null, | null, | ||||
| )); | )); | ||||
| return id(new PHUIObjectBoxView()) | return id(new PHUIObjectBoxView()) | ||||
| ->setHeaderText(pht('Builtin and Saved Queries')) | ->setHeaderText(pht('Builtin and Saved Queries')) | ||||
| ->setCollapsed(true) | ->setCollapsed(true) | ||||
| ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ||||
| ->appendChild($this->buildRemarkup($info)) | ->appendChild($this->newRemarkupDocumentationView($info)) | ||||
| ->appendChild($table); | ->appendChild($table); | ||||
| } | } | ||||
| private function buildConstraintsBox( | private function buildConstraintsBox( | ||||
| PhabricatorApplicationSearchEngine $engine) { | PhabricatorApplicationSearchEngine $engine) { | ||||
| $info = pht(<<<EOTEXT | $info = pht(<<<EOTEXT | ||||
| You can apply custom constraints by passing a dictionary in `constraints`. | You can apply custom constraints by passing a dictionary in `constraints`. | ||||
| ▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | foreach ($fields as $field) { | ||||
| $rows[] = array( | $rows[] = array( | ||||
| $key, | $key, | ||||
| $label, | $label, | ||||
| $type, | $type, | ||||
| $description, | $description, | ||||
| ); | ); | ||||
| if ($constants) { | if ($constants) { | ||||
| $constant_lists[] = $this->buildRemarkup( | $constant_lists[] = $this->newRemarkupDocumentationView( | ||||
| pht( | pht( | ||||
| 'Constants supported by the `%s` constraint:', | 'Constants supported by the `%s` constraint:', | ||||
| 'statuses')); | 'statuses')); | ||||
| $constants_rows = array(); | $constants_rows = array(); | ||||
| foreach ($constants as $constant) { | foreach ($constants as $constant) { | ||||
| if ($constant->getIsDeprecated()) { | if ($constant->getIsDeprecated()) { | ||||
| $icon = id(new PHUIIconView()) | $icon = id(new PHUIIconView()) | ||||
| ▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | $table = id(new AphrontTableView($rows)) | ||||
| 'prewrap', | 'prewrap', | ||||
| 'wide', | 'wide', | ||||
| )); | )); | ||||
| return id(new PHUIObjectBoxView()) | return id(new PHUIObjectBoxView()) | ||||
| ->setHeaderText(pht('Custom Query Constraints')) | ->setHeaderText(pht('Custom Query Constraints')) | ||||
| ->setCollapsed(true) | ->setCollapsed(true) | ||||
| ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ||||
| ->appendChild($this->buildRemarkup($info)) | ->appendChild($this->newRemarkupDocumentationView($info)) | ||||
| ->appendChild($table) | ->appendChild($table) | ||||
| ->appendChild($constant_lists); | ->appendChild($constant_lists); | ||||
| } | } | ||||
| private function buildOrderBox( | private function buildOrderBox( | ||||
| PhabricatorApplicationSearchEngine $engine, | PhabricatorApplicationSearchEngine $engine, | ||||
| $query) { | $query) { | ||||
| ▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | $columns_table = id(new AphrontTableView($rows)) | ||||
| 'wide', | 'wide', | ||||
| )); | )); | ||||
| return id(new PHUIObjectBoxView()) | return id(new PHUIObjectBoxView()) | ||||
| ->setHeaderText(pht('Result Ordering')) | ->setHeaderText(pht('Result Ordering')) | ||||
| ->setCollapsed(true) | ->setCollapsed(true) | ||||
| ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ||||
| ->appendChild($this->buildRemarkup($orders_info)) | ->appendChild($this->newRemarkupDocumentationView($orders_info)) | ||||
| ->appendChild($orders_table) | ->appendChild($orders_table) | ||||
| ->appendChild($this->buildRemarkup($columns_info)) | ->appendChild($this->newRemarkupDocumentationView($columns_info)) | ||||
| ->appendChild($columns_table); | ->appendChild($columns_table); | ||||
| } | } | ||||
| private function buildFieldsBox( | private function buildFieldsBox( | ||||
| PhabricatorApplicationSearchEngine $engine) { | PhabricatorApplicationSearchEngine $engine) { | ||||
| $info = pht(<<<EOTEXT | $info = pht(<<<EOTEXT | ||||
| Objects matching your query are returned as a list of dictionaries in the | Objects matching your query are returned as a list of dictionaries in the | ||||
| ▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | $table = id(new AphrontTableView($rows)) | ||||
| 'mono', | 'mono', | ||||
| 'wide', | 'wide', | ||||
| )); | )); | ||||
| return id(new PHUIObjectBoxView()) | return id(new PHUIObjectBoxView()) | ||||
| ->setHeaderText(pht('Object Fields')) | ->setHeaderText(pht('Object Fields')) | ||||
| ->setCollapsed(true) | ->setCollapsed(true) | ||||
| ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ||||
| ->appendChild($this->buildRemarkup($info)) | ->appendChild($this->newRemarkupDocumentationView($info)) | ||||
| ->appendChild($table); | ->appendChild($table); | ||||
| } | } | ||||
| private function buildAttachmentsBox( | private function buildAttachmentsBox( | ||||
| PhabricatorApplicationSearchEngine $engine) { | PhabricatorApplicationSearchEngine $engine) { | ||||
| $info = pht(<<<EOTEXT | $info = pht(<<<EOTEXT | ||||
| By default, only basic information about objects is returned. If you want | By default, only basic information about objects is returned. If you want | ||||
| ▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | $table = id(new AphrontTableView($rows)) | ||||
| 'pri', | 'pri', | ||||
| 'wide', | 'wide', | ||||
| )); | )); | ||||
| return id(new PHUIObjectBoxView()) | return id(new PHUIObjectBoxView()) | ||||
| ->setHeaderText(pht('Attachments')) | ->setHeaderText(pht('Attachments')) | ||||
| ->setCollapsed(true) | ->setCollapsed(true) | ||||
| ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ||||
| ->appendChild($this->buildRemarkup($info)) | ->appendChild($this->newRemarkupDocumentationView($info)) | ||||
| ->appendChild($table); | ->appendChild($table); | ||||
| } | } | ||||
| private function buildPagingBox( | private function buildPagingBox( | ||||
| PhabricatorApplicationSearchEngine $engine) { | PhabricatorApplicationSearchEngine $engine) { | ||||
| $info = pht(<<<EOTEXT | $info = pht(<<<EOTEXT | ||||
| Queries are limited to returning 100 results at a time. If you want fewer | Queries are limited to returning 100 results at a time. If you want fewer | ||||
| ▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | |||||
| if `before` is `null`, there are no previous results available. | if `before` is `null`, there are no previous results available. | ||||
| EOTEXT | EOTEXT | ||||
| ); | ); | ||||
| return id(new PHUIObjectBoxView()) | return id(new PHUIObjectBoxView()) | ||||
| ->setHeaderText(pht('Paging and Limits')) | ->setHeaderText(pht('Paging and Limits')) | ||||
| ->setCollapsed(true) | ->setCollapsed(true) | ||||
| ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ||||
| ->appendChild($this->buildRemarkup($info)); | ->appendChild($this->newRemarkupDocumentationView($info)); | ||||
| } | } | ||||
| private function buildRemarkup($remarkup) { | |||||
| $viewer = $this->getViewer(); | |||||
| $view = new PHUIRemarkupView($viewer, $remarkup); | |||||
| $view->setRemarkupOptions( | |||||
| array( | |||||
| PHUIRemarkupView::OPTION_PRESERVE_LINEBREAKS => false, | |||||
| )); | |||||
| return id(new PHUIBoxView()) | |||||
| ->appendChild($view) | |||||
| ->addPadding(PHUI::PADDING_LARGE); | |||||
| } | |||||
| } | } | ||||