MaxSem has uploaded a new change for review.
https://gerrit.wikimedia.org/r/155814
Change subject: Allow third parties to disable beta and alpha
......................................................................
Allow third parties to disable beta and alpha
Bug: 69793
Change-Id: Id0e82e51ae9c852abbde0a1bc93116e87f32e6af
---
M MobileFrontend.php
M includes/MobileContext.php
M includes/specials/SpecialMobileOptions.php
3 files changed, 16 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/14/155814/1
diff --git a/MobileFrontend.php b/MobileFrontend.php
index 23e77bf..7b1dc1b 100644
--- a/MobileFrontend.php
+++ b/MobileFrontend.php
@@ -498,3 +498,8 @@
* Scheme to use for the deep link. Per default, 'http' is used.
*/
$wgMFAppScheme = 'http';
+
+/**
+ * Whether beta and alpha modes are enabled
+ */
+$wgMFEnableBeta = true;
diff --git a/includes/MobileContext.php b/includes/MobileContext.php
index a398ac7..dab6287 100644
--- a/includes/MobileContext.php
+++ b/includes/MobileContext.php
@@ -182,6 +182,11 @@
* @return string
*/
protected function getMobileMode() {
+ global $wgMFEnableBeta;
+
+ if ( !$wgMFEnableBeta ) {
+ return '';
+ }
if ( is_null( $this->mobileMode ) ) {
$mobileAction = $this->getMobileAction();
if ( $mobileAction === 'alpha' || $mobileAction ===
'beta' || $mobileAction === 'stable' ) {
diff --git a/includes/specials/SpecialMobileOptions.php
b/includes/specials/SpecialMobileOptions.php
index 153c047..6aaf5a0 100644
--- a/includes/specials/SpecialMobileOptions.php
+++ b/includes/specials/SpecialMobileOptions.php
@@ -49,6 +49,8 @@
}
private function getSettingsForm() {
+ global $wgMFEnableBeta;
+
$out = $this->getOutput();
$context = MobileContext::singleton();
@@ -125,6 +127,10 @@
HTML;
}
+ if ( !$wgMFEnableBeta ) {
+ $alphaSetting = $betaSetting = '';
+ }
+
// @codingStandardsIgnoreStart Long line
$html .= <<<HTML
<p>
--
To view, visit https://gerrit.wikimedia.org/r/155814
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id0e82e51ae9c852abbde0a1bc93116e87f32e6af
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits