if ( isset( $this->mNavigationBar ) ) {
return $this->mNavigationBar;
}
- $lang = $this->getLang();
+ $lang = $this->getLanguage();
$fmtLimit = $lang->formatNum( $this->mLimit );
$linkTexts = array(
'prev' => wfMsgExt( 'pager-newer-n', array( 'escape', 'parsemag' ), $fmtLimit ),
}
$comment = Linker::revComment( $rev );
- $date = htmlspecialchars( $this->getLang()->timeanddate( $rev->getTimestamp(), true ) );
+ $date = htmlspecialchars( $this->getLanguage()->timeanddate( $rev->getTimestamp(), true ) );
if( !$user->isAllowed( 'undelete' ) || !$rev->userCan( Revision::DELETED_TEXT, $user ) ) {
$link = $date; // unusable link
$tools = Html::rawElement(
'span',
array( 'class' => 'mw-deletedcontribs-tools' ),
- wfMsg( 'parentheses', $this->getLang()->pipeList( array( $last, $dellog, $reviewlink ) ) )
+ wfMsg( 'parentheses', $this->getLanguage()->pipeList( array( $last, $dellog, $reviewlink ) ) )
);
$ret = "{$del}{$link} {$tools} . . {$mflag} {$pagelink} {$comment}";
* @param $par String: (optional) user name of the user for which to show the contributions
*/
function execute( $par ) {
+ global $wgQueryPageDefaultLimit;
$this->setHeaders();
$user = $this->getUser();
$request = $this->getRequest();
$out = $this->getOutput();
- $out->setPageTitleMsg( 'deletedcontributions-title' );
+ $out->setPageTitle( $this->msg( 'deletedcontributions-title' ) );
$options = array();
return;
}
- $options['limit'] = $request->getInt( 'limit', 50 );
+ $options['limit'] = $request->getInt( 'limit', $wgQueryPageDefaultLimit );
$options['target'] = $target;
- $nt = Title::makeTitleSafe( NS_USER, $target );
- if ( !$nt ) {
+ $userObj = User::newFromName( $target );
+ if ( !$userObj ) {
$out->addHTML( $this->getForm( '' ) );
return;
}
- $id = User::idFromName( $nt->getText() );
+ $nt = $userObj->getUserPage();
+ $id = $userObj->getID();
- $target = $nt->getText();
- $out->setSubtitle( $this->getSubTitle( $nt, $id ) );
+ $target = $userObj->getName();
+ $out->addSubtitle( $this->getSubTitle( $userObj ) );
if ( ( $ns = $request->getVal( 'namespace', null ) ) !== null && $ns !== '' ) {
$options['namespace'] = intval( $ns );
/**
* Generates the subheading with links
- * @param $nt Title object for the target
- * @param $id Integer: User ID for the target
+ * @param $userObj User object for the target
* @return String: appropriately-escaped HTML to be output literally
* @todo FIXME: Almost the same as contributionsSub in SpecialContributions.php. Could be combined.
*/
- function getSubTitle( $nt, $id ) {
- if ( $id === null ) {
- $user = htmlspecialchars( $nt->getText() );
+ function getSubTitle( $userObj ) {
+ if ( $userObj->isAnon() ) {
+ $user = htmlspecialchars( $userObj->getName() );
} else {
- $user = Linker::link( $nt, htmlspecialchars( $nt->getText() ) );
+ $user = Linker::link( $userObj->getUserPage(), htmlspecialchars( $userObj->getName() ) );
}
- $userObj = User::newFromName( $nt->getText(), /* check for username validity not needed */ false );
+ $nt = $userObj->getUserPage();
+ $id = $userObj->getID();
$talk = $nt->getTalkPage();
if( $talk ) {
# Talk page link
wfRunHooks( 'ContributionsToolLinks', array( $id, $nt, &$tools ) );
- $links = $this->getLang()->pipeList( $tools );
+ $links = $this->getLanguage()->pipeList( $tools );
// Show a note if the user is blocked and display the last block log entry.
if ( $userObj->isBlocked() ) {
// languages that want to put the "for" bit right after $user but before
// $links. If 'contribsub' is around, use it for reverse compatibility,
// otherwise use 'contribsub2'.
- if( wfEmptyMsg( 'contribsub' ) ) {
- return wfMsgHtml( 'contribsub2', $user, $links );
+ $oldMsg = $this->msg( 'contribsub' );
+ if ( $oldMsg->exists() ) {
+ return $oldMsg->rawParams( "$user ($links)" );
} else {
- return wfMsgHtml( 'contribsub', "$user ($links)" );
+ return $this->msg( 'contribsub2' )->rawParams( $user, $links );
}
}