From 6e84e9ccd980105c181fe7d61bee6190be6eca8d Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sun, 17 Jul 2011 16:38:24 +0000 Subject: [PATCH] Followup r92396, add help urls for most of the core (non query) modules --- includes/api/ApiBlock.php | 4 ++++ includes/api/ApiDelete.php | 4 ++++ includes/api/ApiEditPage.php | 4 ++++ includes/api/ApiEmailUser.php | 4 ++++ includes/api/ApiExpandTemplates.php | 4 ++++ includes/api/ApiFeedContributions.php | 4 ++++ includes/api/ApiFeedWatchlist.php | 4 ++++ includes/api/ApiFileRevert.php | 14 +++++++++----- includes/api/ApiFormatBase.php | 4 ++++ includes/api/ApiHelp.php | 8 ++++++++ includes/api/ApiImport.php | 4 ++++ includes/api/ApiMove.php | 4 ++++ includes/api/ApiOpenSearch.php | 6 +++++- includes/api/ApiParse.php | 4 ++++ includes/api/ApiPatrol.php | 4 ++++ includes/api/ApiProtect.php | 4 ++++ includes/api/ApiPurge.php | 4 ++++ includes/api/ApiRollback.php | 4 ++++ includes/api/ApiUnblock.php | 4 ++++ includes/api/ApiUndelete.php | 4 ++++ includes/api/ApiUpload.php | 6 +++++- includes/api/ApiUserrights.php | 4 ++++ includes/api/ApiWatch.php | 4 ++++ 23 files changed, 103 insertions(+), 7 deletions(-) diff --git a/includes/api/ApiBlock.php b/includes/api/ApiBlock.php index 94a85464f2..d3df264659 100644 --- a/includes/api/ApiBlock.php +++ b/includes/api/ApiBlock.php @@ -215,6 +215,10 @@ class ApiBlock extends ApiBase { ); } + public function getHelpUrls() { + return 'http://www.mediawiki.org/wiki/API:Block'; + } + public function getVersion() { return __CLASS__ . ': $Id$'; } diff --git a/includes/api/ApiDelete.php b/includes/api/ApiDelete.php index 979e8e1263..ace11773bc 100644 --- a/includes/api/ApiDelete.php +++ b/includes/api/ApiDelete.php @@ -276,6 +276,10 @@ class ApiDelete extends ApiBase { ); } + public function getHelpUrls() { + return 'http://www.mediawiki.org/wiki/API:Delete'; + } + public function getVersion() { return __CLASS__ . ': $Id$'; } diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php index dbfcc3dfd7..27cecf1f78 100644 --- a/includes/api/ApiEditPage.php +++ b/includes/api/ApiEditPage.php @@ -524,6 +524,10 @@ class ApiEditPage extends ApiBase { ); } + public function getHelpUrls() { + return 'http://www.mediawiki.org/wiki/API:Edit'; + } + public function getVersion() { return __CLASS__ . ': $Id$'; } diff --git a/includes/api/ApiEmailUser.php b/includes/api/ApiEmailUser.php index 55188b96a0..c6c07013ca 100644 --- a/includes/api/ApiEmailUser.php +++ b/includes/api/ApiEmailUser.php @@ -144,6 +144,10 @@ class ApiEmailUser extends ApiBase { ); } + public function getHelpUrls() { + return 'http://www.mediawiki.org/wiki/API:E-mail'; + } + public function getVersion() { return __CLASS__ . ': $Id$'; } diff --git a/includes/api/ApiExpandTemplates.php b/includes/api/ApiExpandTemplates.php index dd35aaa891..8b3ca154df 100644 --- a/includes/api/ApiExpandTemplates.php +++ b/includes/api/ApiExpandTemplates.php @@ -115,6 +115,10 @@ class ApiExpandTemplates extends ApiBase { ); } + public function getHelpUrls() { + return 'http://www.mediawiki.org/wiki/API:Parsing_wikitext'; + } + public function getVersion() { return __CLASS__ . ': $Id$'; } diff --git a/includes/api/ApiFeedContributions.php b/includes/api/ApiFeedContributions.php index ef6feccfac..a9846a5a9a 100644 --- a/includes/api/ApiFeedContributions.php +++ b/includes/api/ApiFeedContributions.php @@ -201,6 +201,10 @@ class ApiFeedContributions extends ApiBase { ); } + public function getHelpUrls() { + return ''; + } + public function getVersion() { return __CLASS__ . ': $Id$'; } diff --git a/includes/api/ApiFeedWatchlist.php b/includes/api/ApiFeedWatchlist.php index 5e83b3014e..b4fb9e4665 100644 --- a/includes/api/ApiFeedWatchlist.php +++ b/includes/api/ApiFeedWatchlist.php @@ -221,6 +221,10 @@ class ApiFeedWatchlist extends ApiBase { ); } + public function getHelpUrls() { + return 'http://www.mediawiki.org/wiki/API:Watchlist_feed'; + } + public function getVersion() { return __CLASS__ . ': $Id$'; } diff --git a/includes/api/ApiFileRevert.php b/includes/api/ApiFileRevert.php index 371ef67833..6f2916a88b 100644 --- a/includes/api/ApiFileRevert.php +++ b/includes/api/ApiFileRevert.php @@ -55,20 +55,20 @@ class ApiFileRevert extends ApiBase { // Check whether we're allowed to revert this file $this->checkPermissions( $wgUser ); - + $sourceUrl = $this->file->getArchiveVirtualUrl( $this->archiveName ); $status = $this->file->upload( $sourceUrl, $this->params['comment'], $this->params['comment'] ); if ( $status->isGood() ) { $result = array( 'result' => 'Success' ); } else { - $result = array( - 'result' => 'Failure', + $result = array( + 'result' => 'Failure', 'errors' => $this->getResult()->convertStatusToArray( $status ), ); } - $this->getResult()->addValue( null, $this->getModuleName(), $result ); + $this->getResult()->addValue( null, $this->getModuleName(), $result ); } @@ -131,7 +131,7 @@ class ApiFileRevert extends ApiBase { ), 'archivename' => array( ApiBase::PARAM_TYPE => 'string', - ApiBase::PARAM_REQUIRED => true, + ApiBase::PARAM_REQUIRED => true, ), 'token' => null, ); @@ -183,6 +183,10 @@ class ApiFileRevert extends ApiBase { ); } + public function getHelpUrls() { + return ''; + } + public function getVersion() { return __CLASS__ . ': $Id$'; } diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php index cddfb4aa54..f491144b4e 100644 --- a/includes/api/ApiFormatBase.php +++ b/includes/api/ApiFormatBase.php @@ -294,6 +294,10 @@ See complete documentation, or return 'api.php?action=query&meta=siteinfo&siprop=namespaces&format=' . $this->getModuleName(); } + public function getHelpUrls() { + return 'http://www.mediawiki.org/wiki/API:Data_formats'; + } + public function getDescription() { return $this->getIsHtml() ? ' (pretty-print in HTML)' : ''; } diff --git a/includes/api/ApiHelp.php b/includes/api/ApiHelp.php index c5170c4fa6..89dbf10d11 100644 --- a/includes/api/ApiHelp.php +++ b/includes/api/ApiHelp.php @@ -154,6 +154,14 @@ class ApiHelp extends ApiBase { ); } + public function getHelpUrls() { + return array( + 'http://www.mediawiki.org/wiki/API:Main_page', + 'http://www.mediawiki.org/wiki/API:FAQ', + 'http://www.mediawiki.org/wiki/API:Quick_start_guide', + ); + } + public function getVersion() { return __CLASS__ . ': $Id$'; } diff --git a/includes/api/ApiImport.php b/includes/api/ApiImport.php index 12cf08fe3e..1b77266a22 100644 --- a/includes/api/ApiImport.php +++ b/includes/api/ApiImport.php @@ -165,6 +165,10 @@ class ApiImport extends ApiBase { ); } + public function getHelpUrls() { + return 'http://www.mediawiki.org/wiki/API:Import'; + } + public function getVersion() { return __CLASS__ . ': $Id$'; } diff --git a/includes/api/ApiMove.php b/includes/api/ApiMove.php index 6fefc6a389..7f9d62b7f6 100644 --- a/includes/api/ApiMove.php +++ b/includes/api/ApiMove.php @@ -260,6 +260,10 @@ class ApiMove extends ApiBase { ); } + public function getHelpUrls() { + return 'http://www.mediawiki.org/wiki/API:Move'; + } + public function getVersion() { return __CLASS__ . ': $Id$'; } diff --git a/includes/api/ApiOpenSearch.php b/includes/api/ApiOpenSearch.php index bdab14fb7e..9a09c274f4 100644 --- a/includes/api/ApiOpenSearch.php +++ b/includes/api/ApiOpenSearch.php @@ -60,7 +60,7 @@ class ApiOpenSearch extends ApiBase { $searches = PrefixSearch::titleSearch( $search, $limit, $namespaces ); - + // if the content language has variants, try to retrieve fallback results $fallbackLimit = $limit - count( $searches ); if ( $fallbackLimit > 0 ) { @@ -125,6 +125,10 @@ class ApiOpenSearch extends ApiBase { ); } + public function getHelpUrls() { + return ''; + } + public function getVersion() { return __CLASS__ . ': $Id$'; } diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index 9d2d95a5a1..60b1714cab 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -585,6 +585,10 @@ class ApiParse extends ApiBase { ); } + public function getHelpUrls() { + return ''; + } + public function getVersion() { return __CLASS__ . ': $Id$'; } diff --git a/includes/api/ApiPatrol.php b/includes/api/ApiPatrol.php index 58e0499455..c3dc582b49 100644 --- a/includes/api/ApiPatrol.php +++ b/includes/api/ApiPatrol.php @@ -110,6 +110,10 @@ class ApiPatrol extends ApiBase { ); } + public function getHelpUrls() { + return ''; + } + public function getVersion() { return __CLASS__ . ': $Id$'; } diff --git a/includes/api/ApiProtect.php b/includes/api/ApiProtect.php index 021c687886..c87cf43e70 100644 --- a/includes/api/ApiProtect.php +++ b/includes/api/ApiProtect.php @@ -224,6 +224,10 @@ class ApiProtect extends ApiBase { ); } + public function getHelpUrls() { + return 'http://www.mediawiki.org/wiki/API:Protect'; + } + public function getVersion() { return __CLASS__ . ': $Id$'; } diff --git a/includes/api/ApiPurge.php b/includes/api/ApiPurge.php index aa695361c6..bf8acd18ff 100644 --- a/includes/api/ApiPurge.php +++ b/includes/api/ApiPurge.php @@ -142,6 +142,10 @@ class ApiPurge extends ApiBase { ); } + public function getHelpUrls() { + return 'http://www.mediawiki.org/wiki/API:Purge'; + } + public function getVersion() { return __CLASS__ . ': $Id$'; } diff --git a/includes/api/ApiRollback.php b/includes/api/ApiRollback.php index e845df6633..4ad84a883c 100644 --- a/includes/api/ApiRollback.php +++ b/includes/api/ApiRollback.php @@ -191,6 +191,10 @@ class ApiRollback extends ApiBase { ); } + public function getHelpUrls() { + return 'http://www.mediawiki.org/wiki/API:Rollback'; + } + public function getVersion() { return __CLASS__ . ': $Id$'; } diff --git a/includes/api/ApiUnblock.php b/includes/api/ApiUnblock.php index 6865787281..096641ad00 100644 --- a/includes/api/ApiUnblock.php +++ b/includes/api/ApiUnblock.php @@ -148,6 +148,10 @@ class ApiUnblock extends ApiBase { ); } + public function getHelpUrls() { + return 'http://www.mediawiki.org/wiki/API:Block'; + } + public function getVersion() { return __CLASS__ . ': $Id$'; } diff --git a/includes/api/ApiUndelete.php b/includes/api/ApiUndelete.php index 509c1f825e..3e3157dd92 100644 --- a/includes/api/ApiUndelete.php +++ b/includes/api/ApiUndelete.php @@ -159,6 +159,10 @@ class ApiUndelete extends ApiBase { ); } + public function getHelpUrls() { + return 'http://www.mediawiki.org/wiki/API:Undelete'; + } + public function getVersion() { return __CLASS__ . ': $Id$'; } diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index b101ecc672..7c95f99912 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -58,7 +58,7 @@ class ApiUpload extends ApiBase { $request = $this->getMain()->getRequest(); // Add the uploaded file to the params array $this->mParams['file'] = $request->getFileName( 'file' ); - + // Copy the session key to the file key, for backward compatibility. if( !$this->mParams['filekey'] && $this->mParams['sessionkey'] ) { $this->mParams['filekey'] = $this->mParams['sessionkey']; @@ -562,6 +562,10 @@ class ApiUpload extends ApiBase { ); } + public function getHelpUrls() { + return 'http://www.mediawiki.org/wiki/API:Upload'; + } + public function getVersion() { return __CLASS__ . ': $Id$'; } diff --git a/includes/api/ApiUserrights.php b/includes/api/ApiUserrights.php index 60853a1c09..a0a52b0cac 100644 --- a/includes/api/ApiUserrights.php +++ b/includes/api/ApiUserrights.php @@ -139,6 +139,10 @@ class ApiUserrights extends ApiBase { ); } + public function getHelpUrls() { + return 'http://www.mediawiki.org/wiki/API:User_group_membership'; + } + public function getVersion() { return __CLASS__ . ': $Id$'; } diff --git a/includes/api/ApiWatch.php b/includes/api/ApiWatch.php index 241e25d88b..e3bd57fa15 100644 --- a/includes/api/ApiWatch.php +++ b/includes/api/ApiWatch.php @@ -125,6 +125,10 @@ class ApiWatch extends ApiBase { ); } + public function getHelpUrls() { + return 'http://www.mediawiki.org/wiki/API:Watch'; + } + public function getVersion() { return __CLASS__ . ': $Id$'; } -- 2.20.1