From: Daniel Cannon Date: Wed, 26 Sep 2007 03:24:01 +0000 (+0000) Subject: (bug 11218) Add 'allrev' parameter option to feedwatchlist, to allow multiple revisio... X-Git-Tag: 1.31.0-rc.0~51286 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=fc73e9eedbcae59709c9e5d75f4555d5adada668;p=lhc%2Fweb%2Fwiklou.git (bug 11218) Add 'allrev' parameter option to feedwatchlist, to allow multiple revisions for each page to displayed. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 5335fe029d..b8be283524 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -80,6 +80,7 @@ Full API documentation is available at http://www.mediawiki.org/wiki/API * (bug 11296) Temporary fix for escaping of ampersands inside links in pretty-printed help document. * (bug 11405) Expand templates implementation in the API +* (bug 11218) Add option to feedwatchlist to display multiple revisions for each page. === Languages updated in 1.12 === diff --git a/includes/api/ApiFeedWatchlist.php b/includes/api/ApiFeedWatchlist.php index f4ca6aa9a2..02bbbaa6a1 100644 --- a/includes/api/ApiFeedWatchlist.php +++ b/includes/api/ApiFeedWatchlist.php @@ -62,8 +62,8 @@ class ApiFeedWatchlist extends ApiBase { // limit to the number of hours going from now back $endTime = wfTimestamp(TS_MW, time() - intval($params['hours'] * 60 * 60)); - // Prepare nested request - $fauxReq = new FauxRequest(array ( + // Prepare parameters for nested request + $fauxReqArr = array ( 'action' => 'query', 'meta' => 'siteinfo', 'siprop' => 'general', @@ -72,7 +72,13 @@ class ApiFeedWatchlist extends ApiBase { 'wldir' => 'older', // reverse order - from newest to oldest 'wlend' => $endTime, // stop at this time 'wllimit' => 50 - )); + ); + + // Check for 'allrev' parameter, and if found, show all revisions to each page on wl. + if ( ! is_null ( $params['allrev'] ) ) $fauxReqArr['wlallrev'] = ''; + + // Create the request + $fauxReq = new FauxRequest ( $fauxReqArr ); // Execute $module = new ApiMain($fauxReq); @@ -144,14 +150,16 @@ class ApiFeedWatchlist extends ApiBase { ApiBase :: PARAM_TYPE => 'integer', ApiBase :: PARAM_MIN => 1, ApiBase :: PARAM_MAX => 72, - ) + ), + 'allrev' => null ); } protected function getParamDescription() { return array ( 'feedformat' => 'The format of the feed', - 'hours' => 'List pages modified within this many hours from now' + 'hours' => 'List pages modified within this many hours from now', + 'allrev' => 'Include multiple revisions of the same page within given timeframe.' ); }