X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fapi%2FApiQueryPrefixSearch.php;h=3bf6d3fe4b689689fba40279b8048d490e6ce72a;hp=46538e0eb1a5653c8c01250cc319d7564e613e96;hb=e758226c91935a1df2b6fd3ed1f18922d8bfb45b;hpb=ea41b271ee13ceb0df0e17e51a33420c094d2147 diff --git a/includes/api/ApiQueryPrefixSearch.php b/includes/api/ApiQueryPrefixSearch.php index 46538e0eb1..3bf6d3fe4b 100644 --- a/includes/api/ApiQueryPrefixSearch.php +++ b/includes/api/ApiQueryPrefixSearch.php @@ -1,5 +1,4 @@ allowedParams !== null ) { return $this->allowedParams; } - $this->allowedParams = [ - 'search' => [ - ApiBase::PARAM_TYPE => 'string', - ApiBase::PARAM_REQUIRED => true, - ], - 'namespace' => [ - ApiBase::PARAM_DFLT => NS_MAIN, - ApiBase::PARAM_TYPE => 'namespace', - ApiBase::PARAM_ISMULTI => true, - ], - 'limit' => [ - ApiBase::PARAM_DFLT => 10, - ApiBase::PARAM_TYPE => 'limit', - ApiBase::PARAM_MIN => 1, - // Non-standard value for compatibility with action=opensearch - ApiBase::PARAM_MAX => 100, - ApiBase::PARAM_MAX2 => 200, - ], - 'offset' => [ - ApiBase::PARAM_DFLT => 0, - ApiBase::PARAM_TYPE => 'integer', - ], - ]; - $profileParam = $this->buildProfileApiParam( SearchEngine::COMPLETION_PROFILE_TYPE, - 'apihelp-query+prefixsearch-param-profile' ); - if ( $profileParam ) { - $this->allowedParams['profile'] = $profileParam; - } + $this->allowedParams = $this->buildCommonApiParams(); + return $this->allowedParams; } public function getSearchProfileParams() { - if ( isset( $this->getAllowedParams()['profile'] ) ) { - return [ SearchEngine::COMPLETION_PROFILE_TYPE => 'profile' ]; - } - return []; + return [ + 'profile' => [ + 'profile-type' => SearchEngine::COMPLETION_PROFILE_TYPE, + 'help-message' => 'apihelp-query+prefixsearch-param-profile', + ], + ]; } protected function getExamplesMessages() {