X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryLangBacklinks.php;h=9f77b84a4710b3312a82f16d77ae78561cf8f4c5;hb=15adbabc3a1d564241ee09ac8091760b302b6b6f;hp=13711e6c83675a210024604b7781d11a55df7ff5;hpb=5f56facb3d87556264ac5fc9b5d3cf78eb656278;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryLangBacklinks.php b/includes/api/ApiQueryLangBacklinks.php index 13711e6c83..9f77b84a47 100644 --- a/includes/api/ApiQueryLangBacklinks.php +++ b/includes/api/ApiQueryLangBacklinks.php @@ -131,7 +131,7 @@ class ApiQueryLangBacklinks extends ApiQueryGeneratorBase { ApiQueryBase::addTitleInfo( $entry, $title ); if ( $row->page_is_redirect ) { - $entry['redirect'] = ''; + $entry['redirect'] = true; } if ( $lllang ) { @@ -154,7 +154,7 @@ class ApiQueryLangBacklinks extends ApiQueryGeneratorBase { } if ( is_null( $resultPageSet ) ) { - $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'll' ); + $result->addIndexedTagName( array( 'query', $this->getModuleName() ), 'll' ); } else { $resultPageSet->populateFromTitles( $pages ); } @@ -168,7 +168,9 @@ class ApiQueryLangBacklinks extends ApiQueryGeneratorBase { return array( 'lang' => null, 'title' => null, - 'continue' => null, + 'continue' => array( + ApiBase::PARAM_HELP_MSG => 'api-help-param-continue', + ), 'limit' => array( ApiBase::PARAM_DFLT => 10, ApiBase::PARAM_TYPE => 'limit', @@ -183,6 +185,7 @@ class ApiQueryLangBacklinks extends ApiQueryGeneratorBase { 'lllang', 'lltitle', ), + ApiBase::PARAM_HELP_MSG_PER_VALUE => array(), ), 'dir' => array( ApiBase::PARAM_DFLT => 'ascending', @@ -194,57 +197,12 @@ class ApiQueryLangBacklinks extends ApiQueryGeneratorBase { ); } - public function getParamDescription() { - return array( - 'lang' => 'Language for the language link', - 'title' => "Language link to search for. Must be used with {$this->getModulePrefix()}lang", - 'continue' => 'When more results are available, use this to continue', - 'prop' => array( - 'Which properties to get', - ' lllang - Adds the language code of the language link', - ' lltitle - Adds the title of the language link', - ), - 'limit' => 'How many total pages to return', - 'dir' => 'The direction in which to list', - ); - } - - public function getResultProperties() { - return array( - '' => array( - 'pageid' => 'integer', - 'ns' => 'namespace', - 'title' => 'string', - 'redirect' => 'boolean' - ), - 'lllang' => array( - 'lllang' => 'string' - ), - 'lltitle' => array( - 'lltitle' => 'string' - ) - ); - } - - public function getDescription() { - return array( 'Find all pages that link to the given language link.', - 'Can be used to find all links with a language code, or', - 'all links to a title (with a given language).', - 'Using neither parameter is effectively "All Language Links".', - 'Note that this may not consider language links added by extensions.', - ); - } - - public function getPossibleErrors() { - return array_merge( parent::getPossibleErrors(), array( - array( 'missingparam', 'lang' ), - ) ); - } - - public function getExamples() { + protected function getExamplesMessages() { return array( - 'api.php?action=query&list=langbacklinks&lbltitle=Test&lbllang=fr', - 'api.php?action=query&generator=langbacklinks&glbltitle=Test&glbllang=fr&prop=info' + 'action=query&list=langbacklinks&lbltitle=Test&lbllang=fr' + => 'apihelp-query+langbacklinks-example-simple', + 'action=query&generator=langbacklinks&glbltitle=Test&glbllang=fr&prop=info' + => 'apihelp-query+langbacklinks-example-generator', ); }