Localisation updates for core and extension messages from translatewiki.net (2010...
[lhc/web/wiklou.git] / includes / Skin.php
index 605b2c4..9495c07 100644 (file)
@@ -388,7 +388,7 @@ class Skin extends Linker {
                        implode( "\t", $digitTransTable ),
                );
 
-               $mainPage = Title::newFromText( wfMsgForContent( 'mainpage' ) );
+               $mainPage = Title::newMainPage();
                $vars = array(
                        'skin' => $skinName,
                        'stylepath' => $wgStylePath,
@@ -432,7 +432,7 @@ class Skin extends Linker {
 
                // if on upload page output the extension list & js_upload
                if( SpecialPage::resolveAlias( $wgTitle->getDBkey() ) == 'Upload' ) {
-                       global $wgFileExtensions, $wgAjaxUploadInterface;
+                       global $wgFileExtensions;
                        $vars['wgFileExtensions'] = $wgFileExtensions;
                }
 
@@ -557,7 +557,9 @@ class Skin extends Linker {
                        $underline = $undopt ? 'underline' : 'none';
                        $s .= "a { text-decoration: $underline; }\n";
                }
-               if( !$wgUser->getOption( 'highlightbroken' ) ) {
+               if( $wgUser->getOption( 'highlightbroken' ) ) {
+                       $s .= "a.new, #quickbar a.new { color: #CC2200; }\n";
+               } else {
                        $s .= <<<CSS
 a.new, #quickbar a.new,
 a.stub, #quickbar a.stub {
@@ -614,11 +616,7 @@ CSS;
                // Per-site custom styles
                if( $wgUseSiteCss ) {
                        global $wgHandheldStyle;
-                       $query = wfArrayToCGI( array(
-                               'usemsgcache' => 'yes',
-                               'ctype' => 'text/css',
-                               'smaxage' => $wgSquidMaxage
-                       ) + $siteargs );
+                       $query = wfArrayToCGI( self::getDynamicStylesheetQuery() );
                        # Site settings must override extension css! (bug 15025)
                        $out->addStyle( self::makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI ) );
                        $out->addStyle( self::makeNSUrl( 'Print.css', $query, NS_MEDIAWIKI ), 'print' );
@@ -664,6 +662,22 @@ CSS;
 
                wfProfileOut( __METHOD__ );
        }
+       
+       /**
+        * Get the query to generate a dynamic stylesheet
+        * 
+        * @return array
+        */
+       public static function getDynamicStylesheetQuery() {
+               global $wgSquidMaxage;
+               return array(
+                               'action' => 'raw',
+                               'maxage' => $wgSquidMaxage,
+                               'usemsgcache' => 'yes',
+                               'ctype' => 'text/css',
+                               'smaxage' => $wgSquidMaxage,
+                       );
+       }
 
        /**
         * Add skin specific stylesheets
@@ -875,7 +889,7 @@ CSS;
        }
 
        function getQuickbarCompensator( $rows = 1 ) {
-               return "<td width='152' rowspan='{$rows}'>&nbsp;</td>";
+               return "<td width='152' rowspan='{$rows}'>&#160;</td>";
        }
 
        /**
@@ -1275,7 +1289,7 @@ CSS;
                  . '<input type="submit" name="go" value="' . wfMsg( 'searcharticle' ) . '" />';
 
                if( $wgUseTwoButtonsSearchForm ) {
-                       $s .= '&nbsp;<input type="submit" name="fulltext" value="' . wfMsg( 'searchbutton' ) . "\" />\n";
+                       $s .= '&#160;<input type="submit" name="fulltext" value="' . wfMsg( 'searchbutton' ) . "\" />\n";
                } else {
                        $s .= ' <a href="' . $this->escapeSearchLink() . '" rel="search">' . wfMsg( 'powersearch-legend' ) . "</a>\n";
                }
@@ -1892,12 +1906,13 @@ CSS;
                        $nt = Title::newFromText( $l );
                        $url = $nt->escapeFullURL();
                        $text = $wgContLang->getLanguageName( $nt->getInterwiki() );
+                       $title = htmlspecialchars( $nt->getText() );
 
                        if ( $text == '' ) {
                                $text = $l;
                        }
                        $style = $this->getExternalLinkAttributes();
-                       $s .= "<a href=\"{$url}\"{$style}>{$text}</a>";
+                       $s .= "<a href=\"{$url}\" title=\"{$title}\"{$style}>{$text}</a>";
                }
                if( $wgContLang->isRTL() ) {
                        $s .= '</span>';
@@ -1986,7 +2001,7 @@ CSS;
                );
        }
 
-       function uploadLink() {
+       function getUploadLink() {
                global $wgUploadNavigationUrl;
 
                if( $wgUploadNavigationUrl ) {
@@ -2104,7 +2119,7 @@ CSS;
                }
 
                $bar = array();
-               $this->addToSidebar( $bar, wfMsgForContentNoTrans( 'sidebar' ) );
+               $this->addToSidebar( $bar, 'sidebar' );
 
                wfRunHooks( 'SkinBuildSidebar', array( $this, &$bar ) );
                if ( $wgEnableSidebarCache ) {
@@ -2113,16 +2128,26 @@ CSS;
                wfProfileOut( __METHOD__ );
                return $bar;
        }
+       /**
+        * Add content from a sidebar system message
+        * Currently only used for MediaWiki:Sidebar (but may be used by Extensions)
+        *
+        * This is just a wrapper around addToSidebarPlain() for backwards compatibility
+        * 
+        * @param &$bar array
+        * @param $message String
+        */
+       function addToSidebar( &$bar, $message ) {
+               $this->addToSidebarPlain( $bar, wfMsgForContent( $message ) );
+       }
        
        /**
-        * Add content to the sidebar from text
-        * @since 1.16
+        * Add content from plain text
+        * @since 1.17
         * @param &$bar array
         * @param $text string
-        * 
-        * @return array
         */
-       function addToSidebar( &$bar, $text ) {
+       function addToSidebarPlain( &$bar, $text ) {
                $lines = explode( "\n", $text );
                $wikiBar = array(); # We need to handle the wikitext on a different variable, to avoid trying to do an array operation on text, which would be a fatal error.
 
@@ -2139,9 +2164,6 @@ CSS;
                        } else {
                                $line = trim( $line, '* ' );
                                if( strpos( $line, '|' ) !== false ) { // sanity check
-                                       global $wgMessageCache;
-                                       $line = $wgMessageCache->transform( $line );
-                                       
                                        $line = array_map( 'trim', explode( '|', $line, 2 ) );
                                        $link = wfMsgForContent( $line[0] );
                                        if( $link == '-' ) {