return $this->feed( $feedType );
}
- $out->setFeedAppendQuery( wfArrayToCGI( $this->opts->getAllValues() ) );
+ $allValues = $this->opts->getAllValues();
+ unset( $allValues['feed'] );
+ $out->setFeedAppendQuery( wfArrayToCGI( $allValues ) );
}
$pager = new NewPagesPager( $this, $this->opts );
global $wgGroupPermissions;
// show/hide links
- $showhide = array( wfMsgHtml( 'show' ), wfMsgHtml( 'hide' ) );
+ $showhide = array( $this->msg( 'show' )->escaped(), $this->msg( 'hide' )->escaped() );
// Option value -> message mapping
$filters = array(
$link = Linker::link( $self, $showhide[$onoff], array(),
array( $key => $onoff ) + $changed
);
- $links[$key] = wfMsgHtml( $msg, $link );
+ $links[$key] = $this->msg( $msg )->rawParams( $link )->escaped();
}
return $this->getLanguage()->pipeList( $links );
$form = Xml::openElement( 'form', array( 'action' => $wgScript ) ) .
Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) .
- Xml::fieldset( wfMsg( 'newpages' ) ) .
+ Xml::fieldset( $this->msg( 'newpages' )->text() ) .
Xml::openElement( 'table', array( 'id' => 'mw-newpages-table' ) ) .
'<tr>
<td class="mw-label">' .
- Xml::label( wfMsg( 'namespace' ), 'namespace' ) .
+ Xml::label( $this->msg( 'namespace' )->text(), 'namespace' ) .
'</td>
<td class="mw-input">' .
Html::namespaceSelector(
( $wgEnableNewpagesUserFilter ?
'<tr>
<td class="mw-label">' .
- Xml::label( wfMsg( 'newpages-username' ), 'mw-np-username' ) .
+ Xml::label( $this->msg( 'newpages-username' )->text(), 'mw-np-username' ) .
'</td>
<td class="mw-input">' .
Xml::input( 'username', 30, $userText, array( 'id' => 'mw-np-username' ) ) .
</tr>' : '' ) .
'<tr> <td></td>
<td class="mw-submit">' .
- Xml::submitButton( wfMsg( 'allpagessubmit' ) ) .
+ Xml::submitButton( $this->msg( 'allpagessubmit' )->text() ) .
'</td>
</tr>' .
'<tr>
* @return String
*/
public function formatRow( $result ) {
+ $title = Title::newFromRow( $result );
+
# Revision deletion works on revisions, so we should cast one
$row = array(
'comment' => $result->rc_comment,
'user' => $result->rc_user,
);
$rev = new Revision( $row );
+ $rev->setTitle( $title );
$classes = array();
$lang = $this->getLanguage();
$dm = $lang->getDirMark();
- $title = Title::newFromRow( $result );
$spanTime = Html::element( 'span', array( 'class' => 'mw-newpages-time' ),
- $lang->timeanddate( $result->rc_timestamp, true )
+ $lang->userTimeAndDate( $result->rc_timestamp, $this->getUser() )
);
$time = Linker::linkKnown(
$title,
);
$histLink = Linker::linkKnown(
$title,
- wfMsgHtml( 'hist' ),
+ $this->msg( 'hist' )->escaped(),
array(),
array( 'action' => 'history' )
);
- $hist = Html::rawElement( 'span', array( 'class' => 'mw-newpages-history' ), wfMsg( 'parentheses', $histLink ) );
+ $hist = Html::rawElement( 'span', array( 'class' => 'mw-newpages-history' ),
+ $this->msg( 'parentheses' )->rawParams( $histLink )->escaped() );
$length = Html::element( 'span', array( 'class' => 'mw-newpages-length' ),
- '[' . $this->msg( 'nbytes' )->numParams( $result->length )->text() . ']'
+ $this->msg( 'brackets' )->params( $this->msg( 'nbytes' )->numParams( $result->length )->text() )
);
$ulink = Linker::revUserTools( $rev );
$oldTitleText = '';
$oldTitle = Title::makeTitle( $result->rc_namespace, $result->rc_title );
if ( !$title->equals( $oldTitle ) ) {
- $oldTitleText = wfMessage( 'rc-old-title' )->params( $oldTitle->getPrefixedText() )->escaped();
+ $oldTitleText = $this->msg( 'rc-old-title' )->params( $oldTitle->getPrefixedText() )->escaped();
}
return "<li{$css}>{$time} {$dm}{$plink} {$hist} {$dm}{$length} {$dm}{$ulink} {$comment} {$tagDisplay} {$oldTitleText}</li>\n";
$feed = new $wgFeedClasses[$type](
$this->feedTitle(),
- wfMsgExt( 'tagline', 'parsemag' ),
+ $this->msg( 'tagline' )->text(),
$this->getTitle()->getFullUrl()
);
}
protected function feedItem( $row ) {
- $title = Title::MakeTitle( intval( $row->rc_namespace ), $row->rc_title );
+ $title = Title::makeTitle( intval( $row->rc_namespace ), $row->rc_title );
if( $title ) {
$date = $row->rc_timestamp;
$comments = $title->getTalkPage()->getFullURL();
protected function feedItemDesc( $row ) {
$revision = Revision::newFromId( $row->rev_id );
if( $revision ) {
- return '<p>' . htmlspecialchars( $revision->getUserText() ) . wfMsgForContent( 'colon-separator' ) .
+ return '<p>' . htmlspecialchars( $revision->getUserText() ) .
+ $this->msg( 'colon-separator' )->inContentLanguage()->escaped() .
htmlspecialchars( FeedItem::stripComment( $revision->getComment() ) ) .
"</p>\n<hr />\n<div>" .
- nl2br( htmlspecialchars( $revision->getText() ) ) . "</div>";
+ nl2br( htmlspecialchars( $revision->getContent()->serialize() ) ) . "</div>"; //TODO: include content model/type in feed item?
}
return '';
}