]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - skins/Standard.php
MediaWiki 1.17.0
[autoinstallsdev/mediawiki.git] / skins / Standard.php
index e57cfaf9c90a793b1944ac4cc689f08b72278d4e..2ea6896d903827cd0971a7adef2a53727f3cb335 100644 (file)
@@ -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<br />" . $wgLang->pipeList( array(
                        $this->mainPageLink(),
                        $this->aboutLink(),
-                       $this->specialLink( 'recentchanges' ),
+                       $this->specialLink( 'Recentchanges' ),
                        $this->searchForm() ) )
                        . '<br /><span id="pagestats">' . $this->pageStats() . '</span>';
 
@@ -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.= '<br />'.$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<br /><hr class='sep' />";
                }
 
-               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 ) {