From: This, that and the other Date: Fri, 29 Nov 2013 10:19:58 +0000 (+1100) Subject: Add JavaScript variable wgContentNamespaces X-Git-Tag: 1.31.0-rc.0~17855^2 X-Git-Url: http://git.cyclocoop.org/%22.%28%24lien.?a=commitdiff_plain;h=3d87e3a86bcb39d444ef916129dd48bf80b5bb31;p=lhc%2Fweb%2Fwiklou.git Add JavaScript variable wgContentNamespaces 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 --- diff --git a/includes/resourceloader/ResourceLoaderStartUpModule.php b/includes/resourceloader/ResourceLoaderStartUpModule.php index b38f4481e0..93c5d1b99b 100644 --- a/includes/resourceloader/ResourceLoaderStartUpModule.php +++ b/includes/resourceloader/ResourceLoaderStartUpModule.php @@ -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,