r90427 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90426‎ | r90427 | r90428 >
Date:04:01, 20 June 2011
Author:yaron
Status:deferred
Tags:
Comment:
Removed sffInitUserLanguage() (no longer used); improved some comments
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_GlobalFunctions.php
@@ -10,13 +10,12 @@
1111 if ( !defined( 'MEDIAWIKI' ) ) die();
1212
1313 /**
14 - * Do the actual intialization of the extension. This is just a delayed init that makes sure
15 - * MediaWiki is set up properly before we add our stuff.
 14+ * This is a delayed init that makes sure that MediaWiki is set up
 15+ * properly before we add our stuff.
1616 */
1717 function sfgSetupExtension() {
18 - // this global variable is needed so that other extensions (such
19 - // as Semantic Google Maps) can hook into it to add their own input
20 - // types
 18+ // This global variable is needed so that other extensions can hook
 19+ // into it to add their own input types.
2120 global $sfgFormPrinter;
2221 $sfgFormPrinter = new StubObject( 'sfgFormPrinter', 'SFFormPrinter' );
2322 }
@@ -74,28 +73,3 @@
7574
7675 $sfgContLang = new $cont_lang_class();
7776 }
78 -
79 -/**
80 - * Initialize the global language object for user language. This
81 - * must happen after the content language was initialised, since
82 - * this language is used as a fallback.
83 - */
84 -function sffInitUserLanguage( $langcode ) {
85 - global $sfgIP, $sfgLang;
86 -
87 - if ( !empty( $sfgLang ) ) { return; }
88 -
89 - $sfLangClass = 'SF_Language' . str_replace( '-', '_', ucfirst( $langcode ) );
90 -
91 - if ( file_exists( $sfgIP . '/languages/' . $sfLangClass . '.php' ) ) {
92 - include_once( $sfgIP . '/languages/' . $sfLangClass . '.php' );
93 - }
94 -
95 - // fallback if language not supported
96 - if ( !class_exists( $sfLangClass ) ) {
97 - global $sfgContLang;
98 - $sfgLang = $sfgContLang;
99 - } else {
100 - $sfgLang = new $sfLangClass();
101 - }
102 -}