From e55ed729c4bc2179fb27de1ce988d3d351acb5a0 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Tue, 11 May 2010 22:30:18 +0000 Subject: [PATCH] Mixture of things. Couple of class comments Normalisation of "." usage at end of lines (removed) Normalisation of {prefix}parameter as per bug 23461 --- RELEASE-NOTES | 1 + includes/api/ApiBlock.php | 2 +- includes/api/ApiDelete.php | 9 +++-- includes/api/ApiDisabled.php | 2 +- includes/api/ApiEditPage.php | 11 +++--- includes/api/ApiEmailUser.php | 1 + includes/api/ApiFeedWatchlist.php | 4 +- includes/api/ApiFormatDbg.php | 1 + includes/api/ApiFormatJson.php | 1 + includes/api/ApiFormatPhp.php | 1 + includes/api/ApiFormatTxt.php | 1 + includes/api/ApiFormatWddx.php | 1 + includes/api/ApiFormatXml.php | 3 +- includes/api/ApiFormatYaml.php | 1 + includes/api/ApiGo.php | 4 -- includes/api/ApiLogin.php | 2 +- includes/api/ApiMain.php | 2 +- includes/api/ApiMove.php | 14 ++++--- includes/api/ApiParse.php | 29 +++++++------- includes/api/ApiPatrol.php | 2 +- includes/api/ApiProtect.php | 4 +- includes/api/ApiPurge.php | 2 +- includes/api/ApiQuery.php | 4 +- includes/api/ApiQueryAllCategories.php | 8 ++-- includes/api/ApiQueryAllLinks.php | 12 +++--- includes/api/ApiQueryAllUsers.php | 8 ++-- includes/api/ApiQueryAllimages.php | 8 ++-- includes/api/ApiQueryAllmessages.php | 2 +- includes/api/ApiQueryAllpages.php | 13 +++--- includes/api/ApiQueryBacklinks.php | 8 ++-- includes/api/ApiQueryBlocks.php | 4 +- includes/api/ApiQueryCategories.php | 2 +- includes/api/ApiQueryCategoryMembers.php | 11 +++--- includes/api/ApiQueryDeletedrevs.php | 8 ++-- includes/api/ApiQueryDuplicateFiles.php | 2 +- includes/api/ApiQueryExtLinksUsage.php | 5 ++- includes/api/ApiQueryFilearchive.php | 8 ++-- includes/api/ApiQueryImageInfo.php | 9 +++-- includes/api/ApiQueryLinks.php | 5 ++- includes/api/ApiQueryLogEvents.php | 16 ++++---- includes/api/ApiQueryProtectedTitles.php | 2 +- includes/api/ApiQueryRandom.php | 4 +- includes/api/ApiQueryRecentChanges.php | 14 +++---- includes/api/ApiQueryRevisions.php | 17 ++++---- includes/api/ApiQuerySearch.php | 14 +++---- includes/api/ApiQuerySiteinfo.php | 2 +- includes/api/ApiQueryTags.php | 2 +- includes/api/ApiQueryUserContributions.php | 19 ++++----- includes/api/ApiQueryWatchlist.php | 18 ++++----- includes/api/ApiQueryWatchlistRaw.php | 8 ++-- includes/api/ApiRollback.php | 6 +-- includes/api/ApiUnblock.php | 9 +++-- includes/api/ApiUndelete.php | 2 +- includes/api/ApiUpload.php | 2 +- includes/api/ApiUserrights.php | 46 +++++++++++----------- 55 files changed, 207 insertions(+), 189 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index b1fc9c2230..bfeed8a146 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -175,6 +175,7 @@ in a negative namespace (which is invalid). * (bug 23458) Add support for pageid parameter to action=parse requests * (bug 23460) Parse action should have a section option * (bug 21346) Make deleted images searchable by hash +* (bug 23461) Normalise usage of parameter names in parameter descriptions === Languages updated in 1.17 === diff --git a/includes/api/ApiBlock.php b/includes/api/ApiBlock.php index a345407435..d0b0095200 100644 --- a/includes/api/ApiBlock.php +++ b/includes/api/ApiBlock.php @@ -169,7 +169,7 @@ class ApiBlock extends ApiBase { public function getDescription() { return array( - 'Block a user.' + 'Block a user' ); } diff --git a/includes/api/ApiDelete.php b/includes/api/ApiDelete.php index f5294dd6ca..2dfd176ad4 100644 --- a/includes/api/ApiDelete.php +++ b/includes/api/ApiDelete.php @@ -221,11 +221,12 @@ class ApiDelete extends ApiBase { } public function getParamDescription() { + $p = $this->getModulePrefix(); return array( - 'title' => 'Title of the page you want to delete. Cannot be used together with pageid', - 'pageid' => 'Page ID of the page you want to delete. Cannot be used together with title', + 'title' => "Title of the page you want to delete. Cannot be used together with {$p}pageid", + 'pageid' => "Page ID of the page you want to delete. Cannot be used together with {$p}title", 'token' => 'A delete token previously retrieved through prop=info', - 'reason' => 'Reason for the deletion. If not set, an automatically generated reason will be used.', + 'reason' => 'Reason for the deletion. If not set, an automatically generated reason will be used', 'watch' => 'Add the page to your watchlist', 'watchlist' => 'Unconditionally add or remove the page from your watchlist, use preferences or do not change watch', 'unwatch' => 'Remove the page from your watchlist', @@ -235,7 +236,7 @@ class ApiDelete extends ApiBase { public function getDescription() { return array( - 'Delete a page.' + 'Delete a page' ); } diff --git a/includes/api/ApiDisabled.php b/includes/api/ApiDisabled.php index 64155ed06c..3845486894 100644 --- a/includes/api/ApiDisabled.php +++ b/includes/api/ApiDisabled.php @@ -61,7 +61,7 @@ class ApiDisabled extends ApiBase { public function getDescription() { return array( - 'This module has been disabled.' + 'This module has been disabled' ); } diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php index b07c7ee71a..ad35b399a7 100644 --- a/includes/api/ApiEditPage.php +++ b/includes/api/ApiEditPage.php @@ -433,6 +433,7 @@ class ApiEditPage extends ApiBase { } protected function getParamDescription() { + $p = $this->getModulePrefix(); return array( 'title' => 'Page title', 'section' => 'Section number. 0 for the top section, \'new\' for a new section', @@ -446,7 +447,7 @@ class ApiEditPage extends ApiBase { 'Used to detect edit conflicts; leave unset to ignore conflicts.' ), 'starttimestamp' => array( 'Timestamp when you obtained the edit token.', - 'Used to detect edit conflicts; leave unset to ignore conflicts.' + 'Used to detect edit conflicts; leave unset to ignore conflicts' ), 'recreate' => 'Override any errors about the article having been deleted in the meantime', 'createonly' => 'Don\'t edit the page if it exists already', @@ -456,11 +457,11 @@ class ApiEditPage extends ApiBase { 'watchlist' => 'Unconditionally add or remove the page from your watchlist, use preferences or do not change watch', 'captchaid' => 'CAPTCHA ID from previous request', 'captchaword' => 'Answer to the CAPTCHA', - 'md5' => array( 'The MD5 hash of the text parameter, or the prependtext and appendtext parameters concatenated.', + 'md5' => array( "The MD5 hash of the {$p}text parameter, or the {$p}prependtext and {$p}appendtext parameters concatenated.", 'If set, the edit won\'t be done unless the hash is correct' ), - 'prependtext' => 'Add this text to the beginning of the page. Overrides text.', - 'appendtext' => 'Add this text to the end of the page. Overrides text', - 'undo' => 'Undo this revision. Overrides text, prependtext and appendtext', + 'prependtext' => "Add this text to the beginning of the page. Overrides {$p}text", + 'appendtext' => "Add this text to the end of the page. Overrides {$p}text", + 'undo' => "Undo this revision. Overrides {$p}text, {$p}prependtext and {$p}appendtext", 'undoafter' => 'Undo all revisions from undo to this one. If not set, just undo one revision', ); } diff --git a/includes/api/ApiEmailUser.php b/includes/api/ApiEmailUser.php index c1e5834c93..3dd607cb65 100644 --- a/includes/api/ApiEmailUser.php +++ b/includes/api/ApiEmailUser.php @@ -28,6 +28,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { } /** + * API Module to facilitate sending of emails to users * @ingroup API */ class ApiEmailUser extends ApiBase { diff --git a/includes/api/ApiFeedWatchlist.php b/includes/api/ApiFeedWatchlist.php index f18cbe39f5..3983b4c8d4 100644 --- a/includes/api/ApiFeedWatchlist.php +++ b/includes/api/ApiFeedWatchlist.php @@ -173,8 +173,8 @@ class ApiFeedWatchlist extends ApiBase { return array( 'feedformat' => 'The format of the feed', 'hours' => 'List pages modified within this many hours from now', - 'allrev' => 'Include multiple revisions of the same page within given timeframe.', - 'wlowner' => "The user whose watchlist you want (must be accompanied by wltoken if it's not you)", + 'allrev' => 'Include multiple revisions of the same page within given timeframe', + 'wlowner' => "The user whose watchlist you want (must be accompanied by {$this->getModulePrefix()}token if it's not you)", 'wltoken' => 'Security token that requested user set in their preferences' ); } diff --git a/includes/api/ApiFormatDbg.php b/includes/api/ApiFormatDbg.php index 89dad1e433..39b2683e29 100644 --- a/includes/api/ApiFormatDbg.php +++ b/includes/api/ApiFormatDbg.php @@ -29,6 +29,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { } /** + * API PHP's var_export() output formatter * @ingroup API */ class ApiFormatDbg extends ApiFormatBase { diff --git a/includes/api/ApiFormatJson.php b/includes/api/ApiFormatJson.php index c1ea892d06..efa6fd7000 100644 --- a/includes/api/ApiFormatJson.php +++ b/includes/api/ApiFormatJson.php @@ -29,6 +29,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { } /** + * API JSON output formatter * @ingroup API */ class ApiFormatJson extends ApiFormatBase { diff --git a/includes/api/ApiFormatPhp.php b/includes/api/ApiFormatPhp.php index 07e371cc41..5d263e5eb3 100644 --- a/includes/api/ApiFormatPhp.php +++ b/includes/api/ApiFormatPhp.php @@ -29,6 +29,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { } /** + * API Serialized PHP output formatter * @ingroup API */ class ApiFormatPhp extends ApiFormatBase { diff --git a/includes/api/ApiFormatTxt.php b/includes/api/ApiFormatTxt.php index bbe0e9a455..c82930327f 100644 --- a/includes/api/ApiFormatTxt.php +++ b/includes/api/ApiFormatTxt.php @@ -29,6 +29,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { } /** + * API Text output formatter * @ingroup API */ class ApiFormatTxt extends ApiFormatBase { diff --git a/includes/api/ApiFormatWddx.php b/includes/api/ApiFormatWddx.php index 23ef6b26d0..539dd3a0bc 100644 --- a/includes/api/ApiFormatWddx.php +++ b/includes/api/ApiFormatWddx.php @@ -29,6 +29,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { } /** + * API WDDX output formatter * @ingroup API */ class ApiFormatWddx extends ApiFormatBase { diff --git a/includes/api/ApiFormatXml.php b/includes/api/ApiFormatXml.php index a09fd4707d..b5e21562ee 100644 --- a/includes/api/ApiFormatXml.php +++ b/includes/api/ApiFormatXml.php @@ -29,6 +29,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { } /** + * API XML output formatter * @ingroup API */ class ApiFormatXml extends ApiFormatBase { @@ -196,7 +197,7 @@ class ApiFormatXml extends ApiFormatBase { public function getParamDescription() { return array( - 'xmldoublequote' => 'If specified, double quotes all attributes and content.', + 'xmldoublequote' => 'If specified, double quotes all attributes and content', 'xslt' => 'If specified, adds as stylesheet', ); } diff --git a/includes/api/ApiFormatYaml.php b/includes/api/ApiFormatYaml.php index 66d4f3293d..5848042180 100644 --- a/includes/api/ApiFormatYaml.php +++ b/includes/api/ApiFormatYaml.php @@ -29,6 +29,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { } /** + * API YAML output formatter * @ingroup API */ class ApiFormatYaml extends ApiFormatBase { diff --git a/includes/api/ApiGo.php b/includes/api/ApiGo.php index 8e676e49bf..9ce0c49476 100644 --- a/includes/api/ApiGo.php +++ b/includes/api/ApiGo.php @@ -33,10 +33,6 @@ if ( !defined( 'MEDIAWIKI' ) ) { * @ingroup API */ class ApiGo extends ApiBase { - - /** - * Std ctor. - */ public function __construct( $main, $action ) { parent::__construct( $main, $action ); } diff --git a/includes/api/ApiLogin.php b/includes/api/ApiLogin.php index 39685ae4ce..dcf5ca8d63 100644 --- a/includes/api/ApiLogin.php +++ b/includes/api/ApiLogin.php @@ -179,7 +179,7 @@ class ApiLogin extends ApiBase { 'In the event of a successful log-in, a cookie will be attached', 'to your session. In the event of a failed log-in, you will not ', 'be able to attempt another log-in through this method for 5 seconds.', - 'This is to prevent password guessing by automated password crackers.' + 'This is to prevent password guessing by automated password crackers' ); } diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index fb99be97a3..89469c7380 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -634,7 +634,7 @@ class ApiMain extends ApiBase { '', 'Status: All features shown on this page should be working, but the API', ' is still in active development, and may change at any time.', - ' Make sure to monitor our mailing list for any updates.', + ' Make sure to monitor our mailing list for any updates', '', 'Documentation: http://www.mediawiki.org/wiki/API', 'Mailing list: http://lists.wikimedia.org/mailman/listinfo/mediawiki-api', diff --git a/includes/api/ApiMove.php b/includes/api/ApiMove.php index 8aed6710ea..442feaaadd 100644 --- a/includes/api/ApiMove.php +++ b/includes/api/ApiMove.php @@ -28,6 +28,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { } /** + * API Module to move pages * @ingroup API */ class ApiMove extends ApiBase { @@ -202,13 +203,14 @@ class ApiMove extends ApiBase { } public function getParamDescription() { + $p = $this->getModulePrefix(); return array( - 'from' => 'Title of the page you want to move. Cannot be used together with fromid.', - 'fromid' => 'Page ID of the page you want to move. Cannot be used together with from.', - 'to' => 'Title you want to rename the page to.', + 'from' => "Title of the page you want to move. Cannot be used together with {$p}fromid", + 'fromid' => "Page ID of the page you want to move. Cannot be used together with {$p}from", + 'to' => 'Title you want to rename the page to', 'token' => 'A move token previously retrieved through prop=info', - 'reason' => 'Reason for the move (optional).', - 'movetalk' => 'Move the talk page, if it exists.', + 'reason' => 'Reason for the move (optional)', + 'movetalk' => 'Move the talk page, if it exists', 'movesubpages' => 'Move subpages, if applicable', 'noredirect' => 'Don\'t create a redirect', 'watch' => 'Add the page and the redirect to your watchlist', @@ -220,7 +222,7 @@ class ApiMove extends ApiBase { public function getDescription() { return array( - 'Move a page.' + 'Move a page' ); } diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index ac72504d24..1c22ceda85 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -355,24 +355,25 @@ class ApiParse extends ApiBase { } public function getParamDescription() { + $p = $this->getModulePrefix(); return array( - 'text' => 'Wikitext to parse.', - 'summary' => 'Summary to parse.', - 'redirects' => 'If the page parameter is set to a redirect, resolve it.', - 'title' => 'Title of page the text belongs to.', - 'page' => 'Parse the content of this page. Cannot be used together with text and title.', - 'pageid' => 'Parse the content of this page. Overrides page.', - 'oldid' => 'Parse the content of this revision. Overrides page and pageid.', - 'prop' => array( 'Which pieces of information to get.', - 'NOTE: Section tree is only generated if there are more than 4 sections, or if the __TOC__ keyword is present.' + 'text' => 'Wikitext to parse', + 'summary' => 'Summary to parse', + 'redirects' => "If the {$p}page parameter is set to a redirect, resolve it", + 'title' => 'Title of page the text belongs to', + 'page' => "Parse the content of this page. Cannot be used together with {$p}text and {$p}title", + 'pageid' => "Parse the content of this page. Overrides {$p}page", + 'oldid' => "Parse the content of this revision. Overrides {$p}page and {$p}pageid", + 'prop' => array( 'Which pieces of information to get', + 'NOTE: Section tree is only generated if there are more than 4 sections, or if the __TOC__ keyword is present' ), - 'pst' => array( 'Do a pre-save transform on the input before parsing it.', - 'Ignored if page, pageid or oldid is used.' + 'pst' => array( 'Do a pre-save transform on the input before parsing it', + 'Ignored if page, pageid or oldid is used' ), - 'onlypst' => array( 'Do a pre-save transform (PST) on the input, but don\'t parse it.', - 'Returns the same wikitext, after a PST has been applied. Ignored if page, pageid or oldid is used.' + 'onlypst' => array( 'Do a pre-save transform (PST) on the input, but don\'t parse it', + 'Returns the same wikitext, after a PST has been applied. Ignored if page, pageid or oldid is used' ), - 'uselang' => 'Which language to parse the request in.', + 'uselang' => 'Which language to parse the request in', 'section' => 'Only retrieve the content of this section number', ); } diff --git a/includes/api/ApiPatrol.php b/includes/api/ApiPatrol.php index 5d14c00394..dc246ef5a5 100644 --- a/includes/api/ApiPatrol.php +++ b/includes/api/ApiPatrol.php @@ -84,7 +84,7 @@ class ApiPatrol extends ApiBase { public function getDescription() { return array( - 'Patrol a page or revision. ' + 'Patrol a page or revision' ); } diff --git a/includes/api/ApiProtect.php b/includes/api/ApiProtect.php index 856e4ef07f..6c43b4623e 100644 --- a/includes/api/ApiProtect.php +++ b/includes/api/ApiProtect.php @@ -179,7 +179,7 @@ class ApiProtect extends ApiBase { public function getParamDescription() { return array( - 'title' => 'Title of the page you want to (un)protect.', + 'title' => 'Title of the page you want to (un)protect', 'token' => 'A protect token previously retrieved through prop=info', 'protections' => 'Pipe-separated list of protection levels, formatted action=group (e.g. edit=sysop)', 'expiry' => array( 'Expiry timestamps. If only one timestamp is set, it\'ll be used for all protections.', @@ -194,7 +194,7 @@ class ApiProtect extends ApiBase { public function getDescription() { return array( - 'Change the protection level of a page.' + 'Change the protection level of a page' ); } diff --git a/includes/api/ApiPurge.php b/includes/api/ApiPurge.php index 5c83d34fa4..18e3299d9d 100644 --- a/includes/api/ApiPurge.php +++ b/includes/api/ApiPurge.php @@ -99,7 +99,7 @@ class ApiPurge extends ApiBase { public function getDescription() { return array( - 'Purge the cache for the given titles.' + 'Purge the cache for the given titles' ); } diff --git a/includes/api/ApiQuery.php b/includes/api/ApiQuery.php index 452c32688d..ec0c04d8b6 100644 --- a/includes/api/ApiQuery.php +++ b/includes/api/ApiQuery.php @@ -573,7 +573,7 @@ class ApiQuery extends ApiBase { 'generator' => array( 'Use the output of a list as the input for other prop/list/meta items', 'NOTE: generator parameter names must be prefixed with a \'g\', see examples.' ), 'redirects' => 'Automatically resolve redirects', - 'indexpageids' => 'Include an additional pageids section listing all returned page IDs.', + 'indexpageids' => 'Include an additional pageids section listing all returned page IDs', 'export' => 'Export the current revisions of all given or generated pages', 'exportnowrap' => 'Return the export XML without wrapping it in an XML result (same format as Special:Export). Can only be used with export', ); @@ -583,7 +583,7 @@ class ApiQuery extends ApiBase { return array( 'Query API module allows applications to get needed pieces of data from the MediaWiki databases,', 'and is loosely based on the old query.php interface.', - 'All data modifications will first have to use query to acquire a token to prevent abuse from malicious sites.' + 'All data modifications will first have to use query to acquire a token to prevent abuse from malicious sites' ); } diff --git a/includes/api/ApiQueryAllCategories.php b/includes/api/ApiQueryAllCategories.php index 5a5298d670..cca846a34a 100644 --- a/includes/api/ApiQueryAllCategories.php +++ b/includes/api/ApiQueryAllCategories.php @@ -154,10 +154,10 @@ class ApiQueryAllCategories extends ApiQueryGeneratorBase { public function getParamDescription() { return array( - 'from' => 'The category to start enumerating from.', - 'prefix' => 'Search for all category titles that begin with this value.', - 'dir' => 'Direction to sort in.', - 'limit' => 'How many categories to return.', + 'from' => 'The category to start enumerating from', + 'prefix' => 'Search for all category titles that begin with this value', + 'dir' => 'Direction to sort in', + 'limit' => 'How many categories to return', 'prop' => 'Which properties to get', ); } diff --git a/includes/api/ApiQueryAllLinks.php b/includes/api/ApiQueryAllLinks.php index 9e86e469cf..cf6d2abebe 100644 --- a/includes/api/ApiQueryAllLinks.php +++ b/includes/api/ApiQueryAllLinks.php @@ -184,13 +184,13 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase { public function getParamDescription() { return array( - 'from' => 'The page title to start enumerating from.', - 'prefix' => 'Search for all page titles that begin with this value.', - 'unique' => 'Only show unique links. Cannot be used with generator or prop=ids', + 'from' => 'The page title to start enumerating from', + 'prefix' => 'Search for all page titles that begin with this value', + 'unique' => "Only show unique links. Cannot be used with generator or {$this->getModulePrefix()}prop=ids", 'prop' => 'What pieces of information to include', - 'namespace' => 'The namespace to enumerate.', - 'limit' => 'How many total links to return.', - 'continue' => 'When more results are available, use this to continue.', + 'namespace' => 'The namespace to enumerate', + 'limit' => 'How many total links to return', + 'continue' => 'When more results are available, use this to continue', ); } diff --git a/includes/api/ApiQueryAllUsers.php b/includes/api/ApiQueryAllUsers.php index 67153c3234..9eebfb4905 100644 --- a/includes/api/ApiQueryAllUsers.php +++ b/includes/api/ApiQueryAllUsers.php @@ -221,13 +221,13 @@ class ApiQueryAllUsers extends ApiQueryBase { public function getParamDescription() { return array( - 'from' => 'The user name to start enumerating from.', - 'prefix' => 'Search for all page titles that begin with this value.', + 'from' => 'The user name to start enumerating from', + 'prefix' => 'Search for all page titles that begin with this value', 'group' => 'Limit users to a given group name', 'prop' => array( 'What pieces of information to include.', - '`groups` property uses more server resources and may return fewer results than the limit.' ), - 'limit' => 'How many total user names to return.', + '`groups` property uses more server resources and may return fewer results than the limit' ), + 'limit' => 'How many total user names to return', 'witheditsonly' => 'Only list users who have made edits', ); } diff --git a/includes/api/ApiQueryAllimages.php b/includes/api/ApiQueryAllimages.php index af91959eeb..8692e1bcd0 100644 --- a/includes/api/ApiQueryAllimages.php +++ b/includes/api/ApiQueryAllimages.php @@ -179,13 +179,13 @@ class ApiQueryAllimages extends ApiQueryGeneratorBase { public function getParamDescription() { return array( - 'from' => 'The image title to start enumerating from.', - 'prefix' => 'Search for all image titles that begin with this value.', + 'from' => 'The image title to start enumerating from', + 'prefix' => 'Search for all image titles that begin with this value', 'dir' => 'The direction in which to list', 'minsize' => 'Limit to images with at least this many bytes', 'maxsize' => 'Limit to images with at most this many bytes', - 'limit' => 'How many total images to return.', - 'sha1' => 'SHA1 hash of image. Overrides sha1base36', + 'limit' => 'How many images in total to return', + 'sha1' => "SHA1 hash of image. Overrides {$this->getModulePrefix()}sha1base36", 'sha1base36' => 'SHA1 hash of image in base 36 (used in MediaWiki)', 'prop' => 'Which properties to get', ); diff --git a/includes/api/ApiQueryAllmessages.php b/includes/api/ApiQueryAllmessages.php index 82d4f10b8f..4d021ba2b2 100644 --- a/includes/api/ApiQueryAllmessages.php +++ b/includes/api/ApiQueryAllmessages.php @@ -165,7 +165,7 @@ class ApiQueryAllmessages extends ApiQueryBase { } public function getDescription() { - return 'Return messages from this site.'; + return 'Return messages from this site'; } protected function getExamples() { diff --git a/includes/api/ApiQueryAllpages.php b/includes/api/ApiQueryAllpages.php index c4f86d02dd..f9b503b2f3 100644 --- a/includes/api/ApiQueryAllpages.php +++ b/includes/api/ApiQueryAllpages.php @@ -247,17 +247,18 @@ class ApiQueryAllpages extends ApiQueryGeneratorBase { } public function getParamDescription() { + $p = $this->getModulePrefix(); return array( - 'from' => 'The page title to start enumerating from.', - 'prefix' => 'Search for all page titles that begin with this value.', - 'namespace' => 'The namespace to enumerate.', - 'filterredir' => 'Which pages to list.', + 'from' => 'The page title to start enumerating from', + 'prefix' => 'Search for all page titles that begin with this value', + 'namespace' => 'The namespace to enumerate', + 'filterredir' => 'Which pages to list', 'dir' => 'The direction in which to list', 'minsize' => 'Limit to pages with at least this many bytes', 'maxsize' => 'Limit to pages with at most this many bytes', 'prtype' => 'Limit to protected pages only', - 'prlevel' => 'The protection level (must be used with apprtype= parameter)', - 'prfiltercascade' => 'Filter protections based on cascadingness (ignored when apprtype isn\'t set)', + 'prlevel' => "The protection level (must be used with {$p}prtype= parameter)", + 'prfiltercascade' => "Filter protections based on cascadingness (ignored when {$p}prtype isn't set)", 'filterlanglinks' => 'Filter based on whether a page has langlinks', 'limit' => 'How many total pages to return.' ); diff --git a/includes/api/ApiQueryBacklinks.php b/includes/api/ApiQueryBacklinks.php index a90969d783..a78bf08c80 100644 --- a/includes/api/ApiQueryBacklinks.php +++ b/includes/api/ApiQueryBacklinks.php @@ -435,9 +435,9 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { public function getParamDescription() { $retval = array( - 'title' => 'Title to search.', - 'continue' => 'When more results are available, use this to continue.', - 'namespace' => 'The namespace to enumerate.', + 'title' => 'Title to search', + 'continue' => 'When more results are available, use this to continue', + 'namespace' => 'The namespace to enumerate', ); if ( $this->getModuleName() != 'embeddedin' ) { return array_merge( $retval, array( @@ -448,7 +448,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { } return array_merge( $retval, array( 'filterredir' => 'How to filter for redirects', - 'limit' => 'How many total pages to return.' + 'limit' => 'How many total pages to return' ) ); } diff --git a/includes/api/ApiQueryBlocks.php b/includes/api/ApiQueryBlocks.php index 7ec8cbe970..712ae6b6d2 100644 --- a/includes/api/ApiQueryBlocks.php +++ b/includes/api/ApiQueryBlocks.php @@ -269,14 +269,14 @@ class ApiQueryBlocks extends ApiQueryBase { 'ids' => 'Pipe-separated list of block IDs to list (optional)', 'users' => 'Pipe-separated list of users to search for (optional)', 'ip' => array( 'Get all blocks applying to this IP or CIDR range, including range blocks.', - 'Cannot be used together with bkusers. CIDR ranges broader than /16 are not accepted.' ), + 'Cannot be used together with bkusers. CIDR ranges broader than /16 are not accepted' ), 'limit' => 'The maximum amount of blocks to list', 'prop' => 'Which properties to get', ); } public function getDescription() { - return 'List all blocked users and IP addresses.'; + return 'List all blocked users and IP addresses'; } public function getPossibleErrors() { diff --git a/includes/api/ApiQueryCategories.php b/includes/api/ApiQueryCategories.php index 4f66f79267..ff52598997 100644 --- a/includes/api/ApiQueryCategories.php +++ b/includes/api/ApiQueryCategories.php @@ -211,7 +211,7 @@ class ApiQueryCategories extends ApiQueryGeneratorBase { public function getParamDescription() { return array( - 'prop' => 'Which additional properties to get for each category.', + 'prop' => 'Which additional properties to get for each category', 'limit' => 'How many categories to return', 'show' => 'Which kind of categories to show', 'continue' => 'When more results are available, use this to continue', diff --git a/includes/api/ApiQueryCategoryMembers.php b/includes/api/ApiQueryCategoryMembers.php index f6662d8407..774e5969c7 100644 --- a/includes/api/ApiQueryCategoryMembers.php +++ b/includes/api/ApiQueryCategoryMembers.php @@ -258,16 +258,17 @@ class ApiQueryCategoryMembers extends ApiQueryGeneratorBase { public function getParamDescription() { global $wgMiserMode; + $p = $this->getModulePrefix(); $desc = array( 'title' => 'Which category to enumerate (required). Must include Category: prefix', 'prop' => 'What pieces of information to include', 'namespace' => 'Only include pages in these namespaces', 'sort' => 'Property to sort by', 'dir' => 'In which direction to sort', - 'start' => 'Timestamp to start listing from. Can only be used with cmsort=timestamp', - 'end' => 'Timestamp to end listing at. Can only be used with cmsort=timestamp', - 'startsortkey' => 'Sortkey to start listing from. Can only be used with cmsort=sortkey', - 'endsortkey' => 'Sortkey to end listing at. Can only be used with cmsort=sortkey', + 'start' => "Timestamp to start listing from. Can only be used with {$p}sort=timestamp", + 'end' => "Timestamp to end listing at. Can only be used with {$p}sort=timestamp", + 'startsortkey' => "Sortkey to start listing from. Can only be used with {$p}sort=sortkey", + 'endsortkey' => "Sortkey to end listing at. Can only be used with {$p}sort=sortkey", 'continue' => 'For large categories, give the value retured from previous query', 'limit' => 'The maximum number of pages to return.', ); @@ -275,7 +276,7 @@ class ApiQueryCategoryMembers extends ApiQueryGeneratorBase { $desc['namespace'] = array( $desc['namespace'], 'NOTE: Due to $wgMiserMode, using this may result in fewer than "limit" results', - 'returned before continuing; in extreme cases, zero results may be returned.', + 'returned before continuing; in extreme cases, zero results may be returned', ); } return $desc; diff --git a/includes/api/ApiQueryDeletedrevs.php b/includes/api/ApiQueryDeletedrevs.php index 580ab3dd6a..49bfafb40a 100644 --- a/includes/api/ApiQueryDeletedrevs.php +++ b/includes/api/ApiQueryDeletedrevs.php @@ -306,9 +306,9 @@ class ApiQueryDeletedrevs extends ApiQueryBase { public function getParamDescription() { return array( - 'start' => 'The timestamp to start enumerating from. (1,2)', - 'end' => 'The timestamp to stop enumerating at. (1,2)', - 'dir' => 'The direction in which to enumerate. (1,2)', + 'start' => 'The timestamp to start enumerating from (1,2)', + 'end' => 'The timestamp to stop enumerating at (1,2)', + 'dir' => 'The direction in which to enumerate (1,2)', 'limit' => 'The maximum amount of revisions to list', 'prop' => 'Which properties to get', 'namespace' => 'Only list pages in this namespace (3)', @@ -328,7 +328,7 @@ class ApiQueryDeletedrevs extends ApiQueryBase { '2) List deleted contributions for the given user, sorted by timestamp (no titles specified)', '3) List all deleted revisions in the given namespace, sorted by title and timestamp (no titles specified, druser not set)', 'Certain parameters only apply to some modes and are ignored in others.', - 'For instance, a parameter marked (1) only applies to mode 1 and is ignored in modes 2 and 3.', + 'For instance, a parameter marked (1) only applies to mode 1 and is ignored in modes 2 and 3', ); } diff --git a/includes/api/ApiQueryDuplicateFiles.php b/includes/api/ApiQueryDuplicateFiles.php index 5d86c94f91..6be546ef21 100644 --- a/includes/api/ApiQueryDuplicateFiles.php +++ b/includes/api/ApiQueryDuplicateFiles.php @@ -145,7 +145,7 @@ class ApiQueryDuplicateFiles extends ApiQueryGeneratorBase { } public function getDescription() { - return 'List all files that are duplicates of the given file(s).'; + return 'List all files that are duplicates of the given file(s)'; } public function getPossibleErrors() { diff --git a/includes/api/ApiQueryExtLinksUsage.php b/includes/api/ApiQueryExtLinksUsage.php index 639810ea1d..34e3c9428f 100644 --- a/includes/api/ApiQueryExtLinksUsage.php +++ b/includes/api/ApiQueryExtLinksUsage.php @@ -189,12 +189,13 @@ class ApiQueryExtLinksUsage extends ApiQueryGeneratorBase { } public function getParamDescription() { + $p = $this->getModulePrefix(); return array( 'prop' => 'What pieces of information to include', 'offset' => 'Used for paging. Use the value returned for "continue"', 'protocol' => array( - 'Protocol of the url. If empty and euquery set, the protocol is http.', - 'Leave both this and euquery empty to list all external links' + "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.', diff --git a/includes/api/ApiQueryFilearchive.php b/includes/api/ApiQueryFilearchive.php index 6444687057..0f44d27da1 100644 --- a/includes/api/ApiQueryFilearchive.php +++ b/includes/api/ApiQueryFilearchive.php @@ -217,13 +217,13 @@ class ApiQueryFilearchive extends ApiQueryBase { public function getParamDescription() { return array( - 'from' => 'The image title to start enumerating from.', - 'prefix' => 'Search for all image titles that begin with this value.', + 'from' => 'The image title to start enumerating from', + 'prefix' => 'Search for all image titles that begin with this value', 'dir' => 'The direction in which to list', 'minsize' => 'Limit to images with at least this many bytes', 'maxsize' => 'Limit to images with at most this many bytes', - 'limit' => 'How many total images to return.', - 'sha1' => 'SHA1 hash of image. Overrides sha1base36', + 'limit' => 'How many total images to return', + 'sha1' => "SHA1 hash of image. Overrides {$this->getModulePrefix()}sha1base36", 'sha1base36' => 'SHA1 hash of image in base 36 (used in MediaWiki)', 'prop' => 'Which properties to get', ); diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index 84e3616700..2ebc508dc0 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -318,14 +318,15 @@ class ApiQueryImageInfo extends ApiQueryBase { } public function getParamDescription() { + $p = $this->getModulePrefix(); return array( - 'prop' => 'What image information to get.', + 'prop' => 'What image information to get', 'limit' => 'How many image revisions to return', 'start' => 'Timestamp to start listing from', 'end' => 'Timestamp to stop listing at', - 'urlwidth' => array( 'If iiprop=url is set, a URL to an image scaled to this width will be returned.', - 'Only the current version of the image can be scaled.' ), - 'urlheight' => 'Similar to iiurlwidth. Cannot be used without iiurlwidth', + 'urlwidth' => array( "If {$p}prop=url is set, a URL to an image scaled to this width will be returned.", + 'Only the current version of the image can be scaled' ), + 'urlheight' => "Similar to {$p}urlwidth. Cannot be used without {$p}urlwidth", 'continue' => 'When more results are available, use this to continue', ); } diff --git a/includes/api/ApiQueryLinks.php b/includes/api/ApiQueryLinks.php index 08777fcb70..0dafc347b7 100644 --- a/includes/api/ApiQueryLinks.php +++ b/includes/api/ApiQueryLinks.php @@ -182,9 +182,10 @@ class ApiQueryLinks extends ApiQueryGeneratorBase { } public function getParamDescription() { + $desc = $this->description; return array( - 'namespace' => "Show {$this->description}s in this namespace(s) only", - 'limit' => "How many {$this->description}s to return", + 'namespace' => "Show {$desc}s in this namespace(s) only", + 'limit' => "How many {$desc}s to return", 'continue' => 'When more results are available, use this to continue', ); } diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php index 5c13172fe8..5d453ee746 100644 --- a/includes/api/ApiQueryLogEvents.php +++ b/includes/api/ApiQueryLogEvents.php @@ -356,18 +356,18 @@ class ApiQueryLogEvents extends ApiQueryBase { 'prop' => 'Which properties to get', 'type' => 'Filter log entries to only this type(s)', 'action' => "Filter log actions to only this type. Overrides {$this->getModulePrefix()}type", - 'start' => 'The timestamp to start enumerating from.', - 'end' => 'The timestamp to end enumerating.', - 'dir' => 'In which direction to enumerate.', - 'user' => 'Filter entries to those made by the given user.', - 'title' => 'Filter entries to those related to a page.', - 'limit' => 'How many total event entries to return.', - 'tag' => 'Only list event entries tagged with this tag.', + 'start' => 'The timestamp to start enumerating from', + 'end' => 'The timestamp to end enumerating', + 'dir' => 'In which direction to enumerate', + 'user' => 'Filter entries to those made by the given user', + 'title' => 'Filter entries to those related to a page', + 'limit' => 'How many total event entries to return', + 'tag' => 'Only list event entries tagged with this tag', ); } public function getDescription() { - return 'Get events from logs.'; + return 'Get events from logs'; } public function getPossibleErrors() { diff --git a/includes/api/ApiQueryProtectedTitles.php b/includes/api/ApiQueryProtectedTitles.php index 9f5b51a18e..7f758fcff5 100644 --- a/includes/api/ApiQueryProtectedTitles.php +++ b/includes/api/ApiQueryProtectedTitles.php @@ -183,7 +183,7 @@ class ApiQueryProtectedTitles extends ApiQueryGeneratorBase { 'start' => 'Start listing at this protection timestamp', 'end' => 'Stop listing at this protection timestamp', 'dir' => 'The direction in which to list', - 'limit' => 'How many total pages to return.', + 'limit' => 'How many total pages to return', 'prop' => 'Which properties to get', 'level' => 'Only list titles with these protection levels', ); diff --git a/includes/api/ApiQueryRandom.php b/includes/api/ApiQueryRandom.php index 3135e547f8..85863abc1c 100644 --- a/includes/api/ApiQueryRandom.php +++ b/includes/api/ApiQueryRandom.php @@ -149,8 +149,8 @@ if ( !defined( 'MEDIAWIKI' ) ) { return array( 'Get a set of random pages', 'NOTE: Pages are listed in a fixed sequence, only the starting point is random. This means that if, for example, "Main Page" is the first ', - ' random page on your list, "List of fictional monkeys" will *always* be second, "List of people on stamps of Vanuatu" third, etc.', - 'NOTE: If the number of pages in the namespace is lower than rnlimit, you will get fewer pages. You will not get the same page twice.' + ' random page on your list, "List of fictional monkeys" will *always* be second, "List of people on stamps of Vanuatu" third, etc', + 'NOTE: If the number of pages in the namespace is lower than rnlimit, you will get fewer pages. You will not get the same page twice' ); } diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php index 1955e4a9e6..abace8f803 100644 --- a/includes/api/ApiQueryRecentChanges.php +++ b/includes/api/ApiQueryRecentChanges.php @@ -530,9 +530,9 @@ class ApiQueryRecentChanges extends ApiQueryBase { public function getParamDescription() { return array( - 'start' => 'The timestamp to start enumerating from.', - 'end' => 'The timestamp to end enumerating.', - 'dir' => 'In which direction to enumerate.', + 'start' => 'The timestamp to start enumerating from', + 'end' => 'The timestamp to end enumerating', + 'dir' => 'In which direction to enumerate', 'namespace' => 'Filter log entries to only this namespace(s)', 'user' => 'Only list changes by this user', 'excludeuser' => 'Don\'t list changes by this user', @@ -540,11 +540,11 @@ class ApiQueryRecentChanges extends ApiQueryBase { 'token' => 'Which tokens to obtain for each change', 'show' => array( 'Show only items that meet this criteria.', - 'For example, to see only minor edits done by logged-in users, set show=minor|!anon' + "For example, to see only minor edits done by logged-in users, set {$this->getModulePrefix()}show=minor|!anon" ), - 'type' => 'Which types of changes to show.', - 'limit' => 'How many total changes to return.', - 'tag' => 'Only list changes tagged with this tag.', + 'type' => 'Which types of changes to show', + 'limit' => 'How many total changes to return', + 'tag' => 'Only list changes tagged with this tag', ); } diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index 0c4d870af9..f167a07586 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -546,8 +546,9 @@ class ApiQueryRevisions extends ApiQueryBase { } public function getParamDescription() { + $p = $this->getModulePrefix(); return array( - 'prop' => 'Which properties to get for each revision.', + 'prop' => 'Which properties to get for each revision', 'limit' => 'Limit how many revisions will be returned (enum)', 'startid' => 'From which revision id to start enumeration (enum)', 'endid' => 'Stop revision enumeration on this revid (enum)', @@ -562,21 +563,21 @@ class ApiQueryRevisions extends ApiQueryBase { 'token' => 'Which tokens to obtain for each revision', 'continue' => 'When more results are available, use this to continue', 'diffto' => array( 'Revision ID to diff each revision to.', - 'Use "prev", "next" and "cur" for the previous, next and current revision respectively.' ), + 'Use "prev", "next" and "cur" for the previous, next and current revision respectively' ), 'difftotext' => array( 'Text to diff each revision to. Only diffs a limited number of revisions.', - 'Overrides diffto. If rvsection is set, only that section will be diffed against this text.' ), + "Overrides {$p}diffto. If {$p}section is set, only that section will be diffed against this text" ), 'tag' => 'Only list revisions tagged with this tag', ); } public function getDescription() { return array( - 'Get revision information.', + 'Get revision information', 'This module may be used in several ways:', - ' 1) Get data about a set of pages (last revision), by setting titles or pageids parameter.', - ' 2) Get revisions for one given page, by using titles/pageids with start/end/limit params.', - ' 3) Get data about a set of revisions by setting their IDs with revids parameter.', - 'All parameters marked as (enum) may only be used with a single page (#2).' + ' 1) Get data about a set of pages (last revision), by setting titles or pageids parameter', + ' 2) Get revisions for one given page, by using titles/pageids with start/end/limit params', + ' 3) Get data about a set of revisions by setting their IDs with revids parameter', + 'All parameters marked as (enum) may only be used with a single page (#2)' ); } diff --git a/includes/api/ApiQuerySearch.php b/includes/api/ApiQuerySearch.php index 9e42caf7af..5d3322d92c 100644 --- a/includes/api/ApiQuerySearch.php +++ b/includes/api/ApiQuerySearch.php @@ -209,14 +209,14 @@ class ApiQuerySearch extends ApiQueryGeneratorBase { public function getParamDescription() { return array( - 'search' => 'Search for all page titles (or content) that has this value.', - 'namespace' => 'The namespace(s) to enumerate.', - 'what' => 'Search inside the text or titles.', - 'info' => 'What metadata to return.', - 'prop' => 'What properties to return.', - 'redirects' => 'Include redirect pages in the search.', + 'search' => 'Search for all page titles (or content) that has this value', + 'namespace' => 'The namespace(s) to enumerate', + 'what' => 'Search inside the text or titles', + 'info' => 'What metadata to return', + 'prop' => 'What properties to return', + 'redirects' => 'Include redirect pages in the search', 'offset' => 'Use this value to continue paging (return by query)', - 'limit' => 'How many total pages to return.' + 'limit' => 'How many total pages to return' ); } diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index 7b6bc3951e..e380344234 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -486,7 +486,7 @@ class ApiQuerySiteinfo extends ApiQueryBase { } public function getDescription() { - return 'Return general information about the site.'; + return 'Return general information about the site'; } public function getPossibleErrors() { diff --git a/includes/api/ApiQueryTags.php b/includes/api/ApiQueryTags.php index 18d14fe9e8..87c9a16569 100644 --- a/includes/api/ApiQueryTags.php +++ b/includes/api/ApiQueryTags.php @@ -166,7 +166,7 @@ class ApiQueryTags extends ApiQueryBase { } public function getDescription() { - return 'List change tags.'; + return 'List change tags'; } protected function getExamples() { diff --git a/includes/api/ApiQueryUserContributions.php b/includes/api/ApiQueryUserContributions.php index 526014dd74..4d4e156017 100644 --- a/includes/api/ApiQueryUserContributions.php +++ b/includes/api/ApiQueryUserContributions.php @@ -410,18 +410,19 @@ class ApiQueryContributions extends ApiQueryBase { } public function getParamDescription() { + $p = $this->getModulePrefix(); return array( - 'limit' => 'The maximum number of contributions to return.', - 'start' => 'The start timestamp to return from.', - 'end' => 'The end timestamp to return to.', - 'continue' => 'When more results are available, use this to continue.', - 'user' => 'The user to retrieve contributions for.', - 'userprefix' => 'Retrieve contibutions for all users whose names begin with this value. Overrides ucuser.', - 'dir' => 'The direction to search (older or newer).', + 'limit' => 'The maximum number of contributions to return', + 'start' => 'The start timestamp to return from', + 'end' => 'The end timestamp to return to', + 'continue' => 'When more results are available, use this to continue', + 'user' => 'The user to retrieve contributions for', + 'userprefix' => "Retrieve contibutions for all users whose names begin with this value. Overrides {$p}user", + 'dir' => 'The direction to search (older or newer)', 'namespace' => 'Only list contributions in these namespaces', 'prop' => 'Include additional pieces of information', - 'show' => array( 'Show only items that meet this criteria, e.g. non minor edits only: show=!minor', - 'NOTE: if show=patrolled or show=!patrolled is set, revisions older than $wgRCMaxAge won\'t be shown', ), + 'show' => array( "Show only items that meet this criteria, e.g. non minor edits only: {$p}show=!minor", + "NOTE: if show=patrolled or {$p}show=!patrolled is set, revisions older than $wgRCMaxAge won\'t be shown", ), 'tag' => 'Only list revisions tagged with this tag', ); } diff --git a/includes/api/ApiQueryWatchlist.php b/includes/api/ApiQueryWatchlist.php index 80f7fe137b..f301ab388f 100644 --- a/includes/api/ApiQueryWatchlist.php +++ b/includes/api/ApiQueryWatchlist.php @@ -363,21 +363,21 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { public function getParamDescription() { return array( - 'allrev' => 'Include multiple revisions of the same page within given timeframe.', - 'start' => 'The timestamp to start enumerating from.', - 'end' => 'The timestamp to end enumerating.', - 'namespace' => 'Filter changes to only the given namespace(s).', + 'allrev' => 'Include multiple revisions of the same page within given timeframe', + 'start' => 'The timestamp to start enumerating from', + 'end' => 'The timestamp to end enumerating', + 'namespace' => 'Filter changes to only the given namespace(s)', 'user' => 'Only list changes by this user', 'excludeuser' => 'Don\'t list changes by this user', - 'dir' => 'In which direction to enumerate pages.', - 'limit' => 'How many total results to return per request.', + 'dir' => 'In which direction to enumerate pages', + 'limit' => 'How many total results to return per request', 'prop' => 'Which additional items to get (non-generator mode only).', 'show' => array( 'Show only items that meet this criteria.', - 'For example, to see only minor edits done by logged-in users, set show=minor|!anon' + "For example, to see only minor edits done by logged-in users, set {$this->getModulePrefix()}show=minor|!anon" ), - 'owner' => "The name of the user whose watchlist you'd like to access", - 'token' => "Give a security token (settable in preferences) to allow access to another user's watchlist" + 'owner' => 'The name of the user whose watchlist you\'d like to access', + 'token' => 'Give a security token (settable in preferences) to allow access to another user\'s watchlist' ); } diff --git a/includes/api/ApiQueryWatchlistRaw.php b/includes/api/ApiQueryWatchlistRaw.php index c1b52c8f0d..cddca0202c 100644 --- a/includes/api/ApiQueryWatchlistRaw.php +++ b/includes/api/ApiQueryWatchlistRaw.php @@ -164,10 +164,10 @@ class ApiQueryWatchlistRaw extends ApiQueryGeneratorBase { public function getParamDescription() { return array( 'continue' => 'When more results are available, use this to continue', - 'namespace' => 'Only list pages in the given namespace(s).', - 'limit' => 'How many total results to return per request.', - 'prop' => 'Which additional properties to get (non-generator mode only).', - 'show' => 'Only list items that meet these criteria.', + 'namespace' => 'Only list pages in the given namespace(s)', + 'limit' => 'How many total results to return per request', + 'prop' => 'Which additional properties to get (non-generator mode only)', + 'show' => 'Only list items that meet these criteria', ); } diff --git a/includes/api/ApiRollback.php b/includes/api/ApiRollback.php index 2301e3adfe..ad5c16fcdd 100644 --- a/includes/api/ApiRollback.php +++ b/includes/api/ApiRollback.php @@ -98,8 +98,8 @@ class ApiRollback extends ApiBase { return array( 'title' => 'Title of the page you want to rollback.', 'user' => 'Name of the user whose edits are to be rolled back. If set incorrectly, you\'ll get a badtoken error.', - 'token' => 'A rollback token previously retrieved through prop=revisions', - 'summary' => 'Custom edit summary. If not set, default summary will be used.', + 'token' => "A rollback token previously retrieved through {$this->getModulePrefix()}prop=revisions", + 'summary' => 'Custom edit summary. If not set, default summary will be used', 'markbot' => 'Mark the reverted edits and the revert as bot edits', 'watchlist' => 'Unconditionally add or remove the page from your watchlist, use preferences or do not change watch', ); @@ -108,7 +108,7 @@ class ApiRollback extends ApiBase { public function getDescription() { return array( 'Undo the last edit to the page. If the last user who edited the page made multiple edits in a row,', - 'they will all be rolled back.' + 'they will all be rolled back' ); } diff --git a/includes/api/ApiUnblock.php b/includes/api/ApiUnblock.php index f1eb12ae50..f146075d6a 100644 --- a/includes/api/ApiUnblock.php +++ b/includes/api/ApiUnblock.php @@ -103,10 +103,11 @@ class ApiUnblock extends ApiBase { } public function getParamDescription() { + $p = $this->getModulePrefix(); return array( - 'id' => 'ID of the block you want to unblock (obtained through list=blocks). Cannot be used together with user', - 'user' => 'Username, IP address or IP range you want to unblock. Cannot be used together with id', - 'token' => 'An unblock token previously obtained through the gettoken parameter or prop=info', + 'id' => "ID of the block you want to unblock (obtained through list=blocks). Cannot be used together with {$p}user", + 'user' => "Username, IP address or IP range you want to unblock. Cannot be used together with {$p}id", + 'token' => "An unblock token previously obtained through the gettoken parameter or {$p}prop=info", 'gettoken' => 'If set, an unblock token will be returned, and no other action will be taken', 'reason' => 'Reason for unblock (optional)', ); @@ -114,7 +115,7 @@ class ApiUnblock extends ApiBase { public function getDescription() { return array( - 'Unblock a user.' + 'Unblock a user' ); } diff --git a/includes/api/ApiUndelete.php b/includes/api/ApiUndelete.php index 4cdf34743a..0637725995 100644 --- a/includes/api/ApiUndelete.php +++ b/includes/api/ApiUndelete.php @@ -121,7 +121,7 @@ class ApiUndelete extends ApiBase { public function getParamDescription() { return array( - 'title' => 'Title of the page you want to restore.', + 'title' => 'Title of the page you want to restore', 'token' => 'An undelete token previously retrieved through list=deletedrevs', 'reason' => 'Reason for restoring (optional)', 'timestamps' => 'Timestamps of the revisions to restore. If not set, all revisions will be restored.', diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index 6d02fa3544..543b890d35 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -338,7 +338,7 @@ class ApiUpload extends ApiBase { 'Note that the HTTP POST must be done as a file upload (i.e. using multipart/form-data) when', 'sending the "file". Note also that queries using session keys must be', 'done in the same login session as the query that originally returned the key (i.e. do not', - 'log out and then log back in). Also you must get and send an edit token before doing any upload stuff.' + 'log out and then log back in). Also you must get and send an edit token before doing any upload stuff' ); } diff --git a/includes/api/ApiUserrights.php b/includes/api/ApiUserrights.php index dfb5f19b53..9686217e50 100644 --- a/includes/api/ApiUserrights.php +++ b/includes/api/ApiUserrights.php @@ -54,6 +54,29 @@ class ApiUserrights extends ApiBase { $this->getResult()->setIndexedTagName( $r['removed'], 'group' ); $this->getResult()->addValue( null, $this->getModuleName(), $r ); } + + private function getUser() { + if ( $this->mUser !== null ) { + return $this->mUser; + } + + $params = $this->extractRequestParams(); + if ( is_null( $params['user'] ) ) { + $this->dieUsageMsg( array( 'missingparam', 'user' ) ); + } + + $form = new UserrightsPage; + $status = $form->fetchUser( $params['user'] ); + if ( !$status->isOK() ) { + $errors = $status->getErrorsArray(); + $this->dieUsageMsg( $errors[0] ); + } else { + $user = $status->value; + } + + $this->mUser = $user; + return $user; + } public function mustBePosted() { return true; @@ -107,29 +130,6 @@ class ApiUserrights extends ApiBase { return $this->getUser()->getName(); } - private function getUser() { - if ( $this->mUser !== null ) { - return $this->mUser; - } - - $params = $this->extractRequestParams(); - if ( is_null( $params['user'] ) ) { - $this->dieUsageMsg( array( 'missingparam', 'user' ) ); - } - - $form = new UserrightsPage; - $status = $form->fetchUser( $params['user'] ); - if ( !$status->isOK() ) { - $errors = $status->getErrorsArray(); - $this->dieUsageMsg( $errors[0] ); - } else { - $user = $status->value; - } - - $this->mUser = $user; - return $user; - } - protected function getExamples() { return array( 'api.php?action=userrights&user=FooBot&add=bot&remove=sysop|bureaucrat&token=123ABC' -- 2.20.1