Add JavaScript variable wgContentNamespaces
authorThis, that and the other <at.light@live.com.au>
Fri, 29 Nov 2013 10:19:58 +0000 (21:19 +1100)
committerThis, that and the other <at.light@live.com.au>
Fri, 29 Nov 2013 10:19:58 +0000 (21:19 +1100)
Intended to be used in WikiEditor to hide the signature button in content
namespaces. Other uses could be for gadgets or extensions that only need
to work on content pages, or that are internally-facing and should only
be seen on non-content pages.

It is an array of namespace IDs, so that end-users can quickly check
whether wgNamespaceNumber is in this array.

Change-Id: I01d9671dd14aa79e79ed887299c2f5de766f7375

includes/resourceloader/ResourceLoaderStartUpModule.php

index b38f448..93c5d1b 100644 (file)
@@ -84,6 +84,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
                        'wgMainPageTitle' => $mainPage->getPrefixedText(),
                        'wgFormattedNamespaces' => $wgContLang->getFormattedNamespaces(),
                        'wgNamespaceIds' => $namespaceIds,
+                       'wgContentNamespaces' => MWNamespace::getContentNamespaces(),
                        'wgSiteName' => $wgSitename,
                        'wgFileExtensions' => array_values( array_unique( $wgFileExtensions ) ),
                        'wgDBname' => $wgDBname,