Method is a wrapper around $wgNonincludableNamespaces,
replaced the one place in parser and
add it as info to api's meta=siteinfo
Change-Id: I501b811137c39f5c2d9ea35c78fef8ae22d21bfe
return $index == NS_USER || $index == NS_USER_TALK;
}
+ /**
+ * It is not possible to use pages from this namespace as template?
+ *
+ * @since 1.20
+ * @param $index int Index to check
+ * @return bool
+ */
+ public static function isNonincludableNamespace( $index ) {
+ global $wgNonincludableNamespaces;
+ return $wgNonincludableNamespaces && in_array( $index, $wgNonincludableNamespaces );
+ }
+
}
if ( MWNamespace::isContent( $ns ) ) {
$data[$ns]['content'] = '';
}
+
+ if ( MWNamespace::isNonincludableNamespace( $ns ) ) {
+ $data[$ns]['nonincludable'] = '';
+ }
}
$this->getResult()->setIndexedTagName( $data, 'ns' );
* @private
*/
function braceSubstitution( $piece, $frame ) {
- global $wgNonincludableNamespaces, $wgContLang;
+ global $wgContLang;
wfProfileIn( __METHOD__ );
wfProfileIn( __METHOD__.'-setup' );
$isHTML = true;
$this->disableCache();
}
- } elseif ( $wgNonincludableNamespaces && in_array( $title->getNamespace(), $wgNonincludableNamespaces ) ) {
+ } elseif ( MWNamespace::isNonincludableNamespace( $title->getNamespace() ) ) {
$found = false; # access denied
wfDebug( __METHOD__.": template inclusion denied for " . $title->getPrefixedDBkey() );
} else {