* (bug 1970) Don't show move tab for immobile pages
[lhc/web/wiklou.git] / includes / Skin.php
index ed6d442..be60733 100644 (file)
@@ -11,7 +11,7 @@
  */
 if( defined( "MEDIAWIKI" ) ) {
 
-# See skin.doc
+# See skin.txt
 require_once( 'Linker.php' );
 require_once( 'Image.php' );
 
@@ -267,19 +267,41 @@ class Skin extends Linker {
                $csspage = $wgContLang->getNsText( NS_MEDIAWIKI ) . ':' . $this->getSkinName() . '.css';
                $s = '@import "'.$this->makeUrl($csspage, 'action=raw&ctype=text/css')."\";\n";
 
-               if ( 1 == $wgUser->getOption( 'underline' ) ) {
-                       # Don't override browser settings
-               } else {
-                       # CHECK MERGE @@@
-                       # Force no underline
-                       $s .= "a { text-decoration: none; }\n";
-               }
-               if ( 1 == $this->mOptions['highlightbroken'] ) {
+               return $s . $this->reallyDoGetUserStyles();
+       }
+       
+       function reallyDoGetUserStyles() {
+               global $wgUser;
+               $s = '';
+               $underline = $wgUser->getOption( "underline" ) ? 'underline' : 'none';
+               $s .= "a { text-decoration: $underline; }\n";
+               if( $wgUser->getOption( 'highlightbroken' ) ) {
                        $s .= "a.new, #quickbar a.new { color: #CC2200; }\n";
+               } else {
+                       $s .= <<<END
+a.new, #quickbar a.new,
+a.stub, #quickbar a.stub {
+       color: inherit;
+       text-decoration: inherit;
+}
+a.new:after, #quickbar a.new:after {
+       content: "?";
+       color: #CC2200;
+       text-decoration: $underline;
+}
+a.stub:after, #quickbar a.stub:after {
+       content: "!";
+       color: #772233;
+       text-decoration: $underline;
+}
+END;
                }
-               if ( 1 == $wgUser->getOption( 'justify' ) ) {
+               if( $wgUser->getOption( 'justify' ) ) {
                        $s .= "#article { text-align: justify; }\n";
                }
+               if( !$wgUser->getOption( 'showtoc' ) ) {
+                       $s .= "#toc { display: none; }\n";
+               }
                return $s;
        }
 
@@ -308,6 +330,12 @@ class Skin extends Linker {
 
                }
                $a['onload'] = $wgOut->getOnloadHandler();
+               if( $wgUser->getOption( 'editsectiononrightclick' ) ) {
+                       if( $a['onload'] != '' ) {
+                               $a['onload'] .= ';';
+                       }
+                       $a['onload'] .= 'setupRightClickEdit()';
+               }
                return $a;
        }
 
@@ -328,7 +356,7 @@ class Skin extends Linker {
        }
 
        function doBeforeContent() {
-               global $wgOut, $wgTitle, $wgContLang, $wgSiteNotice;
+               global $wgOut, $wgTitle, $wgContLang;
                $fname = 'Skin::doBeforeContent';
                wfProfileIn( $fname );
 
@@ -378,8 +406,9 @@ class Skin extends Linker {
                $s .= "</tr>\n</table>\n</div>\n";
                $s .= "\n<div id='article'>\n";
 
-               if( $wgSiteNotice ) {
-                       $s .= "\n<div id='siteNotice'>$wgSiteNotice</div>\n";
+               $notice = wfGetSiteNotice();
+               if( $notice ) {
+                       $s .= "\n<div id='siteNotice'>$notice</div>\n";
                }
                $s .= $this->pageTitle();
                $s .= $this->pageSubtitle() ;
@@ -490,7 +519,7 @@ class Skin extends Linker {
                if ( $wgOut->isArticleRelated() ) {
                        if ( $wgTitle->getNamespace() == NS_IMAGE ) {
                                $name = $wgTitle->getDBkey();
-                               $image = new Image( $wgTitle->getDBkey() );
+                               $image = new Image( $wgTitle );
                                if( $image->exists() ) {
                                        $link = htmlspecialchars( $image->getURL() );
                                        $style = $this->getInternalLinkAttributes( $link, $name );
@@ -573,7 +602,6 @@ class Skin extends Linker {
                global $wgOut, $wgTitle, $wgUser;
 
                $s = '<h1 class="pagetitle">' . htmlspecialchars( $wgOut->getPageTitle() ) . '</h1>';
-               if($wgUser->getOption( 'editsectiononrightclick' ) && $wgTitle->userCanEdit()) { $s=$this->editSectionScript($wgTitle, 0,$s);}
                return $s;
        }