* (bug 28817) Add reference help page link to API Modules
authorSam Reed <reedy@users.mediawiki.org>
Sun, 17 Jul 2011 17:02:06 +0000 (17:02 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sun, 17 Jul 2011 17:02:06 +0000 (17:02 +0000)
Last followup of r92396

Should be all modules with documentation pages in core now documented...

19 files changed:
RELEASE-NOTES-1.19
includes/api/ApiQueryAllCategories.php
includes/api/ApiQueryAllLinks.php
includes/api/ApiQueryAllUsers.php
includes/api/ApiQueryAllimages.php
includes/api/ApiQueryAllpages.php
includes/api/ApiQueryBacklinks.php
includes/api/ApiQueryBlocks.php
includes/api/ApiQueryCategoryMembers.php
includes/api/ApiQueryDeletedrevs.php
includes/api/ApiQueryExtLinksUsage.php
includes/api/ApiQueryLinks.php
includes/api/ApiQueryLogEvents.php
includes/api/ApiQueryProtectedTitles.php
includes/api/ApiQueryRecentChanges.php
includes/api/ApiQuerySearch.php
includes/api/ApiQueryUserContributions.php
includes/api/ApiQueryUsers.php
includes/api/ApiQueryWatchlist.php

index 71d7da1..049b777 100644 (file)
@@ -196,6 +196,7 @@ production.
 * (bug 29476) API returns page title instead of sectiontitle for
   srprop=sectiontitle
 * Correct the documentation of srprop properties
+* (bug 28817) Add reference help page link to API Modules
 
 === Languages updated in 1.19 ===
 
index dee52f1..0725c15 100644 (file)
@@ -203,6 +203,10 @@ class ApiQueryAllCategories extends ApiQueryGeneratorBase {
                );
        }
 
+       public function getHelpUrls() {
+               return 'http://www.mediawiki.org/wiki/API:Allcategories';
+       }
+
        public function getVersion() {
                return __CLASS__ . ': $Id$';
        }
index 1a7ad61..b10bc92 100644 (file)
@@ -227,6 +227,10 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase {
                );
        }
 
+       public function getHelpUrls() {
+               return 'http://www.mediawiki.org/wiki/API:Alllinks';
+       }
+
        public function getVersion() {
                return __CLASS__ . ': $Id$';
        }
index 336c494..a5a11f6 100644 (file)
@@ -361,6 +361,10 @@ class ApiQueryAllUsers extends ApiQueryBase {
                );
        }
 
+       public function getHelpUrls() {
+               return 'http://www.mediawiki.org/wiki/API:Allusers';
+       }
+
        public function getVersion() {
                return __CLASS__ . ': $Id$';
        }
index 9cb5b54..5346be9 100644 (file)
@@ -162,8 +162,8 @@ class ApiQueryAllimages extends ApiQueryGeneratorBase {
                                $file = $repo->newFileFromRow( $row );
                                $info = array_merge( array( 'name' => $row->img_name ),
                                        ApiQueryImageInfo::getInfo( $file, $prop, $result ) );
-                               self::addTitleInfo( $info, $file->getTitle() ); 
-                                       
+                               self::addTitleInfo( $info, $file->getTitle() );
+
                                $fit = $result->addValue( array( 'query', $this->getModuleName() ), null, $info );
                                if ( !$fit ) {
                                        $this->setContinueEnumParameter( 'from', $this->keyToTitle( $row->img_name ) );
@@ -260,6 +260,10 @@ class ApiQueryAllimages extends ApiQueryGeneratorBase {
                );
        }
 
+       public function getHelpUrls() {
+               return 'http://www.mediawiki.org/wiki/API:Allimages';
+       }
+
        public function getVersion() {
                return __CLASS__ . ': $Id$';
        }
index eeb4b83..709c58a 100644 (file)
@@ -325,6 +325,10 @@ class ApiQueryAllpages extends ApiQueryGeneratorBase {
                );
        }
 
