forget to shutdown classes in ApiQuery.php
[lhc/web/wiklou.git] / includes / api / ApiFeedWatchlist.php
index 346de65..4f2bb39 100644 (file)
@@ -33,7 +33,7 @@ if (!defined('MEDIAWIKI')) {
  * When executed, it performs a nested call to the API to get the needed data,
  * and formats it in a proper format.
  *
- * @addtogroup API
+ * @ingroup API
  */
 class ApiFeedWatchlist extends ApiBase {
 
@@ -75,6 +75,11 @@ class ApiFeedWatchlist extends ApiBase {
                                'wllimit' => (50 > $wgFeedLimit) ? $wgFeedLimit : 50
                        );
 
+                       if (!is_null($params['wlowner']))
+                               $fauxReqArr['wlowner'] = $params['wlowner'];
+                       if (!is_null($params['wltoken']))
+                               $fauxReqArr['wltoken'] = $params['wltoken'];
+
                        // Check for 'allrev' parameter, and if found, show all revisions to each page on wl.
                        if ( ! is_null ( $params['allrev'] ) )  $fauxReqArr['wlallrev'] = '';
 
@@ -89,7 +94,7 @@ class ApiFeedWatchlist extends ApiBase {
                        $data = $module->getResultData();
 
                        $feedItems = array ();
-                       foreach ($data['query']['watchlist'] as $info) {
+                       foreach ((array)$data['query']['watchlist'] as $info) {
                                $feedItems[] = $this->createFeedItem($info);
                        }
 
@@ -152,7 +157,13 @@ class ApiFeedWatchlist extends ApiBase {
                                ApiBase :: PARAM_MIN => 1,
                                ApiBase :: PARAM_MAX => 72,
                        ),
-                       'allrev' => null
+                       'allrev' => null,
+                       'wlowner' => array (
+                               ApiBase :: PARAM_TYPE => 'user'
+                       ),
+                       'wltoken' => array (
+                               ApiBase :: PARAM_TYPE => 'string'
+                       )
                );
        }
 
@@ -160,7 +171,9 @@ 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.'
+                       '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)",
+                       'wltoken'    => 'Security token that requested user set in their preferences'
                );
        }