Merge "Limit the Title backlink cache to two instances."
[lhc/web/wiklou.git] / includes / SkinTemplate.php
index 2c869db..bda4395 100644 (file)
@@ -135,7 +135,6 @@ class SkinTemplate extends Skin {
                global $wgDisableCounters, $wgSitename, $wgLogo, $wgHideInterlanguageLinks;
                global $wgMaxCredits, $wgShowCreditsIfMax;
                global $wgPageShowWatchingUsers;
-               global $wgDebugComments;
                global $wgArticlePath, $wgScriptPath, $wgServer;
 
                wfProfileIn( __METHOD__ );
@@ -387,12 +386,6 @@ class SkinTemplate extends Skin {
                        }
                }
 
-               if ( $wgDebugComments ) {
-                       $tpl->setRef( 'debug', $out->mDebugtext );
-               } else {
-                       $tpl->set( 'debug', '' );
-               }
-
                $tpl->set( 'sitenotice', $this->getSiteNotice() );
                $tpl->set( 'bottomscripts', $this->bottomScripts() );
                $tpl->set( 'printfooter', $this->printSource() );
@@ -407,7 +400,7 @@ class SkinTemplate extends Skin {
                if ( !in_array( $title->getNamespace(), array( NS_SPECIAL, NS_FILE ) ) &&
                        in_array( $request->getVal( 'action', 'view' ), array( 'view', 'historysubmit' ) ) &&
                        ( $title->exists() || $title->getNamespace() == NS_MEDIAWIKI ) ) {
-                       $pageLang = $title->getPageLanguage();
+                       $pageLang = $title->getPageViewLanguage();
                        $realBodyAttribs['lang'] = $pageLang->getHtmlCode();
                        $realBodyAttribs['dir'] = $pageLang->getDir();
                        $realBodyAttribs['class'] = 'mw-content-'.$pageLang->getDir();
@@ -468,6 +461,7 @@ class SkinTemplate extends Skin {
                        $tpl->set( 'headscripts', $out->getHeadScripts() . $out->getHeadItems() );
                }
 
+               $tpl->set( 'debug', '' );
                $tpl->set( 'debughtml', $this->generateDebugHTML() );
                $tpl->set( 'reporttime', wfReportTime() );
 
@@ -1159,7 +1153,7 @@ class SkinTemplate extends Skin {
                        if ( $revid ) {
                                $nav_urls['permalink'] = array(
                                        'text' => $this->msg( 'permalink' )->text(),
-                                       'href' => $out->getTitle()->getLocalURL( "oldid=$revid" )
+                                       'href' => $this->getTitle()->getLocalURL( "oldid=$revid" )
                                );
                        }
 
@@ -1187,9 +1181,8 @@ class SkinTemplate extends Skin {
                                'href' => self::makeSpecialUrlSubpage( 'Contributions', $rootUser )
                        );
 
-                       $logPage = SpecialPage::getTitleFor( 'Log' );
                        $nav_urls['log'] = array(
-                               'href' => $logPage->getLocalUrl( array( 'user' => $rootUser ) )
+                               'href' => self::makeSpecialUrlSubpage( 'Log', $rootUser )
                        );
 
                        if ( $this->getUser()->isAllowed( 'block' ) ) {
@@ -1886,13 +1879,7 @@ abstract class BaseTemplate extends QuickTemplate {
        function printTrail() { ?>
 <?php $this->html( 'bottomscripts' ); /* JS call to runBodyOnloadHook */ ?>
 <?php $this->html( 'reporttime' ) ?>
-<?php if ( $this->data['debug'] ): ?>
-<!-- Debug output:
-<?php $this->text( 'debug' ); ?>
-
--->
-<?php endif;
+<?php echo MWDebug::getDebugHTML( $this->getSkin()->getContext() );
        }
 
 }
-