Differential D20204 Diff 48243 src/applications/typeahead/controller/PhabricatorTypeaheadModularDatasourceController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/typeahead/controller/PhabricatorTypeaheadModularDatasourceController.php
| Show First 20 Lines • Show All 121 Lines • ▼ Show 20 Lines | if (isset($sources[$class])) { | ||||
| } | } | ||||
| $next_link = null; | $next_link = null; | ||||
| if (count($results) > $limit) { | if (count($results) > $limit) { | ||||
| $results = array_slice($results, 0, $limit, $preserve_keys = true); | $results = array_slice($results, 0, $limit, $preserve_keys = true); | ||||
| if (($offset + (2 * $limit)) < $hard_limit) { | if (($offset + (2 * $limit)) < $hard_limit) { | ||||
| $next_uri = id(new PhutilURI($request->getRequestURI())) | $next_uri = id(new PhutilURI($request->getRequestURI())) | ||||
| ->replaceQueryParam('offset', $offset + $limit) | ->replaceQueryParam('offset', $offset + $limit) | ||||
| ->replaceQueryParam('q', $query) | |||||
| ->replaceQueryParam('raw', $raw_query) | |||||
| ->replaceQueryParam('format', 'html'); | ->replaceQueryParam('format', 'html'); | ||||
| if ($query !== null) { | |||||
| $next_uri->replaceQueryParam('q', $query); | |||||
| } else { | |||||
| $next_uri->removeQueryParam('q'); | |||||
| } | |||||
| if ($raw_query !== null) { | |||||
| $next_uri->replaceQueryParam('raw', $raw_query); | |||||
| } else { | |||||
| $next_uri->removeQueryParam('raw'); | |||||
| } | |||||
| $next_link = javelin_tag( | $next_link = javelin_tag( | ||||
| 'a', | 'a', | ||||
| array( | array( | ||||
| 'href' => $next_uri, | 'href' => $next_uri, | ||||
| 'class' => 'typeahead-browse-more', | 'class' => 'typeahead-browse-more', | ||||
| 'sigil' => 'typeahead-browse-more', | 'sigil' => 'typeahead-browse-more', | ||||
| 'mustcapture' => true, | 'mustcapture' => true, | ||||
| ), | ), | ||||
| ▲ Show 20 Lines • Show All 314 Lines • Show Last 20 Lines | |||||