public function setup() { parent::setup(); self::$errId = null; // assume 'sgExtraNamespaces' array doesn't exist $this->sgid = 0; // assume default. $r = $this->checkTable(); if ($r == false) { return; } // setup 'supergroup' id based on looking up // user in the 'supergroups' database table global $wgUser; $this->sgid = $this->getSgId($wgUser); // namespace boundary checks // only allowed 256 namespaces per SuperGroup $r = $this->checkBoundaries(); // if we got a 'null', then not much to do! // (i.e. there is no 'extra' namespaces asked for) if ($r === null) { return; } // if we got 'false', then an error with the // namespace ids was declared. if ($r == false) { self::$errId = true; return; } // if we got a 'true' response, then let's setup! $this->setupExtraNamespaceSet(); }
* -- The normal namespaces set starts at 0 (well, technically * there are also the -1 and -2 namespaces) * * LocalSettings.php: * ================== * require("extensions/ExtensionClass.php"); * require("extensions/SuperGroups/SuperGroups.php"); * * CONFIGURATION EXAMPLE: * ====================== $sgExtraNamespaces = array ( 100 => array( 'name' => "Admin", 'id' => 'NS_ADMIN'), 102 => array( 'name' => "Blog", 'id' => 'NS_BLOG' ), 103 => array( 'name' => "Blog_talk", 'id' => 'NS_BLOG_TALK' ), 104 => array( 'name' => "Contact", 'id' => 'NS_CONTACT' ), 106 => array( 'name' => "Test", 'id' => 'NS_TEST' ), ); * * HISTORY: v1.0 * */ require dirname(__FILE__) . '/SuperGroupsClass.php'; // Verify if 'ExtensionClass' is present. if (!class_exists('ExtensionClass')) { echo 'ExtensionClass missing: SuperGroups extension will not work!'; } else { SuperGroupsClass::singleton(); } $wgExtensionCredits[SuperGroupsClass::thisType][] = array('name' => SuperGroupsClass::thisName, 'version' => 'v1.0 $Id$', 'author' => 'Jean-Lou Dupont', 'description' => 'Extension status: ');