+ public function getAllowedParams( $flags = 0 ) {
+ $feedFormatNames = array_keys( $this->getConfig()->get( 'FeedClasses' ) );
+ $ret = [
+ 'feedformat' => [
+ ApiBase::PARAM_DFLT => 'rss',
+ ApiBase::PARAM_TYPE => $feedFormatNames
+ ],
+ 'hours' => [
+ ApiBase::PARAM_DFLT => 24,
+ ApiBase::PARAM_TYPE => 'integer',
+ ApiBase::PARAM_MIN => 1,
+ ApiBase::PARAM_MAX => 72,
+ ],
+ 'linktosections' => false,
+ ];
+
+ $copyParams = [
+ 'allrev' => 'allrev',
+ 'owner' => 'wlowner',
+ 'token' => 'wltoken',
+ 'show' => 'wlshow',
+ 'type' => 'wltype',
+ 'excludeuser' => 'wlexcludeuser',
+ ];
+ if ( $flags ) {
+ $wlparams = $this->getWatchlistModule()->getAllowedParams( $flags );
+ foreach ( $copyParams as $from => $to ) {
+ $p = $wlparams[$from];
+ if ( !is_array( $p ) ) {
+ $p = [ ApiBase::PARAM_DFLT => $p ];
+ }
+ if ( !isset( $p[ApiBase::PARAM_HELP_MSG] ) ) {
+ $p[ApiBase::PARAM_HELP_MSG] = "apihelp-query+watchlist-param-$from";
+ }
+ if ( isset( $p[ApiBase::PARAM_TYPE] ) && is_array( $p[ApiBase::PARAM_TYPE] ) &&
+ isset( $p[ApiBase::PARAM_HELP_MSG_PER_VALUE] )
+ ) {
+ foreach ( $p[ApiBase::PARAM_TYPE] as $v ) {
+ if ( !isset( $p[ApiBase::PARAM_HELP_MSG_PER_VALUE][$v] ) ) {
+ $p[ApiBase::PARAM_HELP_MSG_PER_VALUE][$v] = "apihelp-query+watchlist-paramvalue-$from-$v";
+ }
+ }
+ }
+ $ret[$to] = $p;
+ }
+ } else {
+ foreach ( $copyParams as $from => $to ) {
+ $ret[$to] = null;
+ }
+ }
+
+ return $ret;