Merge "Correct case for the "MediaWiki:Revdelete-reason-dropdown" link in Special...
[lhc/web/wiklou.git] / includes / api / ApiHelp.php
index 3311900..97da786 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * API for MediaWiki 1.8+
+ *
  *
  * Created on Sep 6, 2006
  *
  * @file
  */
 
-if ( !defined( 'MEDIAWIKI' ) ) {
-       // Eclipse helper - will be ignored in production
-       require_once( 'ApiBase.php' );
-}
-
 /**
  * This is a simple class to handle action=help
  *
@@ -93,6 +88,11 @@ class ApiHelp extends ApiBase {
                $result->addValue( null, $this->getModuleName(), $r );
        }
 
+       /**
+        * @param  $module ApiBase
+        * @param  $type String What type of request is this? e.g. action, query, list, prop, meta, format
+        * @return string
+        */
        private function buildModuleHelp( $module, $type ) {
                $msg = ApiMain::makeHelpMsgHeader( $module, $type );
 
@@ -134,14 +134,21 @@ class ApiHelp extends ApiBase {
                return 'Display this help screen. Or the help screen for the specified module';
        }
 
-       protected function getExamples() {
+       public function getExamples() {
+               return array(
+                       'api.php?action=help' => 'Whole help page',
+                       'api.php?action=help&modules=protect' => 'Module (action) help page',
+                       'api.php?action=help&querymodules=categorymembers' => 'Query (list) modules help page',
+                       'api.php?action=help&querymodules=info' => 'Query (prop) modules help page',
+                       'api.php?action=help&querymodules=siteinfo' => 'Query (meta) modules help page',
+               );
+       }
+
+       public function getHelpUrls() {
                return array(
-                       'Whole help page:',
-                       '  api.php?action=help',
-                       'Module help page:',
-                       '  api.php?action=help&modules=protect',
-                       'Query modules help page:',
-                       '  api.php?action=help&querymodules=categorymembers',
+                       'https://www.mediawiki.org/wiki/API:Main_page',
+                       'https://www.mediawiki.org/wiki/API:FAQ',
+                       'https://www.mediawiki.org/wiki/API:Quick_start_guide',
                );
        }