From: Alexandre Emsenhuber Date: Sat, 17 Sep 2011 19:04:05 +0000 (+0000) Subject: * Use local context instead of global variables X-Git-Tag: 1.31.0-rc.0~27587 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=commitdiff_plain;h=f5e050668c9cac03c8b55df52b30af6a400e1f56;p=lhc%2Fweb%2Fwiklou.git * Use local context instead of global variables * Call Linker methods statically --- diff --git a/includes/specials/SpecialBrokenRedirects.php b/includes/specials/SpecialBrokenRedirects.php index 21a098a0f5..35770713bb 100644 --- a/includes/specials/SpecialBrokenRedirects.php +++ b/includes/specials/SpecialBrokenRedirects.php @@ -77,8 +77,6 @@ class BrokenRedirectsPage extends PageQueryPage { * @return String */ function formatResult( $skin, $result ) { - global $wgUser, $wgLang; - $fromObj = Title::makeTitle( $result->namespace, $result->title ); if ( isset( $result->rd_title ) ) { $toObj = Title::makeTitle( $result->rd_namespace, $result->rd_title ); @@ -93,35 +91,35 @@ class BrokenRedirectsPage extends PageQueryPage { // $toObj may very easily be false if the $result list is cached if ( !is_object( $toObj ) ) { - return '' . $skin->link( $fromObj ) . ''; + return '' . Linker::link( $fromObj ) . ''; } - $from = $skin->linkKnown( + $from = Linker::linkKnown( $fromObj, null, array(), array( 'redirect' => 'no' ) ); $links = array(); - $links[] = $skin->linkKnown( + $links[] = Linker::linkKnown( $fromObj, wfMsgHtml( 'brokenredirects-edit' ), array(), array( 'action' => 'edit' ) ); - $to = $skin->link( + $to = Linker::link( $toObj, null, array(), array(), array( 'broken' ) ); - $arr = $wgLang->getArrow(); + $arr = $this->getLang()->getArrow(); $out = $from . wfMsg( 'word-separator' ); - if( $wgUser->isAllowed( 'delete' ) ) { - $links[] = $skin->linkKnown( + if( $this->getUser()->isAllowed( 'delete' ) ) { + $links[] = Linker::linkKnown( $fromObj, wfMsgHtml( 'brokenredirects-delete' ), array(), @@ -129,7 +127,7 @@ class BrokenRedirectsPage extends PageQueryPage { ); } - $out .= wfMsg( 'parentheses', $wgLang->pipeList( $links ) ); + $out .= wfMsg( 'parentheses', $this->getLang()->pipeList( $links ) ); $out .= " {$arr} {$to}"; return $out; }