Merge "Remove leading spaces in two messages"
[lhc/web/wiklou.git] / includes / specials / SpecialBlockList.php
index d1afe58..eb25eaf 100644 (file)
@@ -37,7 +37,7 @@ class SpecialBlockList extends SpecialPage {
        /**
         * Main execution point
         *
-        * @param $par String title fragment
+        * @param string $par title fragment
         */
        public function execute( $par ) {
                $this->setHeaders();
@@ -55,10 +55,10 @@ 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;
                }
 
@@ -120,7 +120,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;
@@ -148,16 +148,16 @@ class SpecialBlockList extends SpecialPage {
                }
 
                # 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 +169,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,8 +179,8 @@ class SpecialBlockList extends SpecialPage {
                if ( $pager->getNumRows() ) {
                        $out->addHTML(
                                $pager->getNavigationBar() .
-                               $pager->getBody().
-                               $pager->getNavigationBar()
+                                       $pager->getBody() .
+                                       $pager->getNavigationBar()
                        );
 
                } elseif ( $this->target ) {
@@ -190,7 +190,7 @@ class SpecialBlockList extends SpecialPage {
                        $out->addWikiMsg( 'ipblocklist-empty' );
                }
 
-               if( count( $otherBlockLink ) ) {
+               if ( count( $otherBlockLink ) ) {
                        $out->addHTML(
                                Html::rawElement(
                                        'h2',
@@ -199,12 +199,16 @@ 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" );
                }
        }
+
+       protected function getGroupName() {
+               return 'users';
+       }
 }
 
 class BlockListPager extends TablePager {
@@ -234,7 +238,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();
                        }
                }
@@ -263,17 +267,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 );
@@ -291,9 +295,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'],
@@ -437,7 +441,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 );
@@ -472,7 +476,7 @@ class HTMLBlockedUsersItemSelect extends HTMLSelectField {
                        // This adds the explicitly requested limit value to the drop-down,
                        // then makes sure it's sorted correctly so when we output the list
                        // later, the custom option doesn't just show up last.
-                       $this->mParams['options'][ $this->mParent->getLanguage()->formatNum( $value ) ] = intval($value);
+                       $this->mParams['options'][$this->mParent->getLanguage()->formatNum( $value )] = intval( $value );
                        asort( $this->mParams['options'] );
                }