From e17e30eaee67137cfb90d62b9a4d7a5d582e60ec Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 28 May 2005 06:56:30 +0000 Subject: [PATCH] introduced $wgHideInterlanguageLinks, needed for dumpHTML --- includes/DefaultSettings.php | 4 ++++ includes/Skin.php | 6 +++++- includes/SkinTemplate.php | 18 +++++++++++------- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 3d94ca5b0f..e2d361deb0 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -465,6 +465,10 @@ $wgLanguageCode = 'en'; /** Treat language links as magic connectors, not inline links */ $wgInterwikiMagic = true; +/** Hide interlanguage links from the sidebar */ +$wgHideInterlanguageLinks = false; + + /** We speak UTF-8 all the time now, unless some oddities happen */ $wgInputEncoding = 'UTF-8'; $wgOutputEncoding = 'UTF-8'; diff --git a/includes/Skin.php b/includes/Skin.php index d717a681c4..bdd40ca2c9 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1119,7 +1119,11 @@ END; } function otherLanguages() { - global $wgOut, $wgContLang, $wgTitle; + global $wgOut, $wgContLang, $wgTitle, $wgHideInterlanguageLinks; + + if ( $wgHideInterlanguageLinks ) { + return ''; + } $a = $wgOut->getLanguageLinks(); if ( 0 == count( $a ) ) { diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index eae160d016..d5f4c2bd8d 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -146,7 +146,7 @@ class SkinTemplate extends Skin { global $wgTitle, $wgArticle, $wgUser, $wgLang, $wgContLang, $wgOut; global $wgScript, $wgStylePath, $wgLanguageCode, $wgContLanguageCode, $wgUseNewInterlanguage; global $wgMimeType, $wgJsMimeType, $wgOutputEncoding, $wgUseDatabaseMessages, $wgRequest; - global $wgDisableCounters, $wgLogo, $action, $wgFeedClasses; + global $wgDisableCounters, $wgLogo, $action, $wgFeedClasses, $wgHideInterlanguageLinks; global $wgMaxCredits, $wgShowCreditsIfMax; global $wgPageShowWatchingUsers; @@ -310,7 +310,6 @@ class SkinTemplate extends Skin { $tpl->set('numberofwatchingusers', false); } - $tpl->set('lastmod', $this->lastModified()); $tpl->set('copyright',$this->getCopyright()); $this->credits = false; @@ -318,6 +317,8 @@ class SkinTemplate extends Skin { if (isset($wgMaxCredits) && $wgMaxCredits != 0) { require_once("Credits.php"); $this->credits = getCredits($wgArticle, $wgMaxCredits, $wgShowCreditsIfMax); + } else { + $tpl->set('lastmod', $this->lastModified()); } $tpl->setRef( 'credits', $this->credits ); @@ -353,11 +354,14 @@ class SkinTemplate extends Skin { # Language links $language_urls = array(); - foreach( $wgOut->getLanguageLinks() as $l ) { - $nt = Title::newFromText( $l ); - $language_urls[] = array('href' => $nt->getFullURL(), - 'text' => ($wgContLang->getLanguageName( $nt->getInterwiki()) != ''?$wgContLang->getLanguageName( $nt->getInterwiki()) : $l), - 'class' => $wgContLang->isRTL() ? 'rtl' : 'ltr'); + + if ( !$wgHideInterlanguageLinks ) { + foreach( $wgOut->getLanguageLinks() as $l ) { + $nt = Title::newFromText( $l ); + $language_urls[] = array('href' => $nt->getFullURL(), + 'text' => ($wgContLang->getLanguageName( $nt->getInterwiki()) != ''?$wgContLang->getLanguageName( $nt->getInterwiki()) : $l), + 'class' => $wgContLang->isRTL() ? 'rtl' : 'ltr'); + } } if(count($language_urls)) { $tpl->setRef( 'language_urls', $language_urls); -- 2.20.1