From: Sam Reed Date: Sun, 17 Jul 2011 17:02:06 +0000 (+0000) Subject: * (bug 28817) Add reference help page link to API Modules X-Git-Tag: 1.31.0-rc.0~28785 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=9c37ab4fb3a163bb9daea514cf73437c8a5a646f;p=lhc%2Fweb%2Fwiklou.git * (bug 28817) Add reference help page link to API Modules Last followup of r92396 Should be all modules with documentation pages in core now documented... --- diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 71d7da14d6..049b777099 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -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 === diff --git a/includes/api/ApiQueryAllCategories.php b/includes/api/ApiQueryAllCategories.php index dee52f162d..0725c155fa 100644 --- a/includes/api/ApiQueryAllCategories.php +++ b/includes/api/ApiQueryAllCategories.php @@ -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$'; } diff --git a/includes/api/ApiQueryAllLinks.php b/includes/api/ApiQueryAllLinks.php index 1a7ad616c5..b10bc92439 100644 --- a/includes/api/ApiQueryAllLinks.php +++ b/includes/api/ApiQueryAllLinks.php @@ -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$'; } diff --git a/includes/api/ApiQueryAllUsers.php b/includes/api/ApiQueryAllUsers.php index 336c494067..a5a11f6a31 100644 --- a/includes/api/ApiQueryAllUsers.php +++ b/includes/api/ApiQueryAllUsers.php @@ -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$'; } diff --git a/includes/api/ApiQueryAllimages.php b/includes/api/ApiQueryAllimages.php index 9cb5b545bb..5346be9547 100644 --- a/includes/api/ApiQueryAllimages.php +++ b/includes/api/ApiQueryAllimages.php @@ -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$'; } diff --git a/includes/api/ApiQueryAllpages.php b/includes/api/ApiQueryAllpages.php index eeb4b83be5..709c58a5f9 100644 --- a/includes/api/ApiQueryAllpages.php +++ b/includes/api/ApiQueryAllpages.php @@ -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$'; } diff --git a/includes/api/ApiQueryBacklinks.php b/includes/api/ApiQueryBacklinks.php index e5de929830..c38df76233 100644 --- a/includes/api/ApiQueryBacklinks.php +++ b/includes/api/ApiQueryBacklinks.php @@ -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$'; } diff --git a/includes/api/ApiQueryBlocks.php b/includes/api/ApiQueryBlocks.php index d96452c5b0..0ad0717d50 100644 --- a/includes/api/ApiQueryBlocks.php +++ b/includes/api/ApiQueryBlocks.php @@ -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$'; } diff --git a/includes/api/ApiQueryCategoryMembers.php b/includes/api/ApiQueryCategoryMembers.php index b4266b5c36..b1f44c122f 100644 --- a/includes/api/ApiQueryCategoryMembers.php +++ b/includes/api/ApiQueryCategoryMembers.php @@ -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$'; } diff --git a/includes/api/ApiQueryDeletedrevs.php b/includes/api/ApiQueryDeletedrevs.php index 486b9a90f1..ec28d84b21 100644 --- a/includes/api/ApiQueryDeletedrevs.php +++ b/includes/api/ApiQueryDeletedrevs.php @@ -398,6 +398,10 @@ class ApiQueryDeletedrevs extends ApiQueryBase { ); } + public function getHelpUrls() { + return ''; + } + public function getVersion() { return __CLASS__ . ': $Id$'; } diff --git a/includes/api/ApiQueryExtLinksUsage.php b/includes/api/ApiQueryExtLinksUsage.php index 3aec88ff44..093c2e45e9 100644 --- a/includes/api/ApiQueryExtLinksUsage.php +++ b/includes/api/ApiQueryExtLinksUsage.php @@ -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$'; } diff --git a/includes/api/ApiQueryLinks.php b/includes/api/ApiQueryLinks.php index f7d86cd941..dda9ba8949 100644 --- a/includes/api/ApiQueryLinks.php +++ b/includes/api/ApiQueryLinks.php @@ -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() { diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php index 913dbddad2..11b12246db 100644 --- a/includes/api/ApiQueryLogEvents.php +++ b/includes/api/ApiQueryLogEvents.php @@ -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$'; } diff --git a/includes/api/ApiQueryProtectedTitles.php b/includes/api/ApiQueryProtectedTitles.php index 6c54dd6771..6874187d11 100644 --- a/includes/api/ApiQueryProtectedTitles.php +++ b/includes/api/ApiQueryProtectedTitles.php @@ -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$'; } diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php index 1cc0e3a4db..aa2a1036b3 100644 --- a/includes/api/ApiQueryRecentChanges.php +++ b/includes/api/ApiQueryRecentChanges.php @@ -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$'; } diff --git a/includes/api/ApiQuerySearch.php b/includes/api/ApiQuerySearch.php index 19ca63f896..f7d9954c2d 100644 --- a/includes/api/ApiQuerySearch.php +++ b/includes/api/ApiQuerySearch.php @@ -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$'; } diff --git a/includes/api/ApiQueryUserContributions.php b/includes/api/ApiQueryUserContributions.php index 0b7a5f9071..2a2d1b0f51 100644 --- a/includes/api/ApiQueryUserContributions.php +++ b/includes/api/ApiQueryUserContributions.php @@ -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$'; } diff --git a/includes/api/ApiQueryUsers.php b/includes/api/ApiQueryUsers.php index 6e8ddf4ec8..bbe90f5847 100644 --- a/includes/api/ApiQueryUsers.php +++ b/includes/api/ApiQueryUsers.php @@ -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$'; } diff --git a/includes/api/ApiQueryWatchlist.php b/includes/api/ApiQueryWatchlist.php index a5023ea30d..abb0ff8be1 100644 --- a/includes/api/ApiQueryWatchlist.php +++ b/includes/api/ApiQueryWatchlist.php @@ -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$'; }