Umherirrender has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/88773


Change subject: Add wgRelevantUserName from skin as js variable
......................................................................

Add wgRelevantUserName from skin as js variable

A skin can have a relevant user, than 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 includes/OutputPage.php
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/73/88773/1

diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index cc3f9b3..96f1c21 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -2974,9 +2974,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() );
@@ -3053,6 +3055,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: newchange
Gerrit-Change-Id: I17a75902b6e739d5149d332b6a94a6568b79501f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <umherirrender_de...@web.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to