I'm being bold here, proposed solution to:
[lhc/web/wiklou.git] / includes / Skin.php
index fbe880d..8f7a950 100644 (file)
@@ -178,15 +178,17 @@ class Skin extends Linker {
 
                wfProfileIn( __METHOD__ );
 
+               # Add favicons and Apple touch icons, if they're not the defaults
+               #
                # Generally the order of the favicon and apple-touch-icon links
                # should not matter, but Konqueror (3.5.9 at least) incorrectly
                # uses whichever one appears later in the HTML source.  Make sure
                # apple-touch-icon is specified first to avoid this.
-               if( false !== $wgAppleTouchIcon ) {
+               if( false !== $wgAppleTouchIcon && wfExpandUrl('/apple-touch-icon.png') != wfExpandUrl($wgAppleTouchIcon) ) {
                        $out->addLink( array( 'rel' => 'apple-touch-icon', 'href' => $wgAppleTouchIcon ) );
                }
 
-               if( false !== $wgFavicon ) {
+               if( false !== $wgFavicon && wfExpandUrl('/favicon.ico') != wfExpandUrl($wgFavicon) ) {
                        $out->addLink( array( 'rel' => 'shortcut icon', 'href' => $wgFavicon ) );
                }
 
@@ -449,17 +451,21 @@ class Skin extends Linker {
                return self::makeVariablesScript( $vars );
        }
        /**
-        * Returns the Head Scripts (from local skin context)
+        * Return a random selection of the scripts we want in the header, 
+        * according to no particular rhyme or reason.  Various other scripts are 
+        * returned from a haphazard assortment of other functions scattered over 
+        * various files.  This entire hackish system needs to be burned to the 
+        * ground and rebuilt.
         *
-        * local $out variable that should be the same as $wgOut
+        * @param $out OutputPage object, should be $wgOut
         *
         * @return string Raw HTML to output to <head>
         */
-       function getHeadScripts( OutputPage &$out ) {
+       function getHeadScripts( OutputPage $out ) {
                global $wgStylePath, $wgUser, $wgJsMimeType, $wgStyleVersion, $wgOut;
                global $wgUseSiteJs;
 
-               $vars = self::makeGlobalVariablesScript( array( 'skinname' => $this->getSkinName() ) );
+               $vars = self::makeGlobalVariablesScript( $this->getSkinName() );
 
                //moved wikibits to be called earlier on
                //$out->addScriptFile( "{$wgStylePath}/common/wikibits.js" );
@@ -478,7 +484,7 @@ class Skin extends Linker {
                                'action=raw&ctype='.$wgJsMimeType );
                        $wgOut->addScriptFile( $userjs );
                }
-               return $vars . "\t" . implode ( "\n\t", $r ) . $out->mScripts;
+               return "\t" . $vars . "\t" . $out->mScripts;
        }
 
        /**
@@ -598,6 +604,10 @@ END;
                if( !$wgUser->getOption( 'editsection' ) ) {
                        $s .= ".editsection { display: none; }\n";
                }
+               $fontstyle = $wgUser->getOption( 'editfont' );
+               if ( $fontstyle !== 'default' ) {
+                       $s .= "textarea { font-family: $fontstyle; }\n";
+               }
                return $s;
        }