/** * Parse the db_key depending on the namespace, extract the name of the WikiPlace * the page should belong to. Works with both homepages and subpages db_key. * Note that this function can return a Wikiplace name even if the page or the WikiPlace does not already exist. * @param string $db_key should be $wikipage->getTitle()->getDBkey() * @param int $namespace should be $wikipage->getTitle()->getNamespace() * @return String The wikiplace name or null the page doesn't belong to an exsiting Wikiplace */ public static function extractWikiplaceRoot($db_key, $namespace = NS_MAIN) { $hierarchy = self::explodeWikipageKey($db_key, $namespace); if (!isset($hierarchy[0]) || !WpPage::isInWikiplaceNamespaces($namespace)) { throw new MWException("Cannot extract WpRoot from key={$db_key} and ns={$namespace}."); } return $hierarchy[0]; }
/** * * @param Title $title * @param String $copywarnMsg */ public static function EditPageCopyrightWarning($title, &$copywarnMsg) { $ns = $title->getNamespace(); if (WpPage::isInWikiplaceNamespaces($ns)) { $copywarnMsg = array('copyrightwarning3', '[[' . wfMsgForContent('copyrightpage') . ']]'); } return true; }