Index: trunk/phase3/CREDITS |
— | — | @@ -104,6 +104,7 @@ |
105 | 105 | * Robert Treat |
106 | 106 | * RockMFR |
107 | 107 | * ST47 |
| 108 | +* Scott Colcord |
108 | 109 | * Simon Walker |
109 | 110 | * Stefano Codari |
110 | 111 | * Str4nd |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -546,7 +546,7 @@ |
547 | 547 | * @return \type{\string} Namespace text |
548 | 548 | */ |
549 | 549 | public function getNsText() { |
550 | | - global $wgContLang, $wgCanonicalNamespaceNames; |
| 550 | + global $wgContLang; |
551 | 551 | |
552 | 552 | if ( '' != $this->mInterwiki ) { |
553 | 553 | // This probably shouldn't even happen. ohh man, oh yuck. |
— | — | @@ -555,8 +555,8 @@ |
556 | 556 | // |
557 | 557 | // Use the canonical namespaces if possible to try to |
558 | 558 | // resolve a foreign namespace. |
559 | | - if( isset( $wgCanonicalNamespaceNames[$this->mNamespace] ) ) { |
560 | | - return $wgCanonicalNamespaceNames[$this->mNamespace]; |
| 559 | + if( MWNamespace::exists( $this->mNamespace ) ) { |
| 560 | + return MWNamespace::getCanonicalName( $this->mNamespace ); |
561 | 561 | } |
562 | 562 | } |
563 | 563 | return $wgContLang->getNsText( $this->mNamespace ); |
— | — | @@ -3616,13 +3616,13 @@ |
3617 | 3617 | * @return \type{\string} XML 'id' name |
3618 | 3618 | */ |
3619 | 3619 | public function getNamespaceKey( $prepend = 'nstab-' ) { |
3620 | | - global $wgContLang, $wgCanonicalNamespaceNames; |
| 3620 | + global $wgContLang; |
3621 | 3621 | // Gets the subject namespace if this title |
3622 | 3622 | $namespace = MWNamespace::getSubject( $this->getNamespace() ); |
3623 | 3623 | // Checks if cononical namespace name exists for namespace |
3624 | | - if ( isset( $wgCanonicalNamespaceNames[$namespace] ) ) { |
| 3624 | + if ( MWNamespace::exists( $this->getNamespace() ) ) { |
3625 | 3625 | // Uses canonical namespace name |
3626 | | - $namespaceKey = $wgCanonicalNamespaceNames[$namespace]; |
| 3626 | + $namespaceKey = MWNamespace::getCanonicalName( $namespace ); |
3627 | 3627 | } else { |
3628 | 3628 | // Uses text of namespace |
3629 | 3629 | $namespaceKey = $this->getSubjectNsText(); |
Index: trunk/phase3/includes/Namespace.php |
— | — | @@ -107,7 +107,16 @@ |
108 | 108 | ? $index - 1 |
109 | 109 | : $index; |
110 | 110 | } |
| 111 | + |
| 112 | + /** |
| 113 | + * Returns whether the specified namespace exists |
| 114 | + */ |
| 115 | + public static function exists( $index ) { |
| 116 | + global $wgCanonicalNamespaceNames; |
| 117 | + return isset( $wgCanonicalNamespaceNames[$index] ); |
| 118 | + } |
111 | 119 | |
| 120 | + |
112 | 121 | /** |
113 | 122 | * Returns the canonical (English Wikipedia) name for a given index |
114 | 123 | * |
Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -134,7 +134,7 @@ |
135 | 135 | global $wgMaxCredits, $wgShowCreditsIfMax; |
136 | 136 | global $wgPageShowWatchingUsers; |
137 | 137 | global $wgUseTrackbacks, $wgUseSiteJs, $wgDebugComments; |
138 | | - global $wgArticlePath, $wgScriptPath, $wgServer, $wgCanonicalNamespaceNames; |
| 138 | + global $wgArticlePath, $wgScriptPath, $wgServer; |
139 | 139 | |
140 | 140 | wfProfileIn( __METHOD__ ); |
141 | 141 | |
— | — | @@ -226,8 +226,8 @@ |
227 | 227 | $tpl->set( 'pageclass', $this->getPageClasses( $this->mTitle ) ); |
228 | 228 | $tpl->set( 'skinnameclass', ( 'skin-' . Sanitizer::escapeClass( $this->getSkinName() ) ) ); |
229 | 229 | |
230 | | - $nsname = isset( $wgCanonicalNamespaceNames[ $this->mTitle->getNamespace() ] ) ? |
231 | | - $wgCanonicalNamespaceNames[ $this->mTitle->getNamespace() ] : |
| 230 | + $nsname = MWNamespace::exists( $this->mTitle->getNamespace() ) ? |
| 231 | + MWNamespace::getCanonicalName( $this->mTitle->getNamespace() ) : |
232 | 232 | $this->mTitle->getNsText(); |
233 | 233 | |
234 | 234 | $tpl->set( 'nscanonical', $nsname ); |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -357,7 +357,7 @@ |
358 | 358 | } |
359 | 359 | global $wgScript, $wgTitle, $wgStylePath, $wgUser, $wgScriptExtension; |
360 | 360 | global $wgArticlePath, $wgScriptPath, $wgServer, $wgContLang, $wgLang; |
361 | | - global $wgCanonicalNamespaceNames, $wgOut, $wgArticle; |
| 361 | + global $wgOut, $wgArticle; |
362 | 362 | global $wgBreakFrames, $wgRequest, $wgVariantArticlePath, $wgActionPaths; |
363 | 363 | global $wgUseAjax, $wgAjaxWatch; |
364 | 364 | global $wgVersion, $wgEnableAPI, $wgEnableWriteAPI; |
— | — | @@ -365,7 +365,7 @@ |
366 | 366 | global $wgMWSuggestTemplate, $wgDBname, $wgEnableMWSuggest; |
367 | 367 | |
368 | 368 | $ns = $wgTitle->getNamespace(); |
369 | | - $nsname = isset( $wgCanonicalNamespaceNames[ $ns ] ) ? $wgCanonicalNamespaceNames[ $ns ] : $wgTitle->getNsText(); |
| 369 | + $nsname = MWNamespace::exists( $ns ) ? MWNamespace::getCanonicalName( $ns ) : $wgTitle->getNsText(); |
370 | 370 | $separatorTransTable = $wgContLang->separatorTransformTable(); |
371 | 371 | $separatorTransTable = $separatorTransTable ? $separatorTransTable : array(); |
372 | 372 | $compactSeparatorTransTable = array( |