return;
}
- $this->opts['limit'] = $wgRequest->getInt( 'limit', 50 );
+ $this->opts['limit'] = $wgRequest->getInt( 'limit', $wgUser->getOption('rclimit') );
$this->opts['target'] = $target;
$nt = Title::makeTitleSafe( NS_USER, $target );
if( 0 == $id ) {
$user = $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( 'sp-contributions-talk' ) );
if( ( $id != 0 && $wgSysopUserBans ) || ( $id == 0 && IP::isIPAddress( $nt->getText() ) ) ) {
# Block link
if( $wgUser->isAllowed( 'block' ) )
# Add link to deleted user contributions for priviledged users
if( $wgUser->isAllowed( 'deletedhistory' ) ) {
$tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'DeletedContributions',
- $nt->getDBkey() ), wfMsgHtml( 'deletedcontributions' ) );
+ $nt->getDBkey() ), wfMsgHtml( 'sp-contributions-deleted' ) );
}
# Add a link to change user rights for privileged users
if( 0 !== $id && $userrightsPage->userCanChangeRights( User::newFromId( $id ) ) ) {
$tools[] = $sk->makeKnownLinkObj(
SpecialPage::getTitleFor( 'Userrights', $nt->getDBkey() ),
- wfMsgHtml( 'userrights' )
+ wfMsgHtml( 'sp-contributions-userrights' )
);
}
* @param $this->opts Array: the options to be included.
*/
protected function getForm() {
- global $wgScript, $wgTitle;
+ global $wgScript;
- $this->opts['title'] = $wgTitle->getPrefixedText();
+ $this->opts['title'] = SpecialPage::getTitleFor( 'Contributions' )->getPrefixedText();
if( !isset( $this->opts['target'] ) ) {
$this->opts['target'] = '';
} else {
Xml::element( 'legend', array(), wfMsg( 'sp-contributions-search' ) ) .
Xml::radioLabel( wfMsgExt( 'sp-contributions-newbies', array( 'parseinline' ) ),
'contribs', 'newbie' , 'newbie', $this->opts['contribs'] == 'newbie' ? true : false ) . '<br />' .
- Xml::radioLabel( wfMsgExt( 'sp-contributions-username', array( 'parseinline' ) ),
+ Xml::radioLabel( wfMsgExt( 'sp-contributions-username', array( 'parsemag' ) ),
'contribs' , 'user', 'user', $this->opts['contribs'] == 'user' ? true : false ) . ' ' .
Xml::input( 'target', 20, $this->opts['target']) . ' '.
'<span style="white-space: nowrap">' .
}
function getQueryInfo() {
+ global $wgUser;
list( $tables, $index, $userCond, $join_cond ) = $this->getUserCond();
$conds = array_merge( $userCond, $this->getNamespaceCond() );
- // Paranoia: avoid brute force searches (bug 17792)
- $conds[] = 'rev_deleted & ' . Revision::DELETED_USER . ' = 0';
+ // Paranoia: avoid brute force searches (bug 17342)
+ if( !$wgUser->isAllowed( 'suppressrevision' ) ) {
+ $conds[] = 'rev_deleted & ' . Revision::DELETED_USER . ' = 0';
+ }
$join_cond['page'] = array( 'INNER JOIN', 'page_id=rev_page' );
$queryInfo = array(
'join_conds' => $join_cond
);
- ChangeTags::modifyDisplayQuery( $queryInfo['tables'], $queryInfo['fields'], $queryInfo['conds'],
- $queryInfo['join_conds'], $this->tagFilter );
+ ChangeTags::modifyDisplayQuery( $queryInfo['tables'],
+ $queryInfo['fields'],
+ $queryInfo['conds'],
+ $queryInfo['join_conds'],
+ $queryInfo['options'],
+ $this->tagFilter );
wfRunHooks( 'ContribsPager::getQueryInfo', array( &$this, &$queryInfo ) );
return $queryInfo;
* @todo This would probably look a lot nicer in a table.
*/
function formatRow( $row ) {
- global $wgLang, $wgUser, $wgContLang;
+ global $wgUser, $wgLang, $wgContLang;
wfProfileIn( __METHOD__ );
$sk = $this->getSkin();
$page = Title::newFromRow( $row );
$page->resetArticleId( $row->rev_page ); // use process cache
- $link = $sk->makeLinkObj( $page, $page->getPrefixedText(), $page->isRedirect() ? 'redirect=no' : '' );
+ $link = $sk->link(
+ $page,
+ $page->getPrefixedText(),
+ array(),
+ $page->isRedirect() ? array( 'redirect' => 'no' ) : array()
+ );
# Mark current revisions
$difftext = $topmarktext = '';
if( $row->rev_id == $row->page_latest ) {
- $topmarktext .= '<strong>' . $this->messages['uctop'] . '</strong>';
+ $topmarktext .= '<span class="mw-uctop">' . $this->messages['uctop'] . '</span>';
if( !$row->page_is_new ) {
$difftext .= '(' . $sk->makeKnownLinkObj( $page, $this->messages['diff'], 'diff=0' ) . ')';
# Add rollback link
$comment = $wgContLang->getDirMark() . $sk->revComment( $rev, false, true );
$date = $wgLang->timeanddate( wfTimestamp( TS_MW, $row->rev_timestamp ), true );
- $d = $sk->makeKnownLinkObj( $page, $date, 'oldid='.intval($row->rev_id) );
+ $d = $sk->makeKnownLinkObj( $page, htmlspecialchars($date), 'oldid='.intval($row->rev_id) );
if( $this->target == 'newbies' ) {
$userlink = ' . . ' . $sk->userLink( $row->rev_user, $row->rev_user_text );
} else {
$mflag = '';
}
+
+ 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( 'target' => $page->getPrefixedDbkey(), 'oldid' => $rev->getId() );
+ $del = $this->mSkin->revDeleteLink( $query,
+ $rev->isDeleted( Revision::DELETED_RESTRICTED ) ) . ' ';
+ }
+ } else {
+ $del = '';
+ }
- $ret = "{$d} {$histlink} {$difftext} {$nflag}{$mflag} {$link}{$userlink} {$comment} {$topmarktext}";
+ $ret = "{$del}{$d} {$histlink} {$difftext} {$nflag}{$mflag} {$link}{$userlink} {$comment} {$topmarktext}";
if( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
$ret .= ' ' . wfMsgHtml( 'deletedrev' );
}