From 9db190c7e736ec8d063187d4241b59feaf7dc2d1 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 22 Jun 2011 11:28:20 +0200 Subject: update to MediaWiki 1.17.0 --- skins/Standard.php | 59 ++++++++++++++++++++++++------------------------------ 1 file changed, 26 insertions(+), 33 deletions(-) (limited to 'skins/Standard.php') diff --git a/skins/Standard.php b/skins/Standard.php index e57cfaf9..2ea6896d 100644 --- a/skins/Standard.php +++ b/skins/Standard.php @@ -20,34 +20,30 @@ class SkinStandard extends Skin { * */ function setupSkinUserCss( OutputPage $out ){ - if ( 3 == $this->qbSetting() ) { # Floating left - $out->addStyle( 'common/quickbar.css' ); - } elseif ( 4 == $this->qbSetting() ) { # Floating right - $out->addStyle( 'common/quickbar-right.css' ); - } - parent::setupSkinUserCss( $out ); - } - - /** - * - */ - function reallyGenerateUserStylesheet() { - $s = parent::reallyGenerateUserStylesheet(); + global $wgContLang; $qb = $this->qbSetting(); + $rules = array(); if ( 2 == $qb ) { # Right - $s .= "#quickbar { position: absolute; top: 4px; right: 4px; " . - "border-left: 2px solid #000000; }\n" . - "#article, #mw-data-after-content { margin-left: 4px; margin-right: 152px; }\n"; + $rules[] = "#quickbar { position: absolute; top: 4px; right: 4px; border-left: 2px solid #000000; }"; + $rules[] = "#article, #mw-data-after-content { margin-left: 4px; margin-right: 152px; }"; } elseif ( 1 == $qb || 3 == $qb ) { - $s .= "#quickbar { position: absolute; top: 4px; left: 4px; " . - "border-right: 1px solid gray; }\n" . - "#article, #mw-data-after-content { margin-left: 152px; margin-right: 4px; }\n"; + $rules[] = "#quickbar { position: absolute; top: 4px; left: 4px; border-right: 1px solid gray; }"; + $rules[] = "#article, #mw-data-after-content { margin-left: 152px; margin-right: 4px; }"; + if( 3 == $qb ) { + $rules[] = "#quickbar { position: fixed; padding: 4px; }"; + } } elseif ( 4 == $qb ) { - $s .= "#quickbar { border-right: 1px solid gray; }\n" . - "#article, #mw-data-after-content { margin-right: 152px; margin-left: 4px; }\n"; + $rules[] = "#quickbar { position: fixed; right: 0px; top: 0px; padding: 4px;}"; + $rules[] = "#quickbar { border-right: 1px solid gray; }"; + $rules[] = "#article, #mw-data-after-content { margin-right: 152px; margin-left: 4px; }"; } - return $s; + $style = implode( "\n", $rules ); + if ( $wgContLang->getDir() === 'rtl' ) { + $style = CSSJanus::transform( $style, true, false ); + } + $out->addInlineStyle( $style ); + parent::setupSkinUserCss( $out ); } function doAfterContent() { @@ -81,7 +77,7 @@ class SkinStandard extends Skin { $s .= "\n
" . $wgLang->pipeList( array( $this->mainPageLink(), $this->aboutLink(), - $this->specialLink( 'recentchanges' ), + $this->specialLink( 'Recentchanges' ), $this->searchForm() ) ) . '
' . $this->pageStats() . ''; @@ -103,7 +99,6 @@ class SkinStandard extends Skin { function quickBar() { global $wgOut, $wgUser, $wgRequest, $wgContLang; - global $wgEnableUploads, $wgRemoteUploads; wfProfileIn( __METHOD__ ); @@ -131,7 +126,7 @@ class SkinStandard extends Skin { } if( $wgUser->isLoggedIn() ) { - $s.= $this->specialLink( 'watchlist' ) ; + $s.= $this->specialLink( 'Watchlist' ) ; $s .= $sep . $this->linkKnown( SpecialPage::getTitleFor( 'Contributions' ), wfMsg( 'mycontris' ), @@ -187,7 +182,8 @@ class SkinStandard extends Skin { } $link = $this->mTitle->getText(); - if( $nstext = $wgContLang->getNsText( $tns ) ) { # add namespace if necessary + $nstext = $wgContLang->getNsText( $tns ); + if( $nstext ) { # add namespace if necessary $link = $nstext . ':' . $link; } @@ -215,10 +211,6 @@ class SkinStandard extends Skin { array( 'known', 'noclasses' ) ); - #if( $tns%2 && $action!='edit' && !$wpPreview) { - #$s.= '
'.$this->linkKnown( Title::newFromText( $wgTitle->getPrefixedText() ),wfMsg('postcomment'),array(),array('action'=>'edit','section'=>'new')); - #} - /* watching could cause problems in edit mode: if user edits article, then loads "watch this article" in background and then saves @@ -264,10 +256,11 @@ class SkinStandard extends Skin { $s .= "\n

"; } - if ( $wgUser->isLoggedIn() && ( $wgEnableUploads || $wgRemoteUploads ) ) { - $s .= $this->specialLink( 'upload' ) . $sep; + if( UploadBase::isEnabled() && UploadBase::isAllowed( $wgUser ) === true ) { + $s .= $this->getUploadLink() . $sep; } - $s .= $this->specialLink( 'specialpages' ); + + $s .= $this->specialLink( 'Specialpages' ); global $wgSiteSupportPage; if( $wgSiteSupportPage ) { -- cgit v1.2.2