From 4ac9fa081a7c045f6a9f1cfc529d82423f485b2e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 8 Dec 2013 09:55:49 +0100 Subject: Update to MediaWiki 1.22.0 --- includes/specials/SpecialBlockList.php | 52 +++++++++++++++++----------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'includes/specials/SpecialBlockList.php') diff --git a/includes/specials/SpecialBlockList.php b/includes/specials/SpecialBlockList.php index e10df4fe..f1992c0f 100644 --- a/includes/specials/SpecialBlockList.php +++ b/includes/specials/SpecialBlockList.php @@ -55,10 +55,11 @@ class SpecialBlockList extends SpecialPage { $action = $request->getText( 'action' ); - if( $action == 'unblock' || $action == 'submit' && $request->wasPosted() ) { + if ( $action == 'unblock' || $action == 'submit' && $request->wasPosted() ) { # B/C @since 1.18: Unblock interface is now at Special:Unblock $title = SpecialPage::getTitleFor( 'Unblock', $this->target ); - $out->redirect( $title->getFullUrl() ); + $out->redirect( $title->getFullURL() ); + return; } @@ -95,7 +96,9 @@ class SpecialBlockList extends SpecialPage { 'default' => 50, ), ); - $form = new HTMLForm( $fields, $this->getContext() ); + $context = new DerivativeContext( $this->getContext() ); + $context->setTitle( $this->getTitle() ); // Remove subpage + $form = new HTMLForm( $fields, $context ); $form->setMethod( 'get' ); $form->setWrapperLegendMsg( 'ipblocklist-legend' ); $form->setSubmitTextMsg( 'ipblocklist-submit' ); @@ -120,7 +123,7 @@ class SpecialBlockList extends SpecialPage { if ( $this->target !== '' ) { list( $target, $type ) = Block::parseTarget( $this->target ); - switch( $type ) { + switch ( $type ) { case Block::TYPE_ID: case Block::TYPE_AUTO: $conds['ipb_id'] = $target; @@ -141,23 +144,23 @@ class SpecialBlockList extends SpecialPage { break; case Block::TYPE_USER: - $conds['ipb_address'] = (string)$this->target; + $conds['ipb_address'] = $target->getName(); $conds['ipb_auto'] = 0; break; } } # Apply filters - if( in_array( 'userblocks', $this->options ) ) { + if ( in_array( 'userblocks', $this->options ) ) { $conds['ipb_user'] = 0; } - if( in_array( 'tempblocks', $this->options ) ) { + if ( in_array( 'tempblocks', $this->options ) ) { $conds['ipb_expiry'] = 'infinity'; } - if( in_array( 'addressblocks', $this->options ) ) { + if ( in_array( 'addressblocks', $this->options ) ) { $conds[] = "ipb_user != 0 OR ipb_range_end > ipb_range_start"; } - if( in_array( 'rangeblocks', $this->options ) ) { + if ( in_array( 'rangeblocks', $this->options ) ) { $conds[] = "ipb_range_end = ipb_range_start"; } @@ -169,7 +172,7 @@ class SpecialBlockList extends SpecialPage { # Show additional header for the local block only when other blocks exists. # Not necessary in a standard installation without such extensions enabled - if( count( $otherBlockLink ) ) { + if ( count( $otherBlockLink ) ) { $out->addHTML( Html::element( 'h2', array(), $this->msg( 'ipblocklist-localblock' )->text() ) . "\n" ); @@ -179,18 +182,16 @@ class SpecialBlockList extends SpecialPage { if ( $pager->getNumRows() ) { $out->addHTML( $pager->getNavigationBar() . - $pager->getBody(). - $pager->getNavigationBar() + $pager->getBody() . + $pager->getNavigationBar() ); - } elseif ( $this->target ) { $out->addWikiMsg( 'ipblocklist-no-results' ); - } else { $out->addWikiMsg( 'ipblocklist-empty' ); } - if( count( $otherBlockLink ) ) { + if ( count( $otherBlockLink ) ) { $out->addHTML( Html::rawElement( 'h2', @@ -199,7 +200,7 @@ class SpecialBlockList extends SpecialPage { ) . "\n" ); $list = ''; - foreach( $otherBlockLink as $link ) { + foreach ( $otherBlockLink as $link ) { $list .= Html::rawElement( 'li', array(), $link ) . "\n"; } $out->addHTML( Html::rawElement( 'ul', array( 'class' => 'mw-ipblocklist-otherblocks' ), $list ) . "\n" ); @@ -238,7 +239,7 @@ class BlockListPager extends TablePager { 'ipb_params' => 'blocklist-params', 'ipb_reason' => 'blocklist-reason', ); - foreach( $headers as $key => $val ) { + foreach ( $headers as $key => $val ) { $headers[$key] = $this->msg( $val )->text(); } } @@ -267,17 +268,17 @@ class BlockListPager extends TablePager { $formatted = ''; - switch( $name ) { + switch ( $name ) { case 'ipb_timestamp': $formatted = $this->getLanguage()->userTimeAndDate( $value, $this->getUser() ); break; case 'ipb_target': - if( $row->ipb_auto ) { + if ( $row->ipb_auto ) { $formatted = $this->msg( 'autoblockid', $row->ipb_id )->parse(); } else { list( $target, $type ) = Block::parseTarget( $row->ipb_address ); - switch( $type ) { + switch ( $type ) { case Block::TYPE_USER: case Block::TYPE_IP: $formatted = Linker::userLink( $target->getId(), $target ); @@ -295,9 +296,9 @@ class BlockListPager extends TablePager { break; case 'ipb_expiry': - $formatted = $this->getLanguage()->formatExpiry( $value, /* User preference timezone */ true ); - if( $this->getUser()->isAllowed( 'block' ) ) { - if( $row->ipb_auto ) { + $formatted = $this->getLanguage()->formatExpiry( $value, /* User preference timezone */true ); + if ( $this->getUser()->isAllowed( 'block' ) ) { + if ( $row->ipb_auto ) { $links[] = Linker::linkKnown( SpecialPage::getTitleFor( 'Unblock' ), $msg['unblocklink'], @@ -420,7 +421,7 @@ class BlockListPager extends TablePager { /** * Do a LinkBatch query to minimise database load when generating all these links - * @param $result + * @param ResultWrapper $result */ function preprocessResults( $result ) { wfProfileIn( __METHOD__ ); @@ -441,7 +442,7 @@ class BlockListPager extends TablePager { } $ua = UserArray::newFromIDs( $userids ); - foreach( $ua as $user ) { + foreach ( $ua as $user ) { $name = str_replace( ' ', '_', $user->getName() ); $lb->add( NS_USER, $name ); $lb->add( NS_USER_TALK, $name ); @@ -482,5 +483,4 @@ class HTMLBlockedUsersItemSelect extends HTMLSelectField { return true; } - } -- cgit v1.2.3-54-g00ecf