http://www.mediawiki.org/wiki/Special:Code/MediaWiki/72501
Revision: 72501
Author: siebrand
Date: 2010-09-06 17:26:27 +0000 (Mon, 06 Sep 2010)
Log Message:
-----------
Remove old style meta message groups for MediaWiki extensions and Wikia
MediaWiki extensions in favour of YAML style aggregate group definitions.
Modified Paths:
--------------
trunk/extensions/Translate/groups/MediaWiki/ExtensionsAgg.yaml
trunk/extensions/Translate/groups/MediaWikiExtensions.php
trunk/extensions/Translate/groups/Wikia/WikiaExtensions.php
Modified: trunk/extensions/Translate/groups/MediaWiki/ExtensionsAgg.yaml
===================================================================
--- trunk/extensions/Translate/groups/MediaWiki/ExtensionsAgg.yaml
2010-09-06 17:20:24 UTC (rev 72500)
+++ trunk/extensions/Translate/groups/MediaWiki/ExtensionsAgg.yaml
2010-09-06 17:26:27 UTC (rev 72501)
@@ -1,5 +1,5 @@
BASIC:
- id: ext-0-all1
+ id: ext-0-all
label: MediaWiki extensions
display: ext
meta: yes
Modified: trunk/extensions/Translate/groups/MediaWikiExtensions.php
===================================================================
--- trunk/extensions/Translate/groups/MediaWikiExtensions.php 2010-09-06
17:20:24 UTC (rev 72500)
+++ trunk/extensions/Translate/groups/MediaWikiExtensions.php 2010-09-06
17:26:27 UTC (rev 72501)
@@ -184,23 +184,8 @@
$wgTranslateAC[$id] = array( $this, 'factory' );
$wgTranslateEC[] = $id;
}
-
- $this->addAllMeta();
}
- protected function addAllMeta() {
- global $wgTranslateAC, $wgTranslateEC;
-
- $meta = array(
- 'ext-0-all' =>
'AllMediawikiExtensionsGroup',
- );
-
- foreach ( $meta as $id => $g ) {
- $wgTranslateAC[$id] = $g;
- $wgTranslateEC[] = $id;
- }
- }
-
public function factory( $id ) {
$info = $this->groups[$id];
$group = ExtensionMessageGroup::factory( $info['name'], $id );
@@ -230,81 +215,3 @@
return $group;
}
}
-
-/**
- * Adds a message group containing all supported %MediaWiki extensions in the
- * Wikimedia Subversion repository.
- * @deprecated Replaced by AggregateMessageGroup and yaml configuration.
- */
-class AllMediawikiExtensionsGroup extends MessageGroupOld {
- protected $label = 'MediaWiki extensions';
- protected $id = 'ext-0-all';
- protected $meta = true;
- protected $type = 'mediawiki';
- protected $classes = null;
- protected $description =
'{{int:translate-group-desc-mediawikiextensions}}';
-
- // Don't add the (mw ext) thingie
- public function getLabel() { return $this->label; }
-
- protected function init() {
- if ( $this->classes === null ) {
- $this->classes =
MessageGroups::singleton()->getGroups();
- foreach ( $this->classes as $index => $class ) {
- if ( ( strpos( $class->getId(), 'ext-' ) !== 0
) || $class->isMeta() || !$class->exists() ) {
- unset( $this->classes[$index] );
- }
- }
- }
- }
-
- public function load( $code ) {
- $this->init();
- $array = array();
- foreach ( $this->classes as $class ) {
- // Use wfArrayMerge because of string keys
- $array = wfArrayMerge( $array, $class->load( $code ) );
- }
- return $array;
- }
-
- public function getMessage( $key, $code ) {
- $this->init();
- $msg = null;
- foreach ( $this->classes as $class ) {
- $msg = $class->getMessage( $key, $code );
- if ( $msg !== null ) return $msg;
- }
- return null;
- }
-
- function getDefinitions() {
- $this->init();
- $array = array();
- foreach ( $this->classes as $class ) {
- // Use wfArrayMerge because of string keys
- $array = wfArrayMerge( $array, $class->getDefinitions()
);
- }
- return $array;
- }
-
- function getBools() {
- $this->init();
- $bools = parent::getBools();
- foreach ( $this->classes as $class ) {
- $newbools = ( $class->getBools() );
- if ( count( $newbools['optional'] ) || count(
$newbools['ignored'] ) ) {
- $bools = array_merge_recursive( $bools,
$class->getBools() );
- }
- }
- return $bools;
- }
-
- public function exists() {
- $this->init();
- foreach ( $this->classes as $class ) {
- if ( $class->exists() ) return true;
- }
- return false;
- }
-}
Modified: trunk/extensions/Translate/groups/Wikia/WikiaExtensions.php
===================================================================
--- trunk/extensions/Translate/groups/Wikia/WikiaExtensions.php 2010-09-06
17:20:24 UTC (rev 72500)
+++ trunk/extensions/Translate/groups/Wikia/WikiaExtensions.php 2010-09-06
17:26:27 UTC (rev 72501)
@@ -24,84 +24,4 @@
$this->definitionFile = $dir . '/extensions.txt';
$this->path = "$wgTranslateGroupRoot/wikia/";
}
-
- protected function addAllMeta() {
- global $wgTranslateAC, $wgTranslateEC;
-
- $meta = array(
- 'wikia-0-all' => 'AllWikiaExtensionsGroup',
- );
-
- foreach ( $meta as $id => $g ) {
- $wgTranslateAC[$id] = $g;
- $wgTranslateEC[] = $id;
- }
- }
}
-
-/**
- * Adds a message group containing all supported Wikia extensions in the
- * Wikia Subversion repository and the Wikimedia Subversion.
- *
- * @todo Migrate to yaml configuration
- */
-class AllWikiaExtensionsGroup extends AllMediawikiExtensionsGroup {
- protected $description = '{{int:translate-group-desc-wikiaextensions}}';
- protected $label = 'Extensions used by Wikia'; // currently using 1.14.0
- protected $id = 'wikia-0-all';
- protected $meta = true;
- protected $type = 'wikia';
- protected $classes = null;
-
- protected $wikiaextensions = array(
- 'ext-antibot',
- 'ext-categorytree',
- 'ext-charinsert',
- 'ext-checkuser',
- 'ext-cite',
- 'ext-confirmedit',
- 'ext-dismissablesitenotice',
- 'ext-dplforum',
- 'ext-editcount',
- 'ext-findspam',
- 'ext-googlemaps',
- 'ext-imagemap',
- 'ext-importfreeimages',
- 'ext-inputbox',
- 'ext-lookupuser',
- 'ext-multiupload',
- 'ext-parserfunctions',
- 'ext-poem',
- 'ext-randomimage',
- 'ext-spamblacklist',
- 'ext-stringfunctions',
- 'ext-timeline',
- 'ext-torblock',
- 'ext-wikihiero',
- );
-
- protected function init() {
- if ( $this->classes === null ) {
- $this->classes = array();
-
- $classes = MessageGroups::singleton()->getGroups();
-
- // Add regular MediaWiki extensions
- foreach ( $this->wikiaextensions as $key ) {
- $this->classes[$key] = $classes[$key];
- }
-
- // Add extensions that have a wikia- prefix
- foreach ( $classes as $index => $class ) {
- if ( ( strpos( $index, 'wikia-' ) === 0 ) &&
!$class->isMeta() && $class->exists() ) {
- $this->classes[$index] =
$classes[$index];
- $this->wikiaextensions[] = $index;
- }
- }
- }
- }
-
- public function wikiaextensions() {
- return $this->wikiaextensions;
- }
-}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs