From: Alexandre Emsenhuber Date: Wed, 10 Aug 2011 19:34:23 +0000 (+0000) Subject: * Use local context instead of global variables X-Git-Tag: 1.31.0-rc.0~28371 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=e9f753335d3353c50c994e1d2af64cc2966c89cd;p=lhc%2Fweb%2Fwiklou.git * Use local context instead of global variables * Call Linker methods statically --- diff --git a/includes/specials/SpecialUnblock.php b/includes/specials/SpecialUnblock.php index 65f9bb1518..b0e9a32e16 100644 --- a/includes/specials/SpecialUnblock.php +++ b/includes/specials/SpecialUnblock.php @@ -35,10 +35,8 @@ class SpecialUnblock extends SpecialPage { } 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 @@ class SpecialUnblock extends SpecialPage { 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 @@ class SpecialUnblock extends SpecialPage { 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 @@ class SpecialUnblock extends SpecialPage { 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() );