jenkins-bot has submitted this change and it was merged.

Change subject: Hygiene: Move SpecialNearby registration out of extension 
function
......................................................................


Hygiene: Move SpecialNearby registration out of extension function

Register Special:Nearby in SpecialPage_initList hook and remove MobileFrontend's
extension function.

See also:
        If1a25593ff38270a1a3d356e996f6325d34504f8
        I0a0a60894a924823bd3cbb72df5dceebc745bc6b
        I5c2c5f90d7c9af2714e4d0ed6218f326b4185d45

Change-Id: I346c42e4298f7d72cf1e835aee9c2c7a5f156ade
---
M MobileFrontend.php
M includes/MobileFrontend.hooks.php
2 files changed, 5 insertions(+), 16 deletions(-)

Approvals:
  Phuedx: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/MobileFrontend.php b/MobileFrontend.php
index 1d0d61d..e459af9 100644
--- a/MobileFrontend.php
+++ b/MobileFrontend.php
@@ -113,8 +113,6 @@
        $wgAutoloadClasses[$className] = __DIR__ . 
"/includes/$classFilename.php";
 }
 
-$wgExtensionFunctions[] = 'efMobileFrontend_Setup';
-
 $wgAPIModules['mobileview'] = 'ApiMobileView';
 
 $wgHooks['APIGetAllowedParams'][] = 'ApiParseExtender::onAPIGetAllowedParams';
@@ -171,6 +169,7 @@
        'Uploads' => 'SpecialUploads',
        'UserProfile' => 'SpecialUserProfile',
 ) );
+$wgSpecialPageGroups['Nearby'] = 'pages';
 
 // Register Minerva as a valid skin
 $wgValidSkinNames['minerva'] = "Minerva";
@@ -180,20 +179,6 @@
 $wgGroupPermissions['*']['mf-uploadbutton'] = false;
 $wgGroupPermissions['autoconfirmed']['mf-uploadbutton'] = true;
 $wgGroupPermissions['sysop']['mf-uploadbutton'] = true;
-
-/**
- * Setup MobileFrontend, load global components
- */
-function efMobileFrontend_Setup() {
-       global $wgMFNearby, $wgSpecialPages, $wgSpecialPageGroups,
-               $wgResourceLoaderLESSImportPaths,
-               $wgMobileVEModules;
-
-       if ( $wgMFNearby ) {
-               $wgSpecialPages['Nearby'] = 'SpecialNearby';
-               $wgSpecialPageGroups['Nearby'] = 'pages';
-       }
-}
 
 // Config instance
 $wgConfigRegistry['mobilefrontend'] = 'GlobalVarConfig::newInstance';
diff --git a/includes/MobileFrontend.hooks.php 
b/includes/MobileFrontend.hooks.php
index 03c2995..df83bca 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -405,6 +405,10 @@
                                $list['Notifications'] = 
'SpecialMobileNotifications';
                        }
                }
+               // add Special:Nearby only, if Nearby is activated
+               if ( $ctx->getMFConfig()->get( 'MFNearby' ) ) {
+                       $list['Nearby'] = 'SpecialNearby';
+               }
                return true;
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/187948
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I346c42e4298f7d72cf1e835aee9c2c7a5f156ade
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: Phuedx <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to