Fixes bug #2632 : new image height when zooming without using "thumb" was not computed.
[lhc/web/wiklou.git] / includes / Skin.php
index eced385..ad48e25 100644 (file)
@@ -147,6 +147,7 @@ class Skin extends Linker {
 
                wfProfileIn( 'Skin::outputPage' );
                $this->initPage( $out );
+
                $out->out( $out->headElement() );
 
                $out->out( "\n<body" );
@@ -159,6 +160,7 @@ class Skin extends Linker {
                        $out->out( "<!-- Wiki debugging output:\n" .
                          $out->mDebugtext . "-->\n" );
                }
+
                $out->out( $this->beforeContent() );
 
                $out->out( $out->mBodytext . "\n" );
@@ -197,17 +199,17 @@ class Skin extends Linker {
         */
        function userCanPreview( $action ) {
                global $wgTitle, $wgRequest, $wgUser;
-               
+
                if( $action != 'submit' )
                        return false;
                if( !$wgRequest->wasPosted() )
                        return false;
-               if( !$wgTitle->userCanEditCssJsSubpage() ) 
+               if( !$wgTitle->userCanEditCssJsSubpage() )
                        return false;
                return $wgUser->matchEditToken(
                        $wgRequest->getVal( 'wpEditToken' ) );
        }
-       
+
        # get the user/site-specific stylesheet, SkinPHPTal called from RawPage.php (settings are cached that way)
        function getUserStylesheet() {
                global $wgOut, $wgStylePath, $wgContLang, $wgUser, $wgRequest, $wgTitle, $wgAllowUserCss;
@@ -258,7 +260,7 @@ class Skin extends Linker {
 
                return $s . $this->reallyDoGetUserStyles();
        }
-       
+
        function reallyDoGetUserStyles() {
                global $wgUser;
                $s = '';
@@ -286,7 +288,7 @@ a.stub:after, #quickbar a.stub:after {
 END;
                }
                if( $wgUser->getOption( 'justify' ) ) {
-                       $s .= "#article { text-align: justify; }\n";
+                       $s .= "#article, #bodyContent { text-align: justify; }\n";
                }
                if( !$wgUser->getOption( 'showtoc' ) ) {
                        $s .= "#toc { display: none; }\n";
@@ -406,7 +408,7 @@ END;
                return $s;
        }
 
-       
+
        function getCategoryLinks () {
                global $wgOut, $wgTitle, $wgParser;
                global $wgUseCategoryMagic, $wgUseCategoryBrowser, $wgLang;
@@ -430,34 +432,33 @@ END;
                        # get a big array of the parents tree
                        $parenttree = $wgTitle->getParentCategoryTree();
 
-                       # Render the array as a serie of links
-                       # Need to give skin cause $this is undefined at this level
-                       function walkThrough ($tree, &$skin) {
-                               $return = '';
-                               foreach($tree as $element => $parent) {
-                                       if(empty($parent)) {
-                                               # element start a new list
-                                               $return .= '<br />';
-                                       } else {
-                                               # grab the others elements
-                                               $return .= walkThrough($parent, $skin);
-                                       }
-                                       # add our current element to the list
-                                       $eltitle = Title::NewFromText($element);
-                                       if(!empty($parent)) $return .= ' &gt; ';
-                                       $return .=  $skin->makeLinkObj( $eltitle, $eltitle->getText() ) ;
-                               }
-                               return $return;
-                       }
-
                        # Skin object passed by reference cause it can not be
                        # accessed under the method subfunction walkThrough.
-                       $s .= walkThrough($parenttree, $this);
+                       $s .= Skin::drawCategoryBrowser($parenttree, $this);
                }
 
                return $s;
        }
 
+       # Render the array as a serie of links
+       function drawCategoryBrowser ($tree, &$skin) {
+               $return = '';
+               foreach ($tree as $element => $parent) {
+                       if (empty($parent)) {
+                               # element start a new list
+                               $return .= '<br />';
+                       } else {
+                               # grab the others elements
+                               $return .= Skin::drawCategoryBrowser($parent, $skin);
+                       }
+                       # add our current element to the list
+                       $eltitle = Title::NewFromText($element);
+                       if (!empty($parent)) $return .= ' &gt; ';
+                       $return .=  $skin->makeLinkObj( $eltitle, $eltitle->getText() ) ;
+               }
+               return $return;
+       }
+
        function getCategories() {
                $catlinks=$this->getCategoryLinks();
                if(!empty($catlinks)) {
@@ -535,7 +536,7 @@ END;
                # do not show "You have new messages" text when we are viewing our
                # own talk page
 
-                       if( $wgTitle->equals( $wgUser->getTalkPage() ) ) {
+                       if( !$wgTitle->equals( $wgUser->getTalkPage() ) ) {
                                $tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(),
                                                wfMsg('newmessageslink') );
                                $s.= ' | <strong>'. wfMsg( 'newmessages', $tl ) . '</strong>';
@@ -927,7 +928,7 @@ END;
                                }
                        }
                }
-               
+
                $go = wfMsg( 'go' );
                $sp = wfMsg( 'specialpages' );
                $spp = $wgContLang->specialPage( 'Specialpages' );
@@ -937,7 +938,7 @@ END;
                $s .= "<select name=\"wpDropdown\">\n";
                $s .= "<option value=\"{$spp}\">{$sp}</option>\n";
 
-               
+
                foreach ( $a as $name => $desc ) {
                        $p = $wgContLang->specialPage( $name );
                        $s .= "<option value=\"{$p}\">{$desc}</option>\n";
@@ -1098,7 +1099,7 @@ END;
 #                     0 != $id->getEmailauthenticationtimestamp() && # .. which is authenticated
 #                     1 != $wgUser->getOption('disablemail'); # and not disabled
        }
-       
+
        function emailUserLink() {
                global $wgTitle;
 
@@ -1236,13 +1237,13 @@ END;
                $title = Title::makeTitle( NS_SPECIAL, $name );
                return $title->getLocalURL( $urlaction );
        }
-       
+
        /*static*/ function makeI18nUrl ( $name, $urlaction='' ) {
                $title = Title::newFromText( wfMsgForContent($name) );
                $this->checkTitle($title, $name);
                return $title->getLocalURL( $urlaction );
        }
-       
+
        /*static*/ function makeUrl ( $name, $urlaction='' ) {
                $title = Title::newFromText( $name );
                $this->checkTitle($title, $name);
@@ -1291,11 +1292,11 @@ END;
         *
         * @return array
         * @access private
-        */ 
+        */
        function buildSidebar() {
                $fname = 'SkinTemplate::buildSidebar';
                wfProfileIn( $fname );
-               
+
                $bar = array();
                $lines = explode( "\n", wfMsgForContent( 'sidebar' ) );
                foreach ($lines as $line) {
@@ -1318,7 +1319,7 @@ END;
                                } else { continue; }
                        }
                }
-               
+
                wfProfileOut( $fname );
                return $bar;
        }