From: umherirrender Date: Tue, 29 Oct 2013 20:49:17 +0000 (+0100) Subject: Add "wgRelevantUserName" from skin to mw.config X-Git-Tag: 1.31.0-rc.0~18256^2 X-Git-Url: https://git.cyclocoop.org/%7B%7B%20url_for%28%27user_edit%27%2C%20userid=session.user.id%29%20%7D%7D?a=commitdiff_plain;h=7127c1792bb9205d7313ffabb210963c485a2ebc;p=lhc%2Fweb%2Fwiklou.git 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 --- diff --git a/RELEASE-NOTES-1.23 b/RELEASE-NOTES-1.23 index 710f26ff97..9cae57b3d3 100644 --- a/RELEASE-NOTES-1.23 +++ b/RELEASE-NOTES-1.23 @@ -20,6 +20,8 @@ production. 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 7f0454f6bf..b4fda1366d 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2980,9 +2980,11 @@ $templates $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 @@ $templates 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