- $f .= "\t" . Html::hidden( $name, $value ) . "\n";
- }
-
- $tagFilter = ChangeTags::buildTagFilterSelector( $this->opts['tagFilter'] );
-
- $fNS = '';
- $fShowDiff = '';
- if ( !$wgMiserMode ) {
- $fNS = Html::rawElement( 'span', array( 'style' => 'white-space: nowrap' ),
- Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' ' .
- Xml::namespaceSelector( $this->opts['namespace'], '' )
- );
- $fShowDiff = Xml::checkLabel( wfMsg( 'sp-contributions-showsizediff' ), 'showSizeDiff', 'mw-show-size-diff', $this->opts['showSizeDiff'] );
- }
-
- $f .= Xml::fieldset( wfMsg( 'sp-contributions-search' ) ) .
- Xml::radioLabel( wfMsgExt( 'sp-contributions-newbies', array( 'parsemag' ) ),
- 'contribs', 'newbie' , 'newbie', $this->opts['contribs'] == 'newbie' ) . '<br />' .
- Xml::radioLabel( wfMsgExt( 'sp-contributions-username', array( 'parsemag' ) ),
- 'contribs' , 'user', 'user', $this->opts['contribs'] == 'user' ) . ' ' .
- Html::input( 'target', $this->opts['target'], 'text', array(
- 'size' => '20',
- 'required' => ''
- ) + ( $this->opts['target'] ? array() : array( 'autofocus' ) ) ) . ' '.
- $fNS.
- Xml::checkLabel( wfMsg( 'history-show-deleted' ),
- 'deletedOnly', 'mw-show-deleted-only', $this->opts['deletedOnly'] ) . '<br />' .
- Xml::tags( 'p', null, Xml::checkLabel( wfMsg( 'sp-contributions-toponly' ),
- 'topOnly', 'mw-show-top-only', $this->opts['topOnly'] ) ) .
- $fShowDiff.
- ( $tagFilter ? Xml::tags( 'p', null, implode( ' ', $tagFilter ) ) : '' ) .
- Html::rawElement( 'p', array( 'style' => 'white-space: nowrap' ),
- Xml::dateMenu( $this->opts['year'], $this->opts['month'] ) . ' ' .
- Xml::submitButton( wfMsg( 'sp-contributions-submit' ) )
- ) . ' ';
- $explain = wfMsgExt( 'sp-contributions-explain', 'parseinline' );
- if( !wfEmptyMsg( 'sp-contributions-explain' ) ) {
- $f .= "<p id='mw-sp-contributions-explain'>{$explain}</p>";
- }
- $f .= Xml::closeElement('fieldset' ) .
- Xml::closeElement( 'form' );
- return $f;
- }
-
- /**
- * Output a subscription feed listing recent edits to this page.
- * @param $type String
- */
- protected function feed( $type ) {
- global $wgFeed, $wgFeedClasses, $wgFeedLimit, $wgOut;
-
- if( !$wgFeed ) {
- $wgOut->addWikiMsg( 'feed-unavailable' );
- return;
- }
-
- if( !isset( $wgFeedClasses[$type] ) ) {
- $wgOut->addWikiMsg( 'feed-invalid' );
- return;
- }
-
- $feed = new $wgFeedClasses[$type](
- $this->feedTitle(),
- wfMsgExt( 'tagline', 'parsemag' ),
- $this->getTitle()->getFullUrl() . "/" . urlencode($this->opts['target'])
- );
-
- // Already valid title
- $nt = Title::makeTitleSafe( NS_USER, $this->opts['target'] );
- $target = $this->opts['target'] == 'newbies' ? 'newbies' : $nt->getText();
-
- $pager = new ContribsPager( array(
- 'target' => $target,
- 'namespace' => $this->opts['namespace'],
- 'year' => $this->opts['year'],
- 'month' => $this->opts['month'],
- 'tagFilter' => $this->opts['tagFilter'],
- 'deletedOnly' => $this->opts['deletedOnly'],
- 'topOnly' => $this->opts['topOnly'],
- 'showSizeDiff' => $this->opts['showSizeDiff'],
- ) );
-
- $pager->mLimit = min( $this->opts['limit'], $wgFeedLimit );
-
- $feed->outHeader();
- if( $pager->getNumRows() > 0 ) {
- foreach ( $pager->mResult as $row ) {
- $feed->outItem( $this->feedItem( $row ) );
- }