X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryExtLinksUsage.php;h=e77355b049c5b00c3bf920dbf1745cbfef9fb8f7;hb=239b0c772a3cf4dc2160e2c36c2813cd705adb50;hp=faabb920ebba179666e37f5bba3b2245770e1009;hpb=7050a92013a99135c137f80dd564af10ac1ac7c8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryExtLinksUsage.php b/includes/api/ApiQueryExtLinksUsage.php index faabb920eb..e77355b049 100644 --- a/includes/api/ApiQueryExtLinksUsage.php +++ b/includes/api/ApiQueryExtLinksUsage.php @@ -145,7 +145,7 @@ class ApiQueryExtLinksUsage extends ApiQueryGeneratorBase { } public function getAllowedParams() { - return array( + $ret = array( 'prop' => array( ApiBase::PARAM_ISMULTI => true, ApiBase::PARAM_DFLT => 'ids|title|url', @@ -156,7 +156,8 @@ class ApiQueryExtLinksUsage extends ApiQueryGeneratorBase { ) ), 'offset' => array( - ApiBase::PARAM_TYPE => 'integer' + ApiBase::PARAM_TYPE => 'integer', + ApiBase::PARAM_HELP_MSG => 'api-help-param-continue', ), 'protocol' => array( ApiBase::PARAM_TYPE => self::prepareProtocols(), @@ -176,6 +177,14 @@ class ApiQueryExtLinksUsage extends ApiQueryGeneratorBase { ), 'expandurl' => false, ); + + if ( $this->getConfig()->get( 'MiserMode' ) ) { + $ret['namespace'][ApiBase::PARAM_HELP_MSG_APPEND] = array( + 'api-help-param-limited-in-miser-mode', + ); + } + + return $ret; } public static function prepareProtocols() { @@ -207,45 +216,10 @@ class ApiQueryExtLinksUsage extends ApiQueryGeneratorBase { } } - public function getParamDescription() { - $p = $this->getModulePrefix(); - $desc = array( - 'prop' => array( - 'What pieces of information to include', - ' ids - Adds the ID of page', - ' title - Adds the title and namespace ID of the page', - ' url - Adds the URL used in the page', - ), - 'offset' => 'Used for paging. Use the value returned for "continue"', - 'protocol' => array( - "Protocol of the URL. If empty and {$p}query set, the protocol is http.", - "Leave both this and {$p}query empty to list all external links" - ), - 'query' => 'Search string without protocol. See [[Special:LinkSearch]]. ' . - 'Leave empty to list all external links', - 'namespace' => 'The page namespace(s) to enumerate.', - 'limit' => 'How many pages to return.', - 'expandurl' => 'Expand protocol-relative URLs with the canonical protocol', - ); - - if ( $this->getConfig()->get( 'MiserMode' ) ) { - $desc['namespace'] = array( - $desc['namespace'], - "NOTE: Due to \$wgMiserMode, using this may result in fewer than \"{$p}limit\" results", - 'returned before continuing; in extreme cases, zero results may be returned', - ); - } - - return $desc; - } - - public function getDescription() { - return 'Enumerate pages that contain a given URL.'; - } - - public function getExamples() { + protected function getExamplesMessages() { return array( - 'api.php?action=query&list=exturlusage&euquery=www.mediawiki.org' + 'action=query&list=exturlusage&euquery=www.mediawiki.org' + => 'apihelp-query+exturlusage-example-simple', ); }