jenkins-bot has submitted this change and it was merged.
Change subject: Add "wgRelevantUserName" from skin to mw.config
......................................................................
Add "wgRelevantUserName" from skin to mw.config
A skin can have a relevant user, then some help links in the sidebar
are shown. When a user want extend this informationen with userjs, he
has to parse the existing items or the title param of the url to get the
name of the user for which this help links are shown. Having the name as
javascript variable makes it easier to add more links in the sidebar.
Change-Id: I17a75902b6e739d5149d332b6a94a6568b79501f
---
M RELEASE-NOTES-1.23
M includes/OutputPage.php
2 files changed, 8 insertions(+), 1 deletion(-)
Approvals:
Bartosz Dziewoński: Looks good to me, approved
jenkins-bot: Verified
diff --git a/RELEASE-NOTES-1.23 b/RELEASE-NOTES-1.23
index 710f26f..9cae57b 100644
--- a/RELEASE-NOTES-1.23
+++ b/RELEASE-NOTES-1.23
@@ -20,6 +20,8 @@
enabled with care.
* (bug 6092) Add expensive parser functions {{REVISIONID:}}, {{REVISIONUSER:}}
and {{REVISIONTIMESTAMP:}} (with friends).
+* Add "wgRelevantUserName" to mw.config containing the current
+ Skin::getRelevantUser value
=== Bug fixes in 1.23 ===
* (bug 41759) The "updated since last visit" markers (on history pages, recent
diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index 7f0454f..b4fda13 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -2980,9 +2980,11 @@
$ns = $title->getNamespace();
$canonicalNamespace = MWNamespace::exists( $ns ) ?
MWNamespace::getCanonicalName( $ns ) : $title->getNsText();
+ $sk = $this->getSkin();
// Get the relevant title so that AJAX features can use the
correct page name
// when making API requests from certain special pages (bug
34972).
- $relevantTitle = $this->getSkin()->getRelevantTitle();
+ $relevantTitle = $sk->getRelevantTitle();
+ $relevantUser = $sk->getRelevantUser();
if ( $ns == NS_SPECIAL ) {
list( $canonicalSpecialPageName, /*...*/ ) =
SpecialPageFactory::resolveAlias( $title->getDBkey() );
@@ -3059,6 +3061,9 @@
if ( $this->mRedirectedFrom ) {
$vars['wgRedirectedFrom'] =
$this->mRedirectedFrom->getPrefixedDBkey();
}
+ if ( $relevantUser ) {
+ $vars['wgRelevantUserName'] = $relevantUser->getName();
+ }
// Allow extensions to add their custom variables to the
mw.config map.
// Use the 'ResourceLoaderGetConfigVars' hook if the variable
is not
--
To view, visit https://gerrit.wikimedia.org/r/88773
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I17a75902b6e739d5149d332b6a94a6568b79501f
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>
Gerrit-Reviewer: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Daniel Friesen <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: Umherirrender <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits