skin names now in associative array, provides fallback for the three main skins

This commit is contained in:
Gabriel Wicke 2004-03-26 22:25:57 +00:00
parent dbf5ee150d
commit d1adc1b994
3 changed files with 27 additions and 9 deletions

View file

@ -9,15 +9,17 @@ include_once( "Feed.php" );
# Language class has internationalized names
#
/* private */ $wgValidSkinNames = array(
"Standard", "Nostalgia", "CologneBlue"
'standard' => "Standard",
'nostalgia' => "Nostalgia",
'cologneblue' => "CologneBlue"
);
if( $wgUseSmarty ) {
$wgValidSkinNames[] = "Smarty";
$wgValidSkinNames[] = "Montparnasse";
$wgValidSkinNames['smarty'] = "Smarty";
$wgValidSkinNames['montparnasse'] = "Montparnasse";
}
if( $wgUsePHPTal ) {
#$wgValidSkinNames[] = "PHPTal";
$wgValidSkinNames[] = "DaVinci";
$wgValidSkinNames['davinci'] = "DaVinci";
}
include_once( "RecentChange.php" );

View file

@ -434,10 +434,21 @@ class User {
if ( ! isset( $this->mSkin ) ) {
$skinNames = Skin::getSkinNames();
$s = $this->getOption( "skin" );
if ( "" == $s ) { $s = 0; }
if ( "" == $s ) { $s = 'standard'; }
if ( $s >= count( $skinNames ) ) { $sn = "SkinStandard"; }
else $sn = "Skin" . $skinNames[$s];
if ( !isset( $skinNames[$s] ) ) {
$fallback = array(
'standard' => "Standard",
'nostalgia' => "Nostalgia",
'cologneblue' => "Cologne Blue");
if(is_int($s) && isset( $fallback[$s]) ){
$sn = $fallback[$s];
} else {
$sn = "SkinStandard";
}
} else {
$sn = "Skin" . $skinNames[$s];
}
$this->mSkin = new $sn;
}
return $this->mSkin;

View file

@ -82,7 +82,7 @@ if($wgMetaNamespace === FALSE)
"quickbar" => 1, "underline" => 1, "hover" => 1,
"cols" => 80, "rows" => 25, "searchlimit" => 20,
"contextlines" => 5, "contextchars" => 50,
"skin" => 0, "math" => 1, "rcdays" => 7, "rclimit" => 50,
"skin" => 'standard', "math" => 1, "rcdays" => 7, "rclimit" => 50,
"highlightbroken" => 1, "stubthreshold" => 0,
"previewontop" => 1, "editsection"=>0,"editsectiononrightclick"=>0, "showtoc"=>1,
"showtoolbar" =>1,
@ -94,7 +94,12 @@ if($wgMetaNamespace === FALSE)
);
/* private */ $wgSkinNamesEn = array(
"Standard", "Nostalgia", "Cologne Blue", "Paddington", "Montparnasse", "DaVinci"
'standard' => "Standard",
'nostalgia' => "Nostalgia",
'cologneblue' => "Cologne Blue",
'smarty' => "Paddington",
'montparnasse' => "Montparnasse",
'davinci' => "DaVinci"
);
/* private */ $wgMathNamesEn = array(