Switch some HTMLForms in special pages to OOUI
[lhc/web/wiklou.git] / includes / api / ApiQueryExtLinksUsage.php
index faabb92..3f65a19 100644 (file)
@@ -112,7 +112,9 @@ class ApiQueryExtLinksUsage extends ApiQueryGeneratorBase {
                        }
 
                        if ( is_null( $resultPageSet ) ) {
-                               $vals = array();
+                               $vals = array(
+                                       ApiResult::META_TYPE => 'assoc',
+                               );
                                if ( $fld_ids ) {
                                        $vals['pageid'] = intval( $row->page_id );
                                }
@@ -139,13 +141,13 @@ class ApiQueryExtLinksUsage extends ApiQueryGeneratorBase {
                }
 
                if ( is_null( $resultPageSet ) ) {
-                       $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ),
+                       $result->addIndexedTagName( array( 'query', $this->getModuleName() ),
                                $this->getModulePrefix() );
                }
        }
 
        public function getAllowedParams() {
-               return array(
+               $ret = array(
                        'prop' => array(
                                ApiBase::PARAM_ISMULTI => true,
                                ApiBase::PARAM_DFLT => 'ids|title|url',
@@ -156,7 +158,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 +179,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 +218,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',
                );
        }