/** * 100 and 101 used to be occupied by SMW's now obsolete namespaces * "Relation" and "Relation_Talk" * * 106 and 107 are occupied by the Semantic Forms, we define them here * to offer some (easy but useful) support to SF * * @since 1.9 * * @param array $globalVars */ public static function initCustomNamespace(&$globalVars) { $instance = new self($globalVars); if (!isset($globalVars['smwgNamespaceIndex'])) { $globalVars['smwgNamespaceIndex'] = 100; } $defaultSettings = array('wgNamespaceAliases', 'wgExtraNamespaces', 'wgNamespacesWithSubpages', 'smwgNamespacesWithSemanticLinks', 'smwgNamespaceIndex', 'wgCanonicalNamespaceNames'); foreach ($defaultSettings as $key) { $globalVars[$key] = !isset($globalVars[$key]) ? array() : $globalVars[$key]; } foreach ($instance->buildNamespaceIndex($globalVars['smwgNamespaceIndex']) as $ns => $index) { if (!$instance->isDefinedConstant($ns)) { define($ns, $index); } } $extraNamespaces = $instance->getNamespacesByLanguageCode($globalVars['wgLanguageCode']); $globalVars['wgCanonicalNamespaceNames'] += $instance->getCanonicalNames(); $globalVars['wgExtraNamespaces'] += $extraNamespaces + $instance->getCanonicalNames(); $globalVars['wgNamespaceAliases'] = array_flip($extraNamespaces) + array_flip($instance->getCanonicalNames()) + $globalVars['wgNamespaceAliases']; $instance->addNamespaceSettings(); return $instance; }