Differential D20154 Diff 48161 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 120 Lines • ▼ Show 20 Lines | if (isset($sources[$class])) { | ||||
break; | break; | ||||
} | } | ||||
$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())) | ||||
->setQueryParam('offset', $offset + $limit) | ->replaceQueryParam('offset', $offset + $limit) | ||||
->setQueryParam('q', $query) | ->replaceQueryParam('q', $query) | ||||
->setQueryParam('raw', $raw_query) | ->replaceQueryParam('raw', $raw_query) | ||||
->setQueryParam('format', 'html'); | ->replaceQueryParam('format', 'html'); | ||||
$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 102 Lines • ▼ Show 20 Lines | if (isset($sources[$class])) { | ||||
$function_help = null; | $function_help = null; | ||||
if ($source->getAllDatasourceFunctions()) { | if ($source->getAllDatasourceFunctions()) { | ||||
$reference_uri = '/typeahead/help/'.get_class($source).'/'; | $reference_uri = '/typeahead/help/'.get_class($source).'/'; | ||||
$parameters = $source->getParameters(); | $parameters = $source->getParameters(); | ||||
if ($parameters) { | if ($parameters) { | ||||
$reference_uri = (string)id(new PhutilURI($reference_uri)) | $reference_uri = (string)id(new PhutilURI($reference_uri)) | ||||
->setQueryParam('parameters', phutil_json_encode($parameters)); | ->replaceQueryParam( | ||||
'parameters', | |||||
phutil_json_encode($parameters)); | |||||
} | } | ||||
$reference_link = phutil_tag( | $reference_link = phutil_tag( | ||||
'a', | 'a', | ||||
array( | array( | ||||
'href' => $reference_uri, | 'href' => $reference_uri, | ||||
'target' => '_blank', | 'target' => '_blank', | ||||
), | ), | ||||
▲ Show 20 Lines • Show All 194 Lines • Show Last 20 Lines |