list( $index, $userCond ) = $this->getUserCond();
$conds = array_merge( $userCond, $this->getNamespaceCond() );
// Paranoia: avoid brute force searches (bug 17792)
- if( !$wgUser->isAllowed( 'hiderevision' ) ) {
- $conds[] = 'ar_deleted & ' . Revision::DELETED_USER . ' = 0';
+ if( !$wgUser->isAllowed( 'suppressrevision' ) ) {
+ $conds[] = $this->mDb->bitAnd('ar_deleted', Revision::DELETED_USER) . ' = 0';
}
return array(
'tables' => array( 'archive' ),
if ( isset( $this->mNavigationBar ) ) {
return $this->mNavigationBar;
}
+ $fmtLimit = $wgLang->formatNum( $this->mLimit );
$linkTexts = array(
- 'prev' => wfMsgHtml( 'pager-newer-n', $this->mLimit ),
- 'next' => wfMsgHtml( 'pager-older-n', $this->mLimit ),
+ 'prev' => wfMsgExt( 'pager-newer-n', array( 'escape', 'parsemag' ), $fmtLimit ),
+ 'next' => wfMsgExt( 'pager-older-n', array( 'escape', 'parsemag' ), $fmtLimit ),
'first' => wfMsgHtml( 'histlast' ),
'last' => wfMsgHtml( 'histfirst' )
);
$limits = $wgLang->pipeList( $limitLinks );
$this->mNavigationBar = "(" . $wgLang->pipeList( array( $pagingLinks['first'], $pagingLinks['last'] ) ) . ") " .
- wfMsgExt( 'viewprevnext', array( 'parsemag' ), $pagingLinks['prev'], $pagingLinks['next'], $limits );
+ wfMsgExt( 'viewprevnext', array( 'parsemag', 'escape', 'replaceafter' ), $pagingLinks['prev'], $pagingLinks['next'], $limits );
return $this->mNavigationBar;
}
* @todo This would probably look a lot nicer in a table.
*/
function formatRow( $row ) {
+ global $wgUser, $wgLang;
wfProfileIn( __METHOD__ );
- global $wgLang, $wgUser;
-
$sk = $this->getSkin();
$rev = new Revision( array(
$undelete = SpecialPage::getTitleFor( 'Undelete' );
$logs = SpecialPage::getTitleFor( 'Log' );
- $dellog = $sk->makeKnownLinkObj( $logs,
+ $dellog = $sk->linkKnown(
+ $logs,
$this->messages['deletionlog'],
- 'type=delete&page=' . $page->getPrefixedUrl() );
+ array(),
+ array(
+ 'type' => 'delete',
+ 'page' => $page->getPrefixedText()
+ )
+ );
- $reviewlink = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Undelete', $page->getPrefixedDBkey() ),
- $this->messages['undeletebtn'] );
+ $reviewlink = $sk->linkKnown(
+ SpecialPage::getTitleFor( 'Undelete', $page->getPrefixedDBkey() ),
+ $this->messages['undeletebtn']
+ );
- $link = $sk->makeKnownLinkObj( $undelete,
+ $link = $sk->linkKnown(
+ $undelete,
htmlspecialchars( $page->getPrefixedText() ),
- 'target=' . $page->getPrefixedUrl() .
- '×tamp=' . $rev->getTimestamp() );
+ array(),
+ array(
+ 'target' => $page->getPrefixedText(),
+ 'timestamp' => $rev->getTimestamp()
+ )
+ );
- $last = $sk->makeKnownLinkObj( $undelete,
+ $last = $sk->linkKnown(
+ $undelete,
$this->messages['diff'],
- "target=" . $page->getPrefixedUrl() .
- "×tamp=" . $rev->getTimestamp() .
- "&diff=prev" );
+ array(),
+ array(
+ 'target' => $page->getPrefixedText(),
+ 'timestamp' => $rev->getTimestamp(),
+ 'diff' => 'prev'
+ )
+ );
$comment = $sk->revComment( $rev );
- $d = $wgLang->timeanddate( $rev->getTimestamp(), true );
+ $d = htmlspecialchars( $wgLang->timeanddate( $rev->getTimestamp(), true ) );
if( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
$d = '<span class="history-deleted">' . $d . '</span>';
} else {
- $link = $sk->makeKnownLinkObj( $undelete, $d,
- 'target=' . $page->getPrefixedUrl() .
- '×tamp=' . $rev->getTimestamp() );
+ $link = $sk->linkKnown(
+ $undelete,
+ $d,
+ array(),
+ array(
+ 'target' => $page->getPrefixedText(),
+ 'timestamp' => $rev->getTimestamp()
+ )
+ );
}
- $pagelink = $sk->makeLinkObj( $page );
+ $pagelink = $sk->link( $page );
if( $rev->isMinor() ) {
$mflag = '<span class="minor">' . $this->messages['minoreditletter'] . '</span> ';
$mflag = '';
}
-
- $ret = "{$link} ($last) ({$dellog}) ({$reviewlink}) . . {$mflag} {$pagelink} {$comment}";
- if( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
- $ret .= ' ' . wfMsgHtml( 'deletedrev' );
+ if( $wgUser->isAllowed( 'deleterevision' ) ) {
+ // If revision was hidden from sysops
+ if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) {
+ $del = Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ),
+ '(' . $this->message['rev-delundel'] . ')' ) . ' ';
+ // Otherwise, show the link...
+ } else {
+ $query = array(
+ 'type' => 'archive',
+ 'target' => $page->getPrefixedDbkey(),
+ 'ids' => $rev->getTimestamp() );
+ $del = $this->mSkin->revDeleteLink( $query,
+ $rev->isDeleted( Revision::DELETED_RESTRICTED ) ) . ' ';
+ }
+ } else {
+ $del = '';
}
+ $ret = "{$del}{$link} ({$last}) ({$dellog}) ({$reviewlink}) . . {$mflag} {$pagelink} {$comment}";
+
$ret = "<li>$ret</li>\n";
wfProfileOut( __METHOD__ );
$pager = new DeletedContribsPager( $target, $options['namespace'] );
if ( !$pager->getNumRows() ) {
- $wgOut->addWikiText( wfMsg( 'nocontribs' ) );
+ $wgOut->addWikiMsg( 'nocontribs' );
return;
}
$text = wfMsgNoTrans( $message, $target );
if( !wfEmptyMsg( $message, $text ) && $text != '-' ) {
- $wgOut->addHTML( '<div class="mw-contributions-footer">' );
- $wgOut->addWikiText( $text );
- $wgOut->addHTML( '</div>' );
+ $wgOut->wrapWikiMsg( "<div class='mw-contributions-footer'>\n$1\n</div>", array( $message, $target ) );
}
}
}
$sk = $wgUser->getSkin();
if ( 0 == $id ) {
- $user = $nt->getText();
+ $user = htmlspecialchars( $nt->getText() );
} else {
- $user = $sk->makeLinkObj( $nt, htmlspecialchars( $nt->getText() ) );
+ $user = $sk->link( $nt, htmlspecialchars( $nt->getText() ) );
}
$talk = $nt->getTalkPage();
if( $talk ) {
# Talk page link
- $tools[] = $sk->makeLinkObj( $talk, wfMsgHtml( 'talkpagelinktext' ) );
+ $tools[] = $sk->link( $talk, wfMsgHtml( 'talkpagelinktext' ) );
if( ( $id != 0 && $wgSysopUserBans ) || ( $id == 0 && User::isIP( $nt->getText() ) ) ) {
# Block link
if( $wgUser->isAllowed( 'block' ) )
- $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Blockip', $nt->getDBkey() ),
- wfMsgHtml( 'blocklink' ) );
+ $tools[] = $sk->linkKnown(
+ SpecialPage::getTitleFor( 'Blockip', $nt->getDBkey() ),
+ wfMsgHtml( 'blocklink' )
+ );
# Block log link
- $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ),
- wfMsgHtml( 'sp-contributions-blocklog' ), 'type=block&page=' . $nt->getPrefixedUrl() );
+ $tools[] = $sk->linkKnown(
+ SpecialPage::getTitleFor( 'Log' ),
+ wfMsgHtml( 'sp-contributions-blocklog' ),
+ array(),
+ array(
+ 'type' => 'block',
+ 'page' => $nt->getPrefixedText()
+ )
+ );
}
# Other logs link
- $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ),
- wfMsgHtml( 'log' ), 'user=' . $nt->getPartialUrl() );
+ $tools[] = $sk->linkKnown(
+ SpecialPage::getTitleFor( 'Log' ),
+ wfMsgHtml( 'sp-contributions-logs' ),
+ array(),
+ array( 'user' => $nt->getText() )
+ );
# Link to undeleted contributions
- $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Contributions', $nt->getDBkey() ),
- wfMsgHtml( 'contributions' ) );
-
+ $tools[] = $sk->linkKnown(
+ SpecialPage::getTitleFor( 'Contributions', $nt->getDBkey() ),
+ wfMsgHtml( 'sp-deletedcontributions-contribs' )
+ );
+
wfRunHooks( 'ContributionsToolLinks', array( $id, $nt, &$tools ) );
$links = $wgLang->pipeList( $tools );
* @param $options Array: the options to be included.
*/
function getForm( $options ) {
- global $wgScript, $wgTitle, $wgRequest;
+ global $wgScript, $wgRequest;
- $options['title'] = $wgTitle->getPrefixedText();
+ $options['title'] = SpecialPage::getTitleFor( 'DeletedContributions' )->getPrefixedText();
if ( !isset( $options['target'] ) ) {
$options['target'] = '';
} else {