From: Sam Reed Date: Sat, 12 Mar 2011 23:39:15 +0000 (+0000) Subject: * (bug 27670) Ordering by timestamp (and usage of start and end) isn't as clear in... X-Git-Tag: 1.31.0-rc.0~31485 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=8c6f2012b9244c9e3fb7719292446bb658cc0eea;p=lhc%2Fweb%2Fwiklou.git * (bug 27670) Ordering by timestamp (and usage of start and end) isn't as clear in auto generated document, as it is on mw.org where dir = (newer|older) Will look at doing (asc|desc)(ending)? --- diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php index e49da10f73..483c99a98c 100644 --- a/includes/api/ApiQueryBase.php +++ b/includes/api/ApiQueryBase.php @@ -440,6 +440,14 @@ abstract class ApiQueryBase extends ApiBase { return substr( $this->keyToTitle( $keyPart . 'x' ), 0, - 1 ); } + public function getDirectionDescription( $p = '', $extraDirText = '' ) { + return array( + "In which direction to enumerate{$extraDirText}", + " newer - List oldest first. Note: {$p}start has to be before {$p}end.", + " older - List newest first (default). Note: {$p}start has to be later than {$p}end.", + ); + } + /** * @param $query String * @param $protocol String diff --git a/includes/api/ApiQueryBlocks.php b/includes/api/ApiQueryBlocks.php index 477d979dc6..584a0498e4 100644 --- a/includes/api/ApiQueryBlocks.php +++ b/includes/api/ApiQueryBlocks.php @@ -278,7 +278,7 @@ class ApiQueryBlocks extends ApiQueryBase { return array( 'start' => 'The timestamp to start enumerating from', 'end' => 'The timestamp to stop enumerating at', - 'dir' => 'The direction in which to enumerate', + 'dir' => $this->getDirectionDescription( $this->getModulePrefix() ), '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.', diff --git a/includes/api/ApiQueryDeletedrevs.php b/includes/api/ApiQueryDeletedrevs.php index 230b9de61a..c4b410c3ac 100644 --- a/includes/api/ApiQueryDeletedrevs.php +++ b/includes/api/ApiQueryDeletedrevs.php @@ -314,7 +314,7 @@ class ApiQueryDeletedrevs extends ApiQueryBase { 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)', + 'dir' => $this->getDirectionDescription( $this->getModulePrefix(), ' (1,2)' ), 'limit' => 'The maximum amount of revisions to list', 'prop' => array( 'Which properties to get', diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php index 34dcc598f1..42401818c4 100644 --- a/includes/api/ApiQueryLogEvents.php +++ b/includes/api/ApiQueryLogEvents.php @@ -402,7 +402,7 @@ class ApiQueryLogEvents extends ApiQueryBase { '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', + 'dir' => $this->getDirectionDescription( $p ), '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', diff --git a/includes/api/ApiQueryProtectedTitles.php b/includes/api/ApiQueryProtectedTitles.php index 66162c2391..32249a7415 100644 --- a/includes/api/ApiQueryProtectedTitles.php +++ b/includes/api/ApiQueryProtectedTitles.php @@ -203,7 +203,7 @@ class ApiQueryProtectedTitles extends ApiQueryGeneratorBase { 'namespace' => 'Only list titles in these namespaces', 'start' => 'Start listing at this protection timestamp', 'end' => 'Stop listing at this protection timestamp', - 'dir' => 'The direction in which to list', + 'dir' => $this->getDirectionDescription( $this->getModulePrefix() ), 'limit' => 'How many total pages to return', 'prop' => array( 'Which properties to get', diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php index 3cc22832fc..76993017ac 100644 --- a/includes/api/ApiQueryRecentChanges.php +++ b/includes/api/ApiQueryRecentChanges.php @@ -582,10 +582,11 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase { } public function getParamDescription() { + $p = $this->getModulePrefix(); return array( 'start' => 'The timestamp to start enumerating from', 'end' => 'The timestamp to end enumerating', - 'dir' => 'In which direction to enumerate', + 'dir' => $this->getDirectionDescription( $p ), 'namespace' => 'Filter log entries to only this namespace(s)', 'user' => 'Only list changes by this user', 'excludeuser' => 'Don\'t list changes by this user', @@ -608,7 +609,7 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase { '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 {$this->getModulePrefix()}show=minor|!anon" + "For example, to see only minor edits done by logged-in users, set {$p}show=minor|!anon" ), 'type' => 'Which types of changes to show', 'limit' => 'How many total changes to return', diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index 8caa8687ba..c17ea06d75 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -614,7 +614,7 @@ class ApiQueryRevisions extends ApiQueryBase { 'endid' => 'Stop revision enumeration on this revid (enum)', 'start' => 'From which revision timestamp to start enumeration (enum)', 'end' => 'Enumerate up to this timestamp (enum)', - 'dir' => 'Direction of enumeration - towards "newer" or "older" revisions (enum)', + 'dir' => $this->getDirectionDescription( $p ), 'user' => 'Only include revisions made by user', 'excludeuser' => 'Exclude revisions made by user', 'expandtemplates' => 'Expand templates in revision content', diff --git a/includes/api/ApiQueryUserContributions.php b/includes/api/ApiQueryUserContributions.php index c0cb76eb60..1e94bb117a 100644 --- a/includes/api/ApiQueryUserContributions.php +++ b/includes/api/ApiQueryUserContributions.php @@ -422,7 +422,7 @@ class ApiQueryContributions extends ApiQueryBase { 'continue' => 'When more results are available, use this to continue', 'user' => 'The users 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)', + 'dir' => $this->getDirectionDescription( $p ), 'namespace' => 'Only list contributions in these namespaces', 'prop' => array( 'Include additional pieces of information', diff --git a/includes/api/ApiQueryWatchlist.php b/includes/api/ApiQueryWatchlist.php index 5367e6a1c1..0cc53a32c6 100644 --- a/includes/api/ApiQueryWatchlist.php +++ b/includes/api/ApiQueryWatchlist.php @@ -364,6 +364,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { } public function getParamDescription() { + $p = $this->getModulePrefix(); return array( 'allrev' => 'Include multiple revisions of the same page within given timeframe', 'start' => 'The timestamp to start enumerating from', @@ -371,7 +372,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { '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', + 'dir' => $this->getDirectionDescription( $p ), 'limit' => 'How many total results to return per request', 'prop' => array( 'Which additional items to get (non-generator mode only).', @@ -389,7 +390,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { ), 'show' => array( 'Show only items that meet this criteria.', - "For example, to see only minor edits done by logged-in users, set {$this->getModulePrefix()}show=minor|!anon" + "For example, to see only minor edits done by logged-in users, set {$p}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'