SpecialProtectedTitles: Use Config instead of globals
authorKunal Mehta <legoktm@gmail.com>
Mon, 4 Aug 2014 00:30:44 +0000 (17:30 -0700)
committerKunal Mehta <legoktm@gmail.com>
Mon, 4 Aug 2014 00:30:44 +0000 (17:30 -0700)
Change-Id: I5d11a642026e3771528c6627864083e63b68f9b2

includes/specials/SpecialProtectedtitles.php

index b377d0e..b84540c 100644 (file)
@@ -133,8 +133,7 @@ class SpecialProtectedtitles extends SpecialPage {
         * @private
         */
        function showOptions( $namespace, $type = 'edit', $level ) {
-               global $wgScript;
-               $action = htmlspecialchars( $wgScript );
+               $action = htmlspecialchars( wfScript() );
                $title = $this->getPageTitle();
                $special = htmlspecialchars( $title->getPrefixedDBkey() );
 
@@ -175,14 +174,12 @@ class SpecialProtectedtitles extends SpecialPage {
         * @private
         */
        function getLevelMenu( $pr_level ) {
-               global $wgRestrictionLevels;
-
                // Temporary array
                $m = array( $this->msg( 'restriction-level-all' )->text() => 0 );
                $options = array();
 
                // First pass to load the log names
-               foreach ( $wgRestrictionLevels as $type ) {
+               foreach ( $this->getConfig()->get( 'RestrictionLevels' ) as $type ) {
                        if ( $type != '' && $type != '*' ) {
                                // Messages: restriction-level-sysop, restriction-level-autoconfirmed
                                $text = $this->msg( "restriction-level-$type" )->text();