diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2012-05-03 13:01:35 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2012-05-03 13:01:35 +0200 |
commit | d9022f63880ce039446fba8364f68e656b7bf4cb (patch) | |
tree | 16b40fbf17bf7c9ee6f4ead25b16dd192378050a /includes/api/ApiFeedWatchlist.php | |
parent | 27cf83d177256813e2e802241085fce5dd0f3fb9 (diff) |
Update to MediaWiki 1.19.0
Diffstat (limited to 'includes/api/ApiFeedWatchlist.php')
-rw-r--r-- | includes/api/ApiFeedWatchlist.php | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/includes/api/ApiFeedWatchlist.php b/includes/api/ApiFeedWatchlist.php index dd7e3d8f..eee8fa19 100644 --- a/includes/api/ApiFeedWatchlist.php +++ b/includes/api/ApiFeedWatchlist.php @@ -24,11 +24,6 @@ * @file */ -if ( !defined( 'MEDIAWIKI' ) ) { - // Eclipse helper - will be ignored in production - require_once( "ApiBase.php" ); -} - /** * This action allows users to get their watchlist items in RSS/Atom formats. * When executed, it performs a nested call to the API to get the needed data, @@ -44,6 +39,8 @@ class ApiFeedWatchlist extends ApiBase { /** * This module uses a custom feed wrapper printer. + * + * @return ApiFormatFeedWrapper */ public function getCustomPrinter() { return new ApiFormatFeedWrapper( $this->getMain() ); @@ -68,6 +65,9 @@ class ApiFeedWatchlist extends ApiBase { if( !isset( $wgFeedClasses[ $params['feedformat'] ] ) ) { $this->dieUsage( 'Invalid subscription feed type', 'feed-invalid' ); } + if ( !is_null( $params['wlexcludeuser'] ) ) { + $fauxReqArr['wlexcludeuser'] = $params['wlexcludeuser']; + } // limit to the number of hours going from now back $endTime = wfTimestamp( TS_MW, time() - intval( $params['hours'] * 60 * 60 ) ); @@ -150,6 +150,10 @@ class ApiFeedWatchlist extends ApiBase { } } + /** + * @param $info array + * @return FeedItem + */ private function createFeedItem( $info ) { $titleStr = $info['title']; $title = Title::newFromText( $titleStr ); @@ -188,6 +192,9 @@ class ApiFeedWatchlist extends ApiBase { 'wltoken' => array( ApiBase::PARAM_TYPE => 'string' ), + 'wlexcludeuser' => array( + ApiBase::PARAM_TYPE => 'user' + ), 'linktodiffs' => false, ); } @@ -197,9 +204,10 @@ class ApiFeedWatchlist extends ApiBase { '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 {$this->getModulePrefix()}token if it's not you)", + 'wlowner' => "The user whose watchlist you want (must be accompanied by {$this->getModulePrefix()}wltoken if it's not you)", 'wltoken' => 'Security token that requested user set in their preferences', - 'linktodiffs' => 'Link to change differences instead of article pages' + 'wlexcludeuser' => 'A user whose edits should not be shown in the watchlist', + 'linktodiffs' => 'Link to change differences instead of article pages', ); } @@ -214,7 +222,7 @@ class ApiFeedWatchlist extends ApiBase { ) ); } - protected function getExamples() { + public function getExamples() { return array( 'api.php?action=feedwatchlist', 'api.php?action=feedwatchlist&allrev=&linktodiffs=&hours=6' |