+       public function getHelpUrls() {
+               return 'http://www.mediawiki.org/wiki/API:Allpages';
+       }
+
        public function getVersion() {
                return __CLASS__ . ': $Id$';
        }
index e5de929..c38df76 100644 (file)
@@ -63,17 +63,20 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
                'backlinks' => array(
                        'code' => 'bl',
                        'prefix' => 'pl',
-                       'linktbl' => 'pagelinks'
+                       'linktbl' => 'pagelinks',
+                       'helpurl' => 'http://www.mediawiki.org/wiki/API:Backlinks',
                ),
                'embeddedin' => array(
                        'code' => 'ei',
                        'prefix' => 'tl',
-                       'linktbl' => 'templatelinks'
+                       'linktbl' => 'templatelinks',
+                       'helpurl' => 'http://www.mediawiki.org/wiki/API:Embeddedin',
                ),
                'imageusage' => array(
                        'code' => 'iu',
                        'prefix' => 'il',
-                       'linktbl' => 'imagelinks'
+                       'linktbl' => 'imagelinks',
+                       'helpurl' => 'http://www.mediawiki.org/wiki/API:Imageusage',
                )
        );
 
@@ -88,6 +91,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
                $this->bl_from = $prefix . '_from';
                $this->bl_table = $settings['linktbl'];
                $this->bl_code = $code;
+               $this->helpUrl = $settings['helpurl'];
 
                $this->hasNS = $moduleName !== 'imageusage';
                if ( $this->hasNS ) {
@@ -526,6 +530,10 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
                return $examples[$this->getModuleName()];
        }
 
+       public function getHelpUrls() {
+               return $this->helpUrl;
+       }
+
        public function getVersion() {
                return __CLASS__ . ': $Id$';
        }
index d96452c..0ad0717 100644 (file)
@@ -302,6 +302,10 @@ class ApiQueryBlocks extends ApiQueryBase {
                );
        }
 
+       public function getHelpUrls() {
+               return 'http://www.mediawiki.org/wiki/API:Blocks';
+       }
+
        public function getVersion() {
                return __CLASS__ . ': $Id$';
        }
index b4266b5..b1f44c1 100644 (file)
@@ -388,6 +388,10 @@ class ApiQueryCategoryMembers extends ApiQueryGeneratorBase {
                );
        }
 
+       public function getHelpUrls() {
+               return 'http://www.mediawiki.org/wiki/API:Categorymembers';
+       }
+
        public function getVersion() {
                return __CLASS__ . ': $Id$';
        }
index 486b9a9..ec28d84 100644 (file)
@@ -398,6 +398,10 @@ class ApiQueryDeletedrevs extends ApiQueryBase {
                );
        }
 
+       public function getHelpUrls() {
+               return '';
+       }
+
        public function getVersion() {
                return __CLASS__ . ': $Id$';
        }
index 3aec88f..093c2e4 100644 (file)
@@ -251,6 +251,10 @@ class ApiQueryExtLinksUsage extends ApiQueryGeneratorBase {
                );
        }
 
+       public function getHelpUrls() {
+               return 'http://www.mediawiki.org/wiki/API:Exturlusage';
+       }
+
        public function getVersion() {
                return __CLASS__ . ': $Id$';
        }
index f7d86cd..dda9ba8 100644 (file)
@@ -39,7 +39,7 @@ class ApiQueryLinks extends ApiQueryGeneratorBase {
        const LINKS = 'links';
        const TEMPLATES = 'templates';
 
-       private $table, $prefix, $description;
+       private $table, $prefix, $description, $helpUrl;
 
        public function __construct( $query, $moduleName ) {
                switch ( $moduleName ) {
@@ -48,12 +48,14 @@ class ApiQueryLinks extends ApiQueryGeneratorBase {
                                $this->prefix = 'pl';
                                $this->description = 'link';
                                $this->titlesParam = 'titles';
+                               $this->helpUrl = 'http://www.mediawiki.org/wiki/API:Properties#links_.2F_pl';
                                break;
                        case self::TEMPLATES:
                                $this->table = 'templatelinks';
                                $this->prefix = 'tl';
                                $this->description = 'template';
                                $this->titlesParam = 'templates';
+                               $this->helpUrl = 'http://www.mediawiki.org/wiki/API:Properties#templates_.2F_tl';
                                break;
                        default:
                                ApiBase::dieDebug( __METHOD__, 'Unknown module name' );
@@ -239,11 +241,7 @@ class ApiQueryLinks extends ApiQueryGeneratorBase {
        }
 
        public function getHelpUrls() {
-               if ( $this->prefix === 'pl' ) {
-                       return 'http://www.mediawiki.org/wiki/API:Properties#links_.2F_pl';
-               } else { // tl
-                       return 'http://www.mediawiki.org/wiki/API:Properties#templates_.2F_tl';
-               }
+               return $this->helpUrl;
        }
 
        public function getVersion() {
index 913dbdd..11b1224 100644 (file)
@@ -451,6 +451,10 @@ class ApiQueryLogEvents extends ApiQueryBase {
                );
        }
 
+       public function getHelpUrls() {
+               return 'http://www.mediawiki.org/wiki/API:Logevents';
+       }
+
        public function getVersion() {
                return __CLASS__ . ': $Id$';
        }
index 6c54dd6..6874187 100644 (file)
@@ -230,6 +230,10 @@ class ApiQueryProtectedTitles extends ApiQueryGeneratorBase {
                );
        }
 
+       public function getHelpUrls() {
+               return 'http://www.mediawiki.org/wiki/API:Protectedtitles';
+       }
+
        public function getVersion() {
                return __CLASS__ . ': $Id$';
        }
index 1cc0e3a..aa2a103 100644 (file)
@@ -639,6 +639,10 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase {
                );
        }
 
+       public function getHelpUrls() {
+               return 'http://www.mediawiki.org/wiki/API:Recentchanges';
+       }
+
        public function getVersion() {
                return __CLASS__ . ': $Id$';
        }
index 19ca63f..f7d9954 100644 (file)
@@ -300,6 +300,10 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
                );
        }
 
+       public function getHelpUrls() {
+               return 'http://www.mediawiki.org/wiki/API:Search';
+       }
+
        public function getVersion() {
                return __CLASS__ . ': $Id$';
        }
index 0b7a5f9..2a2d1b0 100644 (file)
@@ -470,6 +470,10 @@ class ApiQueryContributions extends ApiQueryBase {
                );
        }
 
+       public function getHelpUrls() {
+               return 'http://www.mediawiki.org/wiki/API:Usercontribs';
+       }
+
        public function getVersion() {
                return __CLASS__ . ': $Id$';
        }
index 6e8ddf4..bbe90f5 100644 (file)
@@ -224,7 +224,7 @@ class ApiQueryUsers extends ApiQueryBase {
                                }
                        } else {
                                if ( isset( $this->prop['groups'] ) && isset( $data[$u]['groups'] ) ) {
-                                       $result->setIndexedTagName( $data[$u]['groups'], 'g' ); 
+                                       $result->setIndexedTagName( $data[$u]['groups'], 'g' );
                                }
                                if ( isset( $this->prop['rights'] ) && isset( $data[$u]['rights'] ) ) {
                                        $result->setIndexedTagName( $data[$u]['rights'], 'r' );
@@ -322,6 +322,10 @@ class ApiQueryUsers extends ApiQueryBase {
                return 'api.php?action=query&list=users&ususers=brion|TimStarling&usprop=groups|editcount|gender';
        }
 
+       public function getHelpUrls() {
+               return 'http://www.mediawiki.org/wiki/API:Users';
+       }
+
        public function getVersion() {
                return __CLASS__ . ': $Id$';
        }
index a5023ea..abb0ff8 100644 (file)
@@ -448,6 +448,10 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase {
                );
        }
 
+       public function getHelpUrls() {
+               return 'http://www.mediawiki.org/wiki/API:Watchlist';
+       }
+
        public function getVersion() {
                return __CLASS__ . ': $Id$';
        }