Merge "Split mocks/media/MockBitmaphandler file"
[lhc/web/wiklou.git] / includes / api / ApiQueryLangBacklinks.php
index ce03e58..e6280c8 100644 (file)
@@ -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';
+       }
 }