Index: trunk/extensions/Narayam/Narayam.php |
— | — | @@ -41,6 +41,9 @@ |
42 | 42 | 'key' => 'm' |
43 | 43 | ); |
44 | 44 | |
| 45 | +// Schemes for the languages specified in this arrays will be loaded always |
| 46 | +$wgNarayamAlwaysLoadForLanguages = array(); |
| 47 | + |
45 | 48 | // Array mapping language codes and scheme names to module names |
46 | 49 | // Custom schemes can be added here |
47 | 50 | $wgNarayamSchemes = array( |
Index: trunk/extensions/Narayam/Narayam.hooks.php |
— | — | @@ -53,10 +53,17 @@ |
54 | 54 | |
55 | 55 | /** |
56 | 56 | * Get the available schemes for the user and content language |
| 57 | + * and mandatory schemes for the languages specifed, if any. |
57 | 58 | * @return array( scheme name => module name ) |
58 | 59 | */ |
59 | 60 | protected static function getSchemes() { |
60 | 61 | global $wgLanguageCode, $wgLang, $wgNarayamSchemes; |
| 62 | + global $wgNarayamAlwaysLoadForLanguages; |
| 63 | + |
| 64 | + $mandatorySchemes = array (); |
| 65 | + foreach ($wgNarayamAlwaysLoadForLanguages as $languageCode) { |
| 66 | + $mandatorySchemes += $wgNarayamSchemes[$languageCode]; |
| 67 | + } |
61 | 68 | |
62 | 69 | $userlangCode = $wgLang->getCode(); |
63 | 70 | $contlangSchemes = isset( $wgNarayamSchemes[$wgLanguageCode] ) ? |
— | — | @@ -64,7 +71,7 @@ |
65 | 72 | $userlangSchemes = isset( $wgNarayamSchemes[$userlangCode] ) ? |
66 | 73 | $wgNarayamSchemes[$userlangCode] : array(); |
67 | 74 | |
68 | | - return $userlangSchemes + $contlangSchemes; |
| 75 | + return $mandatorySchemes + $userlangSchemes + $contlangSchemes; |
69 | 76 | } |
70 | 77 | |
71 | 78 | public static function addPreference( $user, &$preferences ) { |