diff --git a/AbuseFilter.class.php b/AbuseFilter.class.php index 063b44680..f6c086b02 100644 --- a/AbuseFilter.class.php +++ b/AbuseFilter.class.php @@ -120,8 +120,7 @@ class AbuseFilter { ); public static $editboxName = null; - public static function addNavigationLinks( $out, $sk, $pageType ) { - global $wgLang, $wgUser; + public static function addNavigationLinks( IContextSource $context, $pageType ) { $linkDefs = array( 'home' => 'Special:AbuseFilter', 'recentchanges' => 'Special:AbuseFilter/history', @@ -130,7 +129,7 @@ class AbuseFilter { 'log' => 'Special:AbuseLog', ); - if ( $wgUser->isAllowed( 'abusefilter-modify' ) ) { + if ( $context->getUser()->isAllowed( 'abusefilter-modify' ) ) { $linkDefs = array_merge( $linkDefs, array( 'tools' => 'Special:AbuseFilter/tools', 'import' => 'Special:AbuseFilter/import', @@ -160,16 +159,16 @@ class AbuseFilter { if ( $name == $pageType ) { $links[] = Xml::tags( 'strong', null, $msg ); } else { - $links[] = $sk->link( $title, $msg ); + $links[] = $context->getSkin()->link( $title, $msg ); } } - $linkStr = wfMsg( 'parentheses', $wgLang->pipeList( $links ) ); + $linkStr = wfMsg( 'parentheses', $context->getLang()->pipeList( $links ) ); $linkStr = wfMsgExt( 'abusefilter-topnav', 'parseinline' ) . " $linkStr"; $linkStr = Xml::tags( 'div', array( 'class' => 'mw-abusefilter-navigation' ), $linkStr ); - $out->setSubtitle( $linkStr ); + $context->getOutput()->setSubtitle( $linkStr ); } /** diff --git a/special/SpecialAbuseFilter.php b/special/SpecialAbuseFilter.php index cb0d9a2b1..0cd747b88 100644 --- a/special/SpecialAbuseFilter.php +++ b/special/SpecialAbuseFilter.php @@ -95,7 +95,7 @@ class SpecialAbuseFilter extends SpecialPage { } // Links at the top - AbuseFilter::addNavigationLinks( $out, $this->getSkin(), $pageType ); + AbuseFilter::addNavigationLinks( $this->getContext(), $pageType ); $v = new $view( $this, $params ); $v->show(); diff --git a/special/SpecialAbuseLog.php b/special/SpecialAbuseLog.php index 6b1793a80..6dcbe0aaa 100644 --- a/special/SpecialAbuseLog.php +++ b/special/SpecialAbuseLog.php @@ -25,7 +25,7 @@ class SpecialAbuseLog extends SpecialPage { $out = $this->getOutput(); $request = $this->getRequest(); - AbuseFilter::addNavigationLinks( $out, $this->getSkin(), 'log' ); + AbuseFilter::addNavigationLinks( $this->getContext(), 'log' ); $this->setHeaders(); $this->outputHeader( 'abusefilter-log-summary' );