Index: trunk/extensions/Translate/TranslatePage.php |
— | — | @@ -238,7 +238,7 @@ |
239 | 239 | /* Selectors ahead */ |
240 | 240 | |
241 | 241 | protected function groupSelector() { |
242 | | - $groups = MessageGroups::singleton()->getGroups(); |
| 242 | + $groups = MessageGroups::getAllGroups(); |
243 | 243 | $selector = new HTMLSelector( 'group', 'group', $this->options['group'] ); |
244 | 244 | |
245 | 245 | foreach ( $groups as $id => $class ) { |
— | — | @@ -403,7 +403,7 @@ |
404 | 404 | public function getGroupStructure() { |
405 | 405 | global $wgTranslateGroupStructure; |
406 | 406 | |
407 | | - $groups = MessageGroups::singleton()->getGroups(); |
| 407 | + $groups = MessageGroups::getAllGroups(); |
408 | 408 | $structure = array(); |
409 | 409 | |
410 | 410 | foreach ( $groups as $id => $o ) { |
Index: trunk/extensions/Translate/MessageGroups.php |
— | — | @@ -984,6 +984,14 @@ |
985 | 985 | } |
986 | 986 | } |
987 | 987 | |
| 988 | + /** |
| 989 | + * Get all enabled message groups. |
| 990 | + * @return \arrayof{String,MessageGroup} |
| 991 | + */ |
| 992 | + public static function getAllGroups() { |
| 993 | + return self::singleton()->getGroups(); |
| 994 | + } |
| 995 | + |
988 | 996 | /// @todo Make protected. |
989 | 997 | public $classes; |
990 | 998 | private function __construct() { |
Index: trunk/extensions/Translate/api/ApiQueryMessageCollection.php |
— | — | @@ -113,7 +113,7 @@ |
114 | 114 | public function getAllowedParams() { |
115 | 115 | return array( |
116 | 116 | 'group' => array( |
117 | | - ApiBase::PARAM_TYPE => array_keys( MessageGroups::singleton()->getGroups() ), |
| 117 | + ApiBase::PARAM_TYPE => array_keys( MessageGroups::>getAllGroups() ), |
118 | 118 | ApiBase::PARAM_REQUIRED => true, |
119 | 119 | ), |
120 | 120 | 'language' => array( |
— | — | @@ -173,7 +173,7 @@ |
174 | 174 | } |
175 | 175 | |
176 | 176 | protected function getExamples() { |
177 | | - $groups = MessageGroups::singleton()->getGroups(); |
| 177 | + $groups = MessageGroups::getAllGroups(); |
178 | 178 | $group = key( $groups ); |
179 | 179 | |
180 | 180 | return array( |
Index: trunk/extensions/Translate/api/ApiQueryMessageGroups.php |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | |
27 | 27 | public function execute() { |
28 | 28 | $params = $this->extractRequestParams(); |
29 | | - $groups = MessageGroups::singleton()->getGroups(); |
| 29 | + $groups = MessageGroups::getAllGroups(); |
30 | 30 | $result = $this->getResult(); |
31 | 31 | |
32 | 32 | foreach ( $groups as $id => $g ) { |