X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSkin.php;h=8b10d7fdff0c1f8bf23230a318e00696c03ea76f;hb=0c2a0e4d6bbda94f5411fbb13432f8f3dd52eaa3;hp=43176f2945ae454323ff128a583e9e6709f4fb58;hpb=6ff2162ffee7a8e84ce1f102eac5cd0f5d1b5f94;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Skin.php b/includes/Skin.php index 43176f2945..8b10d7fdff 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -22,7 +22,7 @@ abstract class Skin extends ContextSource { /** * Fetch the set of available skins. - * @return array of strings + * @return array associative array of strings */ static function getSkinNames() { global $wgValidSkinNames; @@ -55,6 +55,18 @@ abstract class Skin extends ContextSource { } return $wgValidSkinNames; } + + /** + * Fetch the skinname messages for available skins. + * @return array of strings + */ + static function getSkinNameMessages() { + $messages = array(); + foreach( self::getSkinNames() as $skinKey => $skinName ) { + $messages[] = "skinname-$skinKey"; + } + return $messages; + } /** * Fetch the list of usable skins in regards to $wgSkipSkins. @@ -86,7 +98,7 @@ abstract class Skin extends ContextSource { $skinNames = Skin::getSkinNames(); - if ( $key == '' ) { + if ( $key == '' || $key == 'default' ) { // Don't return the default immediately; // in a misconfiguration we need to fall back. $key = $wgDefaultSkin; @@ -165,6 +177,9 @@ abstract class Skin extends ContextSource { return $this->skinname; } + /** + * @param $out OutputPage + */ function initPage( OutputPage $out ) { wfProfileIn( __METHOD__ ); @@ -269,7 +284,7 @@ abstract class Skin extends ContextSource { $this->mRelevantUser = User::newFromName( $rootUser, false ); } else { $user = User::newFromName( $rootUser, false ); - if ( $user->isLoggedIn() ) { + if ( $user && $user->isLoggedIn() ) { $this->mRelevantUser = $user; } } @@ -284,6 +299,10 @@ abstract class Skin extends ContextSource { */ abstract function outputPage( OutputPage $out = null ); + /** + * @param $data array + * @return string + */ static function makeVariablesScript( $data ) { if ( $data ) { return Html::inlineScript( @@ -294,6 +313,21 @@ abstract class Skin extends ContextSource { } } + /** + * Make a