Object return type hints
[lhc/web/wiklou.git] / includes / Skin.php
index 527e659..0ccd2f1 100644 (file)
@@ -244,6 +244,7 @@ class Skin extends Linker {
                }
 
                $lb = new LinkBatch( $titles );
+               $lb->setCaller( __METHOD__ );
                $lb->execute();
        }
 
@@ -357,7 +358,9 @@ class Skin extends Linker {
 
        static function makeVariablesScript( $data ) {
                if ( $data ) {
-                       return Html::inlineScript( 'mediaWiki.config.set(' . FormatJson::encode( $data ) . ');' );
+                       return Html::inlineScript(
+                               ResourceLoader::makeLoaderConditionalScript( ResourceLoader::makeConfigSetScript( $data ) )
+                       );
                } else {
                        return '';
                } 
@@ -481,7 +484,7 @@ class Skin extends Linker {
         * @private
         */
        function setupUserCss( OutputPage $out ) {
-               global $wgRequest, $wgUser;
+               global $wgRequest;
                global $wgUseSiteCss, $wgAllowUserCss, $wgAllowUserCssPrefs, $wgSquidMaxage;
 
                wfProfileIn( __METHOD__ );
@@ -515,7 +518,7 @@ class Skin extends Linker {
 
                // Per-user preference styles
                if ( $wgAllowUserCssPrefs ) {
-                       $out->addModuleStyles( 'user.preferences' );
+                       $out->addModuleStyles( 'user.options' );
                }
 
                wfProfileOut( __METHOD__ );
@@ -565,6 +568,15 @@ class Skin extends Linker {
 
                return "$numeric $type $name";
        }
+       
+       /**
+        * This will be called by OutputPage::headElement when it is creating the
+        * <body> tag, skins can override it if they have a need to add in any
+        * body attributes or classes of their own.
+        */
+       function bodyAttributes( $out, &$bodyAttrs ) {
+               // does nothing by default
+       }
 
        /**
         * URL to the logo
@@ -1055,7 +1067,7 @@ class Skin extends Linker {
        function subPageSubtitle() {
                $subpages = '';
 
-               if ( !wfRunHooks( 'SkinSubPageSubtitle', array( &$subpages ) ) ) {
+               if ( !wfRunHooks( 'SkinSubPageSubtitle', array( &$subpages, $this ) ) ) {
                        return $subpages;
                }
 
@@ -1159,7 +1171,7 @@ class Skin extends Linker {
                                        SpecialPage::getTitleFor( 'Userlogout' ), wfMsg( 'logout' ),
                                        array(), array( 'returnto' => $returnTo )
                                ),
-                               $this->specialLink( 'preferences' ),
+                               $this->specialLink( 'Preferences' ),
                        ) );
                }
 
@@ -1213,7 +1225,7 @@ class Skin extends Linker {
 
                $s = array(
                        $this->mainPageLink(),
-                       $this->specialLink( 'recentchanges' )
+                       $this->specialLink( 'Recentchanges' )
                );
 
                if ( $wgOut->isArticleRelated() ) {
@@ -2043,7 +2055,7 @@ class Skin extends Linker {
 
                return array(
                        'href' => $title->getLocalURL( $urlaction ),
-                       'exists' => $title->getArticleID() != 0 ? true : false
+                       'exists' => $title->getArticleID() != 0,
                );
        }