MarkTraceur has submitted this change and it was merged.
Change subject: Add portlet link to Beta Features pref section
......................................................................
Add portlet link to Beta Features pref section
Will only work with the patch to add that section, but this doesn't
hurt anything now (especially since the extension isn't deployed
anywhere), so may as well submit it.
Change-Id: Icfe63be29133f9f13feffbad99c83856f45d8d01
---
M BetaFeatures.i18n.php
M BetaFeatures.php
M BetaFeaturesHooks.php
3 files changed, 20 insertions(+), 0 deletions(-)
Approvals:
BryanDavis: Looks good to me, approved
MarkTraceur: Verified
diff --git a/BetaFeatures.i18n.php b/BetaFeatures.i18n.php
index 3294592..23a795e 100644
--- a/BetaFeatures.i18n.php
+++ b/BetaFeatures.i18n.php
@@ -31,6 +31,7 @@
'betafeatures-enable-all' => 'Enable all beta features',
'betafeatures-desc' => 'Lets user enable or disable features on the
wiki that are still not ready for prime-time',
'betafeatures-enable-all-desc' => 'If you enable this choice, all of
the preferences on this page, regardless of their actual value, will be set to
true in the database. Use with caution!',
+ 'betafeatures-toplink' => 'Beta features',
);
/** Message documentation (Message documentation)
@@ -50,6 +51,7 @@
See also:
* {{msg-mw|Betafeatures-enable-all}}',
+ 'betafeatures-toplink' => 'Link that goes next to the link to
Special:Preferences but takes the user directly to the BetaFeatures section.',
);
/** Asturian (asturianu)
diff --git a/BetaFeatures.php b/BetaFeatures.php
index ef903e2..25ba5a5 100644
--- a/BetaFeatures.php
+++ b/BetaFeatures.php
@@ -32,6 +32,7 @@
$wgSpecialPages['BetaFeatures'] = 'SpecialBetaFeatures';
$wgHooks['GetPreferences'][] = 'BetaFeaturesHooks::getPreferences';
+$wgHooks['PersonalUrls'][] = 'BetaFeaturesHooks::getBetaFeaturesLink';
$wgExtensionCredits['specialpage'][] = array(
'path' => __FILE__,
diff --git a/BetaFeaturesHooks.php b/BetaFeaturesHooks.php
index de5c88e..e2deaad 100644
--- a/BetaFeaturesHooks.php
+++ b/BetaFeaturesHooks.php
@@ -86,4 +86,21 @@
'screenshot' => $wgExtensionAssetsPath .
'/BetaFeatures/images/all-beta.png',
);
}
+
+ static function getBetaFeaturesLink( &$personal_urls, $title ) {
+ global $wgUser;
+
+ if ( $wgUser->isLoggedIn() ) {
+ $skin = $wgUser->getSkin();
+ $bfurl = array(
+ 'text' => wfMessage( 'betafeatures-toplink'
)->text(),
+ 'href' => $skin->makeSpecialUrl( 'Preferences'
) . '#mw-prefsection-betafeatures',
+ 'active' => $title->isSpecial( 'Preferences' ),
+ );
+
+ $personal_urls['betafeatures'] = $bfurl;
+ }
+
+ return true;
+ }
}
--
To view, visit https://gerrit.wikimedia.org/r/77074
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Icfe63be29133f9f13feffbad99c83856f45d8d01
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/BetaFeatures
Gerrit-Branch: master
Gerrit-Owner: MarkTraceur <[email protected]>
Gerrit-Reviewer: Brian Wolff <[email protected]>
Gerrit-Reviewer: BryanDavis <[email protected]>
Gerrit-Reviewer: MarkTraceur <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits