* (bug 5355) Include skin name and style JS settings in page source;
[lhc/web/wiklou.git] / skins / Standard.php
index 820b9f4..067496f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * See skin.doc
+ * See skin.txt
  *
  * @todo document
  * @package MediaWiki
@@ -8,7 +8,7 @@
  */
 
 if( !defined( 'MEDIAWIKI' ) )
-       die();
+       die( -1 );
 
 /**
  * @todo document
@@ -21,11 +21,11 @@ class SkinStandard extends Skin {
         *
         */
        function getHeadScripts() {
-               global $wgStylePath;
+               global $wgStylePath, $wgJsMimeType;
 
                $s = parent::getHeadScripts();
                if ( 3 == $this->qbSetting() ) { # Floating left
-                       $s .= "<script language='javascript' type='text/javascript' " .
+                       $s .= "<script language='javascript' type='$wgJsMimeType' " .
                          "src='{$wgStylePath}/common/sticky.js'></script>\n";
                }
                return $s;
@@ -40,6 +40,9 @@ class SkinStandard extends Skin {
                if ( 3 == $this->qbSetting() ) { # Floating left
                        $s .= "<style type='text/css'>\n" .
                          "@import '{$wgStylePath}/common/quickbar.css';\n</style>\n";
+               } else if ( 4 == $this->qbSetting() ) { # Floating right
+                       $s .= "<style type='text/css'>\n" .
+                         "@import '{$wgStylePath}/common/quickbar-right.css';\n</style>\n";
                }
                $s .= parent::getUserStyles();
                return $s;
@@ -62,6 +65,9 @@ class SkinStandard extends Skin {
                        $s .= "#quickbar { position: absolute; top: 4px; left: 4px; " .
                          "border-right: 1px solid gray; }\n" .
                          "#article { margin-left: 152px; margin-right: 4px; }\n";
+               } else if ( 4 == $qb) {
+                       $s .= "#quickbar { border-right: 1px solid gray; }\n" .
+                         "#article { margin-right: 152px; margin-left: 4px; }\n";
                }
                return $s;
        }
@@ -132,7 +138,7 @@ class SkinStandard extends Skin {
 
        function quickBar() {
                global $wgOut, $wgTitle, $wgUser, $wgRequest, $wgContLang;
-               global $wgDisableUploads, $wgRemoteUploads, $wgNavigationLinks;
+               global $wgEnableUploads, $wgRemoteUploads;
 
                $fname =  'Skin::quickBar';
                wfProfileIn( $fname );
@@ -146,16 +152,17 @@ class SkinStandard extends Skin {
 
                $sep = "\n<br />";
 
-               foreach ( $wgNavigationLinks as $link ) {
-                       $msg = wfMsgForContent( $link['href'] );
-                       $text = wfMsg( $link['text'] );
-                       if ( $msg != '-' && $text != '-' ) {
-                               $s .= '<a href="' . $this->makeInternalOrExternalUrl( $msg ) . '">' .
-                                       htmlspecialchars( $text ) . '</a>' . $sep;
+               # Use the first heading from the Monobook sidebar as the "browse" section
+               $bar = $this->buildSidebar();
+               $browseLinks = reset( $bar );
+
+               foreach ( $browseLinks as $link ) {
+                       if ( $link['text'] != '-' ) {
+                               $s .= "<a href=\"{$link['href']}\">" .
+                                       htmlspecialchars( $link['text'] ) . '</a>' . $sep;
                        }
                }
 
-
                if( $wgUser->isLoggedIn() ) {
                        $s.= $this->specialLink( 'watchlist' ) ;
                        $s .= $sep . $this->makeKnownLink( $wgContLang->specialPage( 'Contributions' ),
@@ -261,7 +268,7 @@ class SkinStandard extends Skin {
                        $s .= "\n<br /><hr class='sep' />";
                }
 
-               if ( $wgUser->isLoggedIn() && ( !$wgDisableUploads || $wgRemoteUploads ) ) {
+               if ( $wgUser->isLoggedIn() && ( $wgEnableUploads || $wgRemoteUploads ) ) {
                        $s .= $this->specialLink( 'upload' ) . $sep;
                }
                $s .= $this->specialLink( 'specialpages' )