r57636 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57635‎ | r57636 | r57637 >
Date:10:04, 11 October 2009
Author:siebrand
Status:deferred
Tags:
Comment:
Allow showing all defined languages. Default behaviour unchanged.
Modified paths:
  • /trunk/extensions/LanguageSelector/LanguageSelector.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LanguageSelector/LanguageSelector.php
@@ -55,6 +55,11 @@
5656 */
5757 $wgLanguageSelectorShowCode = false;
5858
 59+/**
 60+ * Show all languages defined, not only those with a language files (Language::getLanguageNames( <true/false> ))
 61+ */
 62+$wgLanguageSelectorShowAll = false;
 63+
5964 define( 'LANGUAGE_SELECTOR_MANUAL', 0 ); #don't place anywhere
6065 define( 'LANGUAGE_SELECTOR_AT_TOP_OF_TEXT', 1 ); #put at the top of page content
6166 define( 'LANGUAGE_SELECTOR_IN_TOOLBOX', 2 ); #put into toolbox
@@ -88,7 +93,7 @@
8994
9095 function wfLanguageSelectorExtension() {
9196 wfLoadExtensionMessages( 'LanguageSelector' );
92 - global $wgLanguageSelectorLanguages, $wgLanguageSelectorDetectLanguage, $wgLanguageSelectorRequestedLanguage, $wgLanguageSelectorLocation;
 97+ global $wgLanguageSelectorLanguages, $wgLanguageSelectorDetectLanguage, $wgLanguageSelectorRequestedLanguage, $wgLanguageSelectorLocation, $wgLanguageSelectorShowAll;
9398 global $wgUser, $wgLang, $wgRequest, $wgCookiePrefix, $wgCookiePath, $wgOut, $wgJsMimeType, $wgHooks;
9499
95100 $wgHooks['ParserFirstCallInit'][] = 'wfLanguageSelectorSetHook';
@@ -98,7 +103,7 @@
99104 }
100105
101106 if ( $wgLanguageSelectorLanguages === NULL ) {
102 - $wgLanguageSelectorLanguages = array_keys( Language::getLanguageNames( true ) );
 107+ $wgLanguageSelectorLanguages = array_keys( Language::getLanguageNames( !$wgLanguageSelectorShowAll ) );
103108 sort( $wgLanguageSelectorLanguages );
104109 }
105110

Follow-up revisions

RevisionCommit summaryAuthorDate
r57637Fix for r57636siebrand10:09, 11 October 2009

Status & tagging log