summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialDeletedContributions.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-01-18 16:46:04 +0100
committerPierre Schmitz <pierre@archlinux.de>2013-01-18 16:46:04 +0100
commit63601400e476c6cf43d985f3e7b9864681695ed4 (patch)
treef7846203a952e38aaf66989d0a4702779f549962 /includes/specials/SpecialDeletedContributions.php
parent8ff01378c9e0207f9169b81966a51def645b6a51 (diff)
Update to MediaWiki 1.20.2
this update includes: * adjusted Arch Linux skin * updated FluxBBAuthPlugin * patch for https://bugzilla.wikimedia.org/show_bug.cgi?id=44024
Diffstat (limited to 'includes/specials/SpecialDeletedContributions.php')
-rw-r--r--includes/specials/SpecialDeletedContributions.php55
1 files changed, 40 insertions, 15 deletions
diff --git a/includes/specials/SpecialDeletedContributions.php b/includes/specials/SpecialDeletedContributions.php
index 3498a16d..c880b617 100644
--- a/includes/specials/SpecialDeletedContributions.php
+++ b/includes/specials/SpecialDeletedContributions.php
@@ -25,7 +25,6 @@
* Implements Special:DeletedContributions to display archived revisions
* @ingroup SpecialPage
*/
-
class DeletedContribsPager extends IndexPager {
public $mDefaultDirection = true;
var $messages, $target;
@@ -54,9 +53,9 @@ class DeletedContribsPager extends IndexPager {
$user = $this->getUser();
// Paranoia: avoid brute force searches (bug 17792)
if( !$user->isAllowed( 'deletedhistory' ) ) {
- $conds[] = $this->mDb->bitAnd('ar_deleted',Revision::DELETED_USER) . ' = 0';
+ $conds[] = $this->mDb->bitAnd( 'ar_deleted', Revision::DELETED_USER ) . ' = 0';
} elseif( !$user->isAllowed( 'suppressrevision' ) ) {
- $conds[] = $this->mDb->bitAnd('ar_deleted',Revision::SUPPRESSED_USER) .
+ $conds[] = $this->mDb->bitAnd( 'ar_deleted', Revision::SUPPRESSED_USER ) .
' != ' . Revision::SUPPRESSED_USER;
}
return array(
@@ -95,17 +94,17 @@ class DeletedContribsPager extends IndexPager {
if ( isset( $this->mNavigationBar ) ) {
return $this->mNavigationBar;
}
- $lang = $this->getLanguage();
- $fmtLimit = $lang->formatNum( $this->mLimit );
+
$linkTexts = array(
- 'prev' => $this->msg( 'pager-newer-n', $fmtLimit )->escaped(),
- 'next' => $this->msg( 'pager-older-n', $fmtLimit )->escaped(),
+ 'prev' => $this->msg( 'pager-newer-n' )->numParams( $this->mLimit )->escaped(),
+ 'next' => $this->msg( 'pager-older-n' )->numParams( $this->mLimit )->escaped(),
'first' => $this->msg( 'histlast' )->escaped(),
'last' => $this->msg( 'histfirst' )->escaped()
);
$pagingLinks = $this->getPagingLinks( $linkTexts );
$limitLinks = $this->getLimitLinks();
+ $lang = $this->getLanguage();
$limits = $lang->pipeList( $limitLinks );
$this->mNavigationBar = "(" . $lang->pipeList( array( $pagingLinks['first'], $pagingLinks['last'] ) ) . ") " .
@@ -130,6 +129,8 @@ class DeletedContribsPager extends IndexPager {
* written by the target user.
*
* @todo This would probably look a lot nicer in a table.
+ * @param $row
+ * @return string
*/
function formatRow( $row ) {
wfProfileIn( __METHOD__ );
@@ -190,7 +191,7 @@ class DeletedContribsPager extends IndexPager {
$link = Linker::linkKnown(
$undelete,
$date,
- array(),
+ array( 'class' => 'mw-changeslist-date' ),
array(
'target' => $page->getPrefixedText(),
'timestamp' => $rev->getTimestamp()
@@ -202,7 +203,11 @@ class DeletedContribsPager extends IndexPager {
$link = '<span class="history-deleted">' . $link . '</span>';
}
- $pagelink = Linker::link( $page );
+ $pagelink = Linker::link(
+ $page,
+ null,
+ array( 'class' => 'mw-changeslist-title' )
+ );
if( $rev->isMinor() ) {
$mflag = ChangesList::flag( 'minor' );
@@ -221,7 +226,8 @@ class DeletedContribsPager extends IndexPager {
array( $last, $dellog, $reviewlink ) ) )->escaped()
);
- $ret = "{$del}{$link} {$tools} . . {$mflag} {$pagelink} {$comment}";
+ $separator = '<span class="mw-changeslist-separator">. .</span>';
+ $ret = "{$del}{$link} {$tools} {$separator} {$mflag} {$pagelink} {$comment}";
# Denote if username is redacted for this edit
if( $rev->isDeleted( Revision::DELETED_USER ) ) {
@@ -237,7 +243,7 @@ class DeletedContribsPager extends IndexPager {
/**
* Get the Database object in use
*
- * @return Database
+ * @return DatabaseBase
*/
public function getDatabase() {
return $this->mDb;
@@ -254,12 +260,12 @@ class DeletedContributionsPage extends SpecialPage {
* Special page "deleted user contributions".
* Shows a list of the deleted contributions of a user.
*
- * @return none
* @param $par String: (optional) user name of the user for which to show the contributions
*/
function execute( $par ) {
global $wgQueryPageDefaultLimit;
$this->setHeaders();
+ $this->outputHeader();
$user = $this->getUser();
@@ -293,6 +299,7 @@ class DeletedContributionsPage extends SpecialPage {
$out->addHTML( $this->getForm( '' ) );
return;
}
+ $this->getSkin()->setRelevantUser( $userObj );
$target = $userObj->getName();
$out->addSubtitle( $this->getSubTitle( $userObj ) );
@@ -346,6 +353,7 @@ class DeletedContributionsPage extends SpecialPage {
} else {
$user = Linker::link( $userObj->getUserPage(), htmlspecialchars( $userObj->getName() ) );
}
+ $links = '';
$nt = $userObj->getUserPage();
$id = $userObj->getID();
$talk = $nt->getTalkPage();
@@ -387,6 +395,13 @@ class DeletedContributionsPage extends SpecialPage {
)
);
}
+
+ # Uploads
+ $tools[] = Linker::linkKnown(
+ SpecialPage::getTitleFor( 'Listfiles', $userObj->getName() ),
+ $this->msg( 'sp-contributions-uploads' )->escaped()
+ );
+
# Other logs link
$tools[] = Linker::linkKnown(
SpecialPage::getTitleFor( 'Log' ),
@@ -403,7 +418,7 @@ class DeletedContributionsPage extends SpecialPage {
# Add a link to change user rights for privileged users
$userrightsPage = new UserrightsPage();
$userrightsPage->setContext( $this->getContext() );
- if( $id !== null && $userrightsPage->userCanChangeRights( User::newFromId( $id ) ) ) {
+ if( $userrightsPage->userCanChangeRights( $userObj ) ) {
$tools[] = Linker::linkKnown(
SpecialPage::getTitleFor( 'Userrights', $nt->getDBkey() ),
$this->msg( 'sp-contributions-userrights' )->escaped()
@@ -450,6 +465,7 @@ class DeletedContributionsPage extends SpecialPage {
/**
* Generates the namespace selector form with hidden attributes.
* @param $options Array: the options to be included.
+ * @return string
*/
function getForm( $options ) {
global $wgScript;
@@ -489,8 +505,17 @@ class DeletedContributionsPage extends SpecialPage {
'size' => '20',
'required' => ''
) + ( $options['target'] ? array() : array( 'autofocus' ) ) ) . ' '.
- Xml::label( $this->msg( 'namespace' )->text(), 'namespace' ) . ' ' .
- Xml::namespaceSelector( $options['namespace'], '' ) . ' ' .
+ Html::namespaceSelector(
+ array(
+ 'selected' => $options['namespace'],
+ 'all' => '',
+ 'label' => $this->msg( 'namespace' )->text()
+ ), array(
+ 'name' => 'namespace',
+ 'id' => 'namespace',
+ 'class' => 'namespaceselector',
+ )
+ ) . ' ' .
Xml::submitButton( $this->msg( 'sp-contributions-submit' )->text() ) .
Xml::closeElement( 'fieldset' ) .
Xml::closeElement( 'form' );