Mattflaschen has uploaded a new change for review.

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


Change subject: Move isWelcomeCreation from E3Experiments.
......................................................................

Move isWelcomeCreation from E3Experiments.

Change-Id: Ib65409801f9c5c9cd9e92de5e2a146b0fe34f6d8
---
M GettingStarted.hooks.php
M GettingStarted.php
2 files changed, 20 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GettingStarted 
refs/changes/64/56364/1

diff --git a/GettingStarted.hooks.php b/GettingStarted.hooks.php
index 433c5ea..68feb3c 100644
--- a/GettingStarted.hooks.php
+++ b/GettingStarted.hooks.php
@@ -7,6 +7,23 @@
  */
 
 class GettingStartedHooks {
+       public static $isWelcomeCreation = false;
+
+       /**
+        * MakeGlobalVariablesScript hook.
+        * Add config vars to mw.config.
+        *
+        * @param $vars array
+        * @param $out OutputPage output page
+        * @return bool
+        */
+       public static function onMakeGlobalVariablesScript( &$vars, $out ) {
+               if ( self::$isWelcomeCreation ) {
+                       $vars[ 'wgIsWelcomeCreation' ] = true;
+               }
+               return true;
+       }
+
        /**
         * Adds the openTask module to the page
         *
@@ -66,6 +83,8 @@
        public static function onBeforeWelcomeCreation( &$welcomeCreationMsg, 
&$injectHtml ) {
                global $wgOut, $wgUser;
 
+               self::$isWelcomeCreation = true;
+
                // Do nothing on mobile.
                if ( class_exists( 'MobileContext' ) ) {
                        if ( 
MobileContext::singleton()->shouldDisplayMobileView() ) {
diff --git a/GettingStarted.php b/GettingStarted.php
index 2b073dc..21194a9 100644
--- a/GettingStarted.php
+++ b/GettingStarted.php
@@ -152,3 +152,4 @@
 $wgHooks[ 'CategoryAfterPageRemoved' ][] = 
'RedisCategorySync::onCategoryAfterPageRemoved';
 $wgHooks[ 'LinksUpdateComplete' ][] = 
'RedisCategorySync::onLinksUpdateComplete';
 $wgHooks[ 'ListDefinedTags' ][] = 'GettingStartedHooks::onListDefinedTags';
+$wgHooks[ 'MakeGlobalVariablesScript' ][] = 
'GettingStartedHooks::onMakeGlobalVariablesScript';

-- 
To view, visit https://gerrit.wikimedia.org/r/56364
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib65409801f9c5c9cd9e92de5e2a146b0fe34f6d8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GettingStarted
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to