Marcoil has uploaded a new change for review.
https://gerrit.wikimedia.org/r/59649
Change subject: Expose namespaces with enabled subpages.
......................................................................
Expose namespaces with enabled subpages.
Add an array 'namespaces' with the namespace IDs of those that have
subpages enabled to the result of query siteinfo.
Bug: 47136
Change-Id: If34d272b45cf986265a6d3d2d67d465d84ae117a
---
M includes/api/ApiQuerySiteinfo.php
1 file changed, 11 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/49/59649/1
diff --git a/includes/api/ApiQuerySiteinfo.php
b/includes/api/ApiQuerySiteinfo.php
index f79083e..c7c3f98 100644
--- a/includes/api/ApiQuerySiteinfo.php
+++ b/includes/api/ApiQuerySiteinfo.php
@@ -116,7 +116,8 @@
protected function appendGeneralInfo( $property ) {
global $wgContLang,
$wgDisableLangConversion,
- $wgDisableTitleConversion;
+ $wgDisableTitleConversion,
+ $wgNamespacesWithSubpages;
$data = array();
$mainPage = Title::newMainPage();
@@ -221,6 +222,15 @@
}
$data['maxuploadsize'] = UploadBase::getMaxUploadSize();
+
+ $subpages = array();
+ foreach ( $wgNamespacesWithSubpages as $ns => $value ) {
+ if ( $value ) {
+ $subpages[] = $ns;
+ }
+ }
+ $this->getResult()->setIndexedTagName( $subpages, 'namespaceId'
);
+ $data['namespaceswithsubpages'] = $subpages;
wfRunHooks( 'APIQuerySiteInfoGeneralInfo', array( $this, &$data
) );
--
To view, visit https://gerrit.wikimedia.org/r/59649
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If34d272b45cf986265a6d3d2d67d465d84ae117a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Marcoil <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits