Index: trunk/extensions/Narayam/Narayam.hooks.php |
— | — | @@ -34,14 +34,25 @@ |
35 | 35 | |
36 | 36 | /// Hook: MakeGlobalVariablesScript |
37 | 37 | public static function addVariables( &$vars ) { |
38 | | - global $wgUser, $wgNarayamSchemes; |
| 38 | + global $wgUser, $wgNarayamSchemes, $wgNarayamUseBetaMapping; |
39 | 39 | |
40 | 40 | if ( $wgUser->getOption( 'narayamDisable' ) ) { |
41 | 41 | return true; |
42 | 42 | } |
43 | 43 | |
44 | 44 | $vars['wgNarayamAvailableSchemes'] = self::getSchemes(); // Note: scheme names must be keys, not values |
45 | | - $vars['wgNarayamAllSchemes'] = $wgNarayamSchemes; |
| 45 | + $allSchemes = $wgNarayamSchemes; |
| 46 | + if ( !$wgNarayamUseBetaMapping ) { |
| 47 | + foreach ( $allSchemes as $lang => $schemes ) { |
| 48 | + foreach ( $schemes as $i => $scheme ) { |
| 49 | + $version = isset( $scheme[1] ) ? $scheme[1] : "stable"; |
| 50 | + if ( $version === "beta" ) { |
| 51 | + unset( $allSchemes[$lang][$i] ); |
| 52 | + } |
| 53 | + } |
| 54 | + } |
| 55 | + } |
| 56 | + $vars['wgNarayamAllSchemes'] = $allSchemes; |
46 | 57 | return true; |
47 | 58 | } |
48 | 59 | |
— | — | @@ -50,7 +61,7 @@ |
51 | 62 | * @return array( scheme name => module name ) |
52 | 63 | */ |
53 | 64 | protected static function getSchemes() { |
54 | | - global $wgLanguageCode, $wgLang, $wgNarayamSchemes, $wgTitle; |
| 65 | + global $wgLanguageCode, $wgLang, $wgNarayamSchemes, $wgTitle, $wgNarayamUseBetaMapping; |
55 | 66 | |
56 | 67 | $userlangCode = $wgLang->getCode(); |
57 | 68 | $contlangSchemes = isset( $wgNarayamSchemes[$wgLanguageCode] ) ? |
— | — | @@ -62,7 +73,14 @@ |
63 | 74 | $wgNarayamSchemes[$pagelang] : array(); |
64 | 75 | |
65 | 76 | $schemes = $userlangSchemes + $contlangSchemes + $pagelangSchemes; |
66 | | - |
| 77 | + if ( !$wgNarayamUseBetaMapping ) { |
| 78 | + foreach ( $schemes as $i => $scheme ) { |
| 79 | + $version = isset( $scheme[1] ) ? $scheme[1] : "stable"; |
| 80 | + if ( $version === "beta" ) { |
| 81 | + unset( $schemes[$i] ); |
| 82 | + } |
| 83 | + } |
| 84 | + } |
67 | 85 | return $schemes; |
68 | 86 | } |
69 | 87 | |
Index: trunk/extensions/Narayam/Narayam.php |
— | — | @@ -44,11 +44,14 @@ |
45 | 45 | // Number of recently used input methods to be shown |
46 | 46 | $wgNarayamRecentItemsLength = 3; |
47 | 47 | |
| 48 | +// Whether the extension should load input methods in beta status |
| 49 | +$wgNarayamUseBetaMapping = false; |
| 50 | + |
48 | 51 | // Array mapping language codes and scheme names to module names |
49 | 52 | // Custom schemes can be added here |
50 | 53 | $wgNarayamSchemes = array( |
51 | 54 | 'am' => array( |
52 | | - 'am' => 'ext.narayam.rules.am', |
| 55 | + 'am' => array( 'ext.narayam.rules.am', 'beta' ), |
53 | 56 | ), |
54 | 57 | 'as' => array( |
55 | 58 | 'as' => 'ext.narayam.rules.as', |
— | — | @@ -62,10 +65,10 @@ |
63 | 66 | 'bn-nkb' => 'ext.narayam.rules.bn-nkb', |
64 | 67 | ), |
65 | 68 | 'brx' => array( |
66 | | - 'brx-inscript' => 'ext.narayam.rules.brx-inscript', |
| 69 | + 'brx-inscript' => array( 'ext.narayam.rules.brx-inscript', 'beta' ), |
67 | 70 | ), |
68 | 71 | 'hne' => array( |
69 | | - 'hne-inscript' => 'ext.narayam.rules.hne-inscript', |
| 72 | + 'hne-inscript' => array( 'ext.narayam.rules.hne-inscript', 'beta' ), |
70 | 73 | ), |
71 | 74 | 'de' => array( |
72 | 75 | 'de' => 'ext.narayam.rules.de', |
— | — | @@ -74,8 +77,8 @@ |
75 | 78 | 'eo' => 'ext.narayam.rules.eo', |
76 | 79 | ), |
77 | 80 | 'gom-deva' => array( |
78 | | - 'gom-deva' => 'ext.narayam.rules.gom-deva', |
79 | | - 'gom-deva-inscript' => 'ext.narayam.rules.gom-deva-inscript', |
| 81 | + 'gom-deva' => array( 'ext.narayam.rules.gom-deva', 'beta' ), |
| 82 | + 'gom-deva-inscript' => array( 'ext.narayam.rules.gom-deva-inscript', 'beta' ), |
80 | 83 | ), |
81 | 84 | 'hi' => array( |
82 | 85 | 'hi' => 'ext.narayam.rules.hi', |
— | — | @@ -86,38 +89,38 @@ |
87 | 90 | 'kn-inscript' => 'ext.narayam.rules.kn-inscript', |
88 | 91 | ), |
89 | 92 | 'mai' => array( |
90 | | - 'mai-inscript' => 'ext.narayam.rules.mai-inscript', |
| 93 | + 'mai-inscript' => array( 'ext.narayam.rules.mai-inscript', 'beta' ), |
91 | 94 | ), |
92 | 95 | 'ml' => array( |
93 | 96 | 'ml' => 'ext.narayam.rules.ml', |
94 | 97 | 'ml-inscript' => 'ext.narayam.rules.ml-inscript', |
95 | 98 | ), |
96 | 99 | 'mr' => array( |
97 | | - 'mr' => 'ext.narayam.rules.mr', |
98 | | - 'mr-inscript' => 'ext.narayam.rules.mr', |
| 100 | + 'mr' => array( 'ext.narayam.rules.mr', 'beta' ), |
| 101 | + 'mr-inscript' => array( 'ext.narayam.rules.mr', 'beta' ), |
99 | 102 | ), |
100 | 103 | 'ne' => array( |
101 | | - 'ne' => 'ext.narayam.rules.ne', |
102 | | - 'ne-inscript' => 'ext.narayam.rules.ne-inscript', |
| 104 | + 'ne' => array( 'ext.narayam.rules.ne', 'beta' ), |
| 105 | + 'ne-inscript' => array( 'ext.narayam.rules.ne-inscript', 'beta' ), |
103 | 106 | ), |
104 | 107 | 'or' => array( |
105 | 108 | 'or' => 'ext.narayam.rules.or', |
106 | | - 'or-lekhani' => 'ext.narayam.rules.or-lekhani', |
| 109 | + 'or-lekhani' => array( 'ext.narayam.rules.or-lekhani', 'beta' ), |
107 | 110 | 'or-inscript' => 'ext.narayam.rules.or-inscript', |
108 | 111 | ), |
109 | 112 | 'pa' => array( |
110 | | - 'pa-inscript' => 'ext.narayam.rules.pa-inscript', |
111 | | - 'pa-phonetic' => 'ext.narayam.rules.pa-phonetic', |
| 113 | + 'pa-inscript' => array( 'ext.narayam.rules.pa-inscript', 'beta' ), |
| 114 | + 'pa-phonetic' => array( 'ext.narayam.rules.pa-phonetic', 'beta' ), |
112 | 115 | ), |
113 | 116 | 'rif' => array( |
114 | | - 'ber-tfng' => 'ext.narayam.rules.ber-tfng', |
| 117 | + 'ber-tfng' => array( 'ext.narayam.rules.ber-tfng', 'beta' ), |
115 | 118 | ), |
116 | 119 | 'sa' => array( |
117 | 120 | 'sa' => 'ext.narayam.rules.sa', |
118 | 121 | 'sa-inscript' => 'ext.narayam.rules.sa-inscript', |
119 | 122 | ), |
120 | 123 | 'shi' => array( |
121 | | - 'ber-tfng' => 'ext.narayam.rules.ber-tfng', |
| 124 | + 'ber-tfng' => array( 'ext.narayam.rules.ber-tfng', 'beta' ), |
122 | 125 | ), |
123 | 126 | 'si' => array( |
124 | 127 | 'si-singlish' => 'ext.narayam.rules.si-singlish', |
— | — | @@ -126,24 +129,24 @@ |
127 | 130 | 'ta' => array( |
128 | 131 | 'ta' => 'ext.narayam.rules.ta', |
129 | 132 | 'ta-99' => 'ext.narayam.rules.ta-99', |
130 | | - 'ta-bamini' => 'ext.narayam.rules.ta-bamini', |
131 | | - 'ta-inscript' => 'ext.narayam.rules.ta-inscript', |
| 133 | + 'ta-bamini' => array( 'ext.narayam.rules.ta-bamini', 'beta' ), |
| 134 | + 'ta-inscript' => array( 'ext.narayam.rules.ta-inscript', 'beta' ), |
132 | 135 | ), |
133 | 136 | 'te' => array( |
134 | 137 | 'te-inscript' => 'ext.narayam.rules.te-inscript', |
135 | 138 | ), |
136 | 139 | 'ur' => array( |
137 | | - 'ur' => 'ext.narayam.rules.ur', |
| 140 | + 'ur' => array( 'ext.narayam.rules.ur', 'beta' ), |
138 | 141 | ), |
139 | 142 | 'gu' => array( |
140 | | - 'gu' => 'ext.narayam.rules.gu', |
141 | | - 'gu-inscript' => 'ext.narayam.rules.gu-inscript', |
| 143 | + 'gu' => array( 'ext.narayam.rules.gu', 'beta' ), |
| 144 | + 'gu-inscript' => array( 'ext.narayam.rules.gu-inscript', 'beta' ), |
142 | 145 | ), |
143 | 146 | 'ru' => array( |
144 | | - 'ru-standard' => 'ext.narayam.rules.ru-standard', |
| 147 | + 'ru-standard' => array( 'ext.narayam.rules.ru-standard', 'beta' ), |
145 | 148 | ), |
146 | 149 | 'sah' => array( |
147 | | - 'sah-standard' => 'ext.narayam.rules.sah-standard', |
| 150 | + 'sah-standard' => array( 'ext.narayam.rules.sah-standard', 'beta' ), |
148 | 151 | ), |
149 | 152 | ); |
150 | 153 | |