Index: trunk/extensions/Translate/groups/MediaWiki/ExtensionsAgg.yaml |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | BASIC: |
3 | | - id: ext-0-all1 |
| 3 | + id: ext-0-all |
4 | 4 | label: MediaWiki extensions |
5 | 5 | display: ext |
6 | 6 | meta: yes |
Index: trunk/extensions/Translate/groups/Wikia/WikiaExtensions.php |
— | — | @@ -24,84 +24,4 @@ |
25 | 25 | $this->definitionFile = $dir . '/extensions.txt'; |
26 | 26 | $this->path = "$wgTranslateGroupRoot/wikia/"; |
27 | 27 | } |
28 | | - |
29 | | - protected function addAllMeta() { |
30 | | - global $wgTranslateAC, $wgTranslateEC; |
31 | | - |
32 | | - $meta = array( |
33 | | - 'wikia-0-all' => 'AllWikiaExtensionsGroup', |
34 | | - ); |
35 | | - |
36 | | - foreach ( $meta as $id => $g ) { |
37 | | - $wgTranslateAC[$id] = $g; |
38 | | - $wgTranslateEC[] = $id; |
39 | | - } |
40 | | - } |
41 | 28 | } |
42 | | - |
43 | | -/** |
44 | | - * Adds a message group containing all supported Wikia extensions in the |
45 | | - * Wikia Subversion repository and the Wikimedia Subversion. |
46 | | - * |
47 | | - * @todo Migrate to yaml configuration |
48 | | - */ |
49 | | -class AllWikiaExtensionsGroup extends AllMediawikiExtensionsGroup { |
50 | | - protected $description = '{{int:translate-group-desc-wikiaextensions}}'; |
51 | | - protected $label = 'Extensions used by Wikia'; // currently using 1.14.0 |
52 | | - protected $id = 'wikia-0-all'; |
53 | | - protected $meta = true; |
54 | | - protected $type = 'wikia'; |
55 | | - protected $classes = null; |
56 | | - |
57 | | - protected $wikiaextensions = array( |
58 | | - 'ext-antibot', |
59 | | - 'ext-categorytree', |
60 | | - 'ext-charinsert', |
61 | | - 'ext-checkuser', |
62 | | - 'ext-cite', |
63 | | - 'ext-confirmedit', |
64 | | - 'ext-dismissablesitenotice', |
65 | | - 'ext-dplforum', |
66 | | - 'ext-editcount', |
67 | | - 'ext-findspam', |
68 | | - 'ext-googlemaps', |
69 | | - 'ext-imagemap', |
70 | | - 'ext-importfreeimages', |
71 | | - 'ext-inputbox', |
72 | | - 'ext-lookupuser', |
73 | | - 'ext-multiupload', |
74 | | - 'ext-parserfunctions', |
75 | | - 'ext-poem', |
76 | | - 'ext-randomimage', |
77 | | - 'ext-spamblacklist', |
78 | | - 'ext-stringfunctions', |
79 | | - 'ext-timeline', |
80 | | - 'ext-torblock', |
81 | | - 'ext-wikihiero', |
82 | | - ); |
83 | | - |
84 | | - protected function init() { |
85 | | - if ( $this->classes === null ) { |
86 | | - $this->classes = array(); |
87 | | - |
88 | | - $classes = MessageGroups::singleton()->getGroups(); |
89 | | - |
90 | | - // Add regular MediaWiki extensions |
91 | | - foreach ( $this->wikiaextensions as $key ) { |
92 | | - $this->classes[$key] = $classes[$key]; |
93 | | - } |
94 | | - |
95 | | - // Add extensions that have a wikia- prefix |
96 | | - foreach ( $classes as $index => $class ) { |
97 | | - if ( ( strpos( $index, 'wikia-' ) === 0 ) && !$class->isMeta() && $class->exists() ) { |
98 | | - $this->classes[$index] = $classes[$index]; |
99 | | - $this->wikiaextensions[] = $index; |
100 | | - } |
101 | | - } |
102 | | - } |
103 | | - } |
104 | | - |
105 | | - public function wikiaextensions() { |
106 | | - return $this->wikiaextensions; |
107 | | - } |
108 | | -} |
Index: trunk/extensions/Translate/groups/MediaWikiExtensions.php |
— | — | @@ -184,23 +184,8 @@ |
185 | 185 | $wgTranslateAC[$id] = array( $this, 'factory' ); |
186 | 186 | $wgTranslateEC[] = $id; |
187 | 187 | } |
188 | | - |
189 | | - $this->addAllMeta(); |
190 | 188 | } |
191 | 189 | |
192 | | - protected function addAllMeta() { |
193 | | - global $wgTranslateAC, $wgTranslateEC; |
194 | | - |
195 | | - $meta = array( |
196 | | - 'ext-0-all' => 'AllMediawikiExtensionsGroup', |
197 | | - ); |
198 | | - |
199 | | - foreach ( $meta as $id => $g ) { |
200 | | - $wgTranslateAC[$id] = $g; |
201 | | - $wgTranslateEC[] = $id; |
202 | | - } |
203 | | - } |
204 | | - |
205 | 190 | public function factory( $id ) { |
206 | 191 | $info = $this->groups[$id]; |
207 | 192 | $group = ExtensionMessageGroup::factory( $info['name'], $id ); |
— | — | @@ -230,81 +215,3 @@ |
231 | 216 | return $group; |
232 | 217 | } |
233 | 218 | } |
234 | | - |
235 | | -/** |
236 | | - * Adds a message group containing all supported %MediaWiki extensions in the |
237 | | - * Wikimedia Subversion repository. |
238 | | - * @deprecated Replaced by AggregateMessageGroup and yaml configuration. |
239 | | - */ |
240 | | -class AllMediawikiExtensionsGroup extends MessageGroupOld { |
241 | | - protected $label = 'MediaWiki extensions'; |
242 | | - protected $id = 'ext-0-all'; |
243 | | - protected $meta = true; |
244 | | - protected $type = 'mediawiki'; |
245 | | - protected $classes = null; |
246 | | - protected $description = '{{int:translate-group-desc-mediawikiextensions}}'; |
247 | | - |
248 | | - // Don't add the (mw ext) thingie |
249 | | - public function getLabel() { return $this->label; } |
250 | | - |
251 | | - protected function init() { |
252 | | - if ( $this->classes === null ) { |
253 | | - $this->classes = MessageGroups::singleton()->getGroups(); |
254 | | - foreach ( $this->classes as $index => $class ) { |
255 | | - if ( ( strpos( $class->getId(), 'ext-' ) !== 0 ) || $class->isMeta() || !$class->exists() ) { |
256 | | - unset( $this->classes[$index] ); |
257 | | - } |
258 | | - } |
259 | | - } |
260 | | - } |
261 | | - |
262 | | - public function load( $code ) { |
263 | | - $this->init(); |
264 | | - $array = array(); |
265 | | - foreach ( $this->classes as $class ) { |
266 | | - // Use wfArrayMerge because of string keys |
267 | | - $array = wfArrayMerge( $array, $class->load( $code ) ); |
268 | | - } |
269 | | - return $array; |
270 | | - } |
271 | | - |
272 | | - public function getMessage( $key, $code ) { |
273 | | - $this->init(); |
274 | | - $msg = null; |
275 | | - foreach ( $this->classes as $class ) { |
276 | | - $msg = $class->getMessage( $key, $code ); |
277 | | - if ( $msg !== null ) return $msg; |
278 | | - } |
279 | | - return null; |
280 | | - } |
281 | | - |
282 | | - function getDefinitions() { |
283 | | - $this->init(); |
284 | | - $array = array(); |
285 | | - foreach ( $this->classes as $class ) { |
286 | | - // Use wfArrayMerge because of string keys |
287 | | - $array = wfArrayMerge( $array, $class->getDefinitions() ); |
288 | | - } |
289 | | - return $array; |
290 | | - } |
291 | | - |
292 | | - function getBools() { |
293 | | - $this->init(); |
294 | | - $bools = parent::getBools(); |
295 | | - foreach ( $this->classes as $class ) { |
296 | | - $newbools = ( $class->getBools() ); |
297 | | - if ( count( $newbools['optional'] ) || count( $newbools['ignored'] ) ) { |
298 | | - $bools = array_merge_recursive( $bools, $class->getBools() ); |
299 | | - } |
300 | | - } |
301 | | - return $bools; |
302 | | - } |
303 | | - |
304 | | - public function exists() { |
305 | | - $this->init(); |
306 | | - foreach ( $this->classes as $class ) { |
307 | | - if ( $class->exists() ) return true; |
308 | | - } |
309 | | - return false; |
310 | | - } |
311 | | -} |