X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryLangBacklinks.php;h=e6280c853a547a22e133d537dc2b516e9cb2b10a;hb=f12051919fd5c2d62cb9fa35f297486cea6bfa1a;hp=ce03e58ecb52da6e48a90e945597d957a69e2904;hpb=068ce81799303d2b16eb45dbd91f45366d05a796;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryLangBacklinks.php b/includes/api/ApiQueryLangBacklinks.php index ce03e58ecb..e6280c853a 100644 --- a/includes/api/ApiQueryLangBacklinks.php +++ b/includes/api/ApiQueryLangBacklinks.php @@ -92,14 +92,14 @@ class ApiQueryLangBacklinks extends ApiQueryGeneratorBase { $this->addOption( 'ORDER BY', array( 'll_title' . $sort, 'll_from' . $sort - )); + ) ); } } else { $this->addOption( 'ORDER BY', array( 'll_lang' . $sort, 'll_title' . $sort, 'll_from' . $sort - )); + ) ); } $this->addOption( 'LIMIT', $params['limit'] + 1 ); @@ -111,10 +111,14 @@ class ApiQueryLangBacklinks extends ApiQueryGeneratorBase { $count = 0; $result = $this->getResult(); foreach ( $res as $row ) { - if ( ++ $count > $params['limit'] ) { - // We've reached the one extra which shows that there are additional pages to be had. Stop here... - // Continue string preserved in case the redirect query doesn't pass the limit - $this->setContinueEnumParameter( 'continue', "{$row->ll_lang}|{$row->ll_title}|{$row->ll_from}" ); + if ( ++$count > $params['limit'] ) { + // We've reached the one extra which shows that there are + // additional pages to be had. Stop here... Continue string + // preserved in case the redirect query doesn't pass the limit. + $this->setContinueEnumParameter( + 'continue', + "{$row->ll_lang}|{$row->ll_title}|{$row->ll_from}" + ); break; } @@ -140,7 +144,10 @@ class ApiQueryLangBacklinks extends ApiQueryGeneratorBase { $fit = $result->addValue( array( 'query', $this->getModuleName() ), null, $entry ); if ( !$fit ) { - $this->setContinueEnumParameter( 'continue', "{$row->ll_lang}|{$row->ll_title}|{$row->ll_from}" ); + $this->setContinueEnumParameter( + 'continue', + "{$row->ll_lang}|{$row->ll_title}|{$row->ll_from}" + ); break; } } @@ -195,7 +202,7 @@ class ApiQueryLangBacklinks extends ApiQueryGeneratorBase { 'prop' => array( 'Which properties to get', ' lllang - Adds the language code of the language link', - ' lltitle - Adds the title of the language ink', + ' lltitle - Adds the title of the language link', ), 'limit' => 'How many total pages to return', 'dir' => 'The direction in which to list', @@ -240,4 +247,8 @@ class ApiQueryLangBacklinks extends ApiQueryGeneratorBase { 'api.php?action=query&generator=langbacklinks&glbltitle=Test&glbllang=fr&prop=info' ); } + + public function getHelpUrls() { + return 'https://www.mediawiki.org/wiki/API:Langbacklinks'; + } }