X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/mediawiki.git/blobdiff_plain/74c929b24b048c9f1e31e17db757ae4195cd7673..dc9cc5d707f5a612938cc9371614cc41c328fda2:/includes/specials/SpecialContributions.php
diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php
index 3d8c18dd..9263336e 100644
--- a/includes/specials/SpecialContributions.php
+++ b/includes/specials/SpecialContributions.php
@@ -35,7 +35,7 @@ class SpecialContributions extends SpecialPage {
}
if( !strlen( $target ) ) {
- $wgOut->addHTML( $this->getForm( '' ) );
+ $wgOut->addHTML( $this->getForm() );
return;
}
@@ -44,7 +44,7 @@ class SpecialContributions extends SpecialPage {
$nt = Title::makeTitleSafe( NS_USER, $target );
if( !$nt ) {
- $wgOut->addHTML( $this->getForm( '' ) );
+ $wgOut->addHTML( $this->getForm() );
return;
}
$id = User::idFromName( $nt->getText() );
@@ -52,7 +52,7 @@ class SpecialContributions extends SpecialPage {
if( $target != 'newbies' ) {
$target = $nt->getText();
$wgOut->setSubtitle( $this->contributionsSub( $nt, $id ) );
- $wgOut->setHTMLTitle( wfMsg( 'pagetitle', wfMsg( 'contributions-title', $target ) ) );
+ $wgOut->setHTMLTitle( wfMsg( 'pagetitle', wfMsgExt( 'contributions-title', array( 'parsemag' ),$target ) ) );
} else {
$wgOut->setSubtitle( wfMsgHtml( 'sp-contributions-newbies-sub') );
$wgOut->setHTMLTitle( wfMsg( 'pagetitle', wfMsg( 'sp-contributions-newbies-title' ) ) );
@@ -63,6 +63,8 @@ class SpecialContributions extends SpecialPage {
} else {
$this->opts['namespace'] = '';
}
+
+ $this->opts['tagfilter'] = (string) $wgRequest->getVal( 'tagfilter' );
// Allows reverts to have the bot flag in recent changes. It is just here to
// be passed in the form at the top of the page
@@ -72,27 +74,12 @@ class SpecialContributions extends SpecialPage {
$skip = $wgRequest->getText( 'offset' ) || $wgRequest->getText( 'dir' ) == 'prev';
# Offset overrides year/month selection
- if( ( $month = $wgRequest->getIntOrNull( 'month' ) ) !== null && $month !== -1 ) {
- $this->opts['month'] = intval( $month );
- } else {
- $this->opts['month'] = '';
- }
- if( ( $year = $wgRequest->getIntOrNull( 'year' ) ) !== null ) {
- $this->opts['year'] = intval( $year );
- } else if( $this->opts['month'] ) {
- $thisMonth = intval( gmdate( 'n' ) );
- $thisYear = intval( gmdate( 'Y' ) );
- if( intval( $this->opts['month'] ) > $thisMonth ) {
- $thisYear--;
- }
- $this->opts['year'] = $thisYear;
- } else {
- $this->opts['year'] = '';
- }
-
if( $skip ) {
$this->opts['year'] = '';
$this->opts['month'] = '';
+ } else {
+ $this->opts['year'] = $wgRequest->getIntOrNull( 'year' );
+ $this->opts['month'] = $wgRequest->getIntOrNull( 'month' );
}
// Add RSS/atom links
@@ -104,11 +91,11 @@ class SpecialContributions extends SpecialPage {
wfRunHooks( 'SpecialContributionsBeforeMainOutput', $id );
- $wgOut->addHTML( $this->getForm( $this->opts ) );
+ $wgOut->addHTML( $this->getForm() );
$pager = new ContribsPager( $target, $this->opts['namespace'], $this->opts['year'], $this->opts['month'] );
if( !$pager->getNumRows() ) {
- $wgOut->addWikiMsg( 'nocontribs' );
+ $wgOut->addWikiMsg( 'nocontribs', $target );
return;
}
@@ -177,18 +164,27 @@ class SpecialContributions extends SpecialPage {
wfMsgHtml( 'sp-contributions-blocklog' ), 'type=block&page=' . $nt->getPrefixedUrl() );
}
# Other logs link
- $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), wfMsgHtml( 'log' ),
- 'user=' . $nt->getPartialUrl() );
+ $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), wfMsg( 'sp-contributions-logs' ),
+ 'user=' . $nt->getPartialUrl() );
# Add link to deleted user contributions for priviledged users
if( $wgUser->isAllowed( 'deletedhistory' ) ) {
- $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'DeletedContributions',
+ $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'DeletedContributions',
$nt->getDBkey() ), wfMsgHtml( 'deletedcontributions' ) );
}
-
+
+ # Add a link to change user rights for privileged users
+ $userrightsPage = new UserrightsPage();
+ if( 0 !== $id && $userrightsPage->userCanChangeRights( User::newFromId( $id ) ) ) {
+ $tools[] = $sk->makeKnownLinkObj(
+ SpecialPage::getTitleFor( 'Userrights', $nt->getDBkey() ),
+ wfMsgHtml( 'userrights' )
+ );
+ }
+
wfRunHooks( 'ContributionsToolLinks', array( $id, $nt, &$tools ) );
- $links = implode( ' | ', $tools );
+ $links = $wgLang->pipeList( $tools );
}
// Old message 'contribsub' had one parameter, but that doesn't work for
@@ -235,15 +231,21 @@ class SpecialContributions extends SpecialPage {
if( $this->opts['contribs'] == 'newbie' ) {
$this->opts['target'] = '';
}
+
+ if( !isset( $this->opts['tagfilter'] ) ) {
+ $this->opts['tagfilter'] = '';
+ }
$f = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) );
-
+ # Add hidden params for tracking
foreach ( $this->opts as $name => $value ) {
if( in_array( $name, array( 'namespace', 'target', 'contribs', 'year', 'month' ) ) ) {
continue;
}
$f .= "\t" . Xml::hidden( $name, $value ) . "\n";
}
+
+ $tagFilter = ChangeTags::buildTagFilterSelector( $this->opts['tagfilter'] );
$f .= '