MediaWiki r9206 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r9205‎ | r9206 (on ViewVC)‎ | r9207 >
Date:06:56, 28 May 2005
Author:timstarling
Status:old
Tags:
Comment:
introduced $wgHideInterlanguageLinks, needed for dumpHTML
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/SkinTemplate.php
@@ -146,7 +146,7 @@
147147 global $wgTitle, $wgArticle, $wgUser, $wgLang, $wgContLang, $wgOut;
148148 global $wgScript, $wgStylePath, $wgLanguageCode, $wgContLanguageCode, $wgUseNewInterlanguage;
149149 global $wgMimeType, $wgJsMimeType, $wgOutputEncoding, $wgUseDatabaseMessages, $wgRequest;
150 - global $wgDisableCounters, $wgLogo, $action, $wgFeedClasses;
 150+ global $wgDisableCounters, $wgLogo, $action, $wgFeedClasses, $wgHideInterlanguageLinks;
151151 global $wgMaxCredits, $wgShowCreditsIfMax;
152152 global $wgPageShowWatchingUsers;
153153
@@ -310,7 +310,6 @@
311311 $tpl->set('numberofwatchingusers', false);
312312 }
313313
314 - $tpl->set('lastmod', $this->lastModified());
315314 $tpl->set('copyright',$this->getCopyright());
316315
317316 $this->credits = false;
@@ -318,6 +317,8 @@
319318 if (isset($wgMaxCredits) && $wgMaxCredits != 0) {
320319 require_once("Credits.php");
321320 $this->credits = getCredits($wgArticle, $wgMaxCredits, $wgShowCreditsIfMax);
 321+ } else {
 322+ $tpl->set('lastmod', $this->lastModified());
322323 }
323324
324325 $tpl->setRef( 'credits', $this->credits );
@@ -353,11 +354,14 @@
354355
355356 # Language links
356357 $language_urls = array();
357 - foreach( $wgOut->getLanguageLinks() as $l ) {
358 - $nt = Title::newFromText( $l );
359 - $language_urls[] = array('href' => $nt->getFullURL(),
360 - 'text' => ($wgContLang->getLanguageName( $nt->getInterwiki()) != ''?$wgContLang->getLanguageName( $nt->getInterwiki()) : $l),
361 - 'class' => $wgContLang->isRTL() ? 'rtl' : 'ltr');
 358+
 359+ if ( !$wgHideInterlanguageLinks ) {
 360+ foreach( $wgOut->getLanguageLinks() as $l ) {
 361+ $nt = Title::newFromText( $l );
 362+ $language_urls[] = array('href' => $nt->getFullURL(),
 363+ 'text' => ($wgContLang->getLanguageName( $nt->getInterwiki()) != ''?$wgContLang->getLanguageName( $nt->getInterwiki()) : $l),
 364+ 'class' => $wgContLang->isRTL() ? 'rtl' : 'ltr');
 365+ }
362366 }
363367 if(count($language_urls)) {
364368 $tpl->setRef( 'language_urls', $language_urls);
Index: trunk/phase3/includes/DefaultSettings.php
@@ -465,6 +465,10 @@
466466 /** Treat language links as magic connectors, not inline links */
467467 $wgInterwikiMagic = true;
468468
 469+/** Hide interlanguage links from the sidebar */
 470+$wgHideInterlanguageLinks = false;
 471+
 472+
469473 /** We speak UTF-8 all the time now, unless some oddities happen */
470474 $wgInputEncoding = 'UTF-8';
471475 $wgOutputEncoding = 'UTF-8';
Index: trunk/phase3/includes/Skin.php
@@ -1119,8 +1119,12 @@
11201120 }
11211121
11221122 function otherLanguages() {
1123 - global $wgOut, $wgContLang, $wgTitle;
 1123+ global $wgOut, $wgContLang, $wgTitle, $wgHideInterlanguageLinks;
11241124
 1125+ if ( $wgHideInterlanguageLinks ) {
 1126+ return '';
 1127+ }
 1128+
11251129 $a = $wgOut->getLanguageLinks();
11261130 if ( 0 == count( $a ) ) {
11271131 return '';

Status & tagging log

  • 01:56, 13 October 2010 ^demon (Talk | contribs) changed the status of r9206 [removed: new added: old]
Personal tools
Namespaces

Variants
Views
Actions
Navigation
Support
Download
Development
Communication
Toolbox