http://www.mediawiki.org/wiki/Special:Code/MediaWiki/94191

Revision: 94191
Author:   ialex
Date:     2011-08-10 19:34:23 +0000 (Wed, 10 Aug 2011)
Log Message:
-----------
* Use local context instead of global variables
* Call Linker methods statically

Modified Paths:
--------------
    trunk/phase3/includes/specials/SpecialUnblock.php

Modified: trunk/phase3/includes/specials/SpecialUnblock.php
===================================================================
--- trunk/phase3/includes/specials/SpecialUnblock.php   2011-08-10 19:33:16 UTC 
(rev 94190)
+++ trunk/phase3/includes/specials/SpecialUnblock.php   2011-08-10 19:34:23 UTC 
(rev 94191)
@@ -35,10 +35,8 @@
        }
 
        public function execute( $par ){
-               global $wgUser, $wgOut, $wgRequest;
-
                # Check permissions
-               if( !$this->userCanExecute( $wgUser ) ) {
+               if( !$this->userCanExecute( $this->getUser() ) ) {
                        $this->displayRestrictionError();
                        return;
                }
@@ -48,11 +46,12 @@
                        throw new ReadOnlyError;
                }
 
-               list( $this->target, $this->type ) = 
SpecialBlock::getTargetAndType( $par, $wgRequest );
+               list( $this->target, $this->type ) = 
SpecialBlock::getTargetAndType( $par, $this->getRequest() );
                $this->block = Block::newFromTarget( $this->target );
 
-               $wgOut->setPageTitle( wfMsg( 'unblockip' ) );
-               $wgOut->addModules( 'mediawiki.special' );
+               $out = $this->getOutput();
+               $out->setPageTitle( wfMsg( 'unblockip' ) );
+               $out->addModules( 'mediawiki.special' );
 
                $form = new HTMLForm( $this->getFields(), $this->getContext() );
                $form->setWrapperLegend( wfMsg( 'unblockip' ) );
@@ -64,14 +63,14 @@
                        switch( $this->type ){
                                case Block::TYPE_USER:
                                case Block::TYPE_IP:
-                                       $wgOut->addWikiMsg( 'unblocked',  
$this->target );
+                                       $out->addWikiMsg( 'unblocked',  
$this->target );
                                        break;
                                case Block::TYPE_RANGE:
-                                       $wgOut->addWikiMsg( 'unblocked-range', 
$this->target );
+                                       $out->addWikiMsg( 'unblocked-range', 
$this->target );
                                        break;
                                case Block::TYPE_ID:
                                case Block::TYPE_AUTO:
-                                       $wgOut->addWikiMsg( 'unblocked-id', 
$this->target );
+                                       $out->addWikiMsg( 'unblocked-id', 
$this->target );
                                        break;
                        }
                }
@@ -113,8 +112,7 @@
                                switch( $type ){
                                        case Block::TYPE_USER:
                                        case Block::TYPE_IP:
-                                               $skin = $this->getSkin();
-                                               $fields['Name']['default'] = 
$skin->link(
+                                               $fields['Name']['default'] = 
Linker::link(
                                                        $target->getUserPage(),
                                                        $target->getName()
                                                );


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to