r2849 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r2848‎ | r2849 | r2850 >
Date:22:25, 26 March 2004
Author:gabrielwicke
Status:old
Tags:
Comment:
skin names now in associative array, provides fallback for the three main skins
Modified paths:
  • /trunk/phase3/includes/Skin.php (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -434,10 +434,21 @@
435435 if ( ! isset( $this->mSkin ) ) {
436436 $skinNames = Skin::getSkinNames();
437437 $s = $this->getOption( "skin" );
438 - if ( "" == $s ) { $s = 0; }
 438+ if ( "" == $s ) { $s = 'standard'; }
439439
440 - if ( $s >= count( $skinNames ) ) { $sn = "SkinStandard"; }
441 - else $sn = "Skin" . $skinNames[$s];
 440+ if ( !isset( $skinNames[$s] ) ) {
 441+ $fallback = array(
 442+ 'standard' => "Standard",
 443+ 'nostalgia' => "Nostalgia",
 444+ 'cologneblue' => "Cologne Blue");
 445+ if(is_int($s) && isset( $fallback[$s]) ){
 446+ $sn = $fallback[$s];
 447+ } else {
 448+ $sn = "SkinStandard";
 449+ }
 450+ } else {
 451+ $sn = "Skin" . $skinNames[$s];
 452+ }
442453 $this->mSkin = new $sn;
443454 }
444455 return $this->mSkin;
Index: trunk/phase3/includes/Skin.php
@@ -9,15 +9,17 @@
1010 # Language class has internationalized names
1111 #
1212 /* private */ $wgValidSkinNames = array(
13 - "Standard", "Nostalgia", "CologneBlue"
 13+ 'standard' => "Standard",
 14+ 'nostalgia' => "Nostalgia",
 15+ 'cologneblue' => "CologneBlue"
1416 );
1517 if( $wgUseSmarty ) {
16 - $wgValidSkinNames[] = "Smarty";
17 - $wgValidSkinNames[] = "Montparnasse";
 18+ $wgValidSkinNames['smarty'] = "Smarty";
 19+ $wgValidSkinNames['montparnasse'] = "Montparnasse";
1820 }
1921 if( $wgUsePHPTal ) {
2022 #$wgValidSkinNames[] = "PHPTal";
21 - $wgValidSkinNames[] = "DaVinci";
 23+ $wgValidSkinNames['davinci'] = "DaVinci";
2224 }
2325
2426 include_once( "RecentChange.php" );
Index: trunk/phase3/languages/Language.php
@@ -82,7 +82,7 @@
8383 "quickbar" => 1, "underline" => 1, "hover" => 1,
8484 "cols" => 80, "rows" => 25, "searchlimit" => 20,
8585 "contextlines" => 5, "contextchars" => 50,
86 - "skin" => 0, "math" => 1, "rcdays" => 7, "rclimit" => 50,
 86+ "skin" => 'standard', "math" => 1, "rcdays" => 7, "rclimit" => 50,
8787 "highlightbroken" => 1, "stubthreshold" => 0,
8888 "previewontop" => 1, "editsection"=>0,"editsectiononrightclick"=>0, "showtoc"=>1,
8989 "showtoolbar" =>1,
@@ -94,7 +94,12 @@
9595 );
9696
9797 /* private */ $wgSkinNamesEn = array(
98 - "Standard", "Nostalgia", "Cologne Blue", "Paddington", "Montparnasse", "DaVinci"
 98+ 'standard' => "Standard",
 99+ 'nostalgia' => "Nostalgia",
 100+ 'cologneblue' => "Cologne Blue",
 101+ 'smarty' => "Paddington",
 102+ 'montparnasse' => "Montparnasse",
 103+ 'davinci' => "DaVinci"
99104 );
100105
101106 /* private */ $wgMathNamesEn = array(

Status & tagging log