Index: branches/RL2/extensions/Gadgets/GadgetHooks.php |
— | — | @@ -318,12 +318,26 @@ |
319 | 319 | * @param $out OutputPage |
320 | 320 | */ |
321 | 321 | public static function makeGlobalVariablesScript( &$vars, $out ) { |
322 | | - if ( $out->getTitle()->equals( SpecialPage::getTitleFor( 'GadgetManager' ) ) ) { |
| 322 | + $title = $out->getTitle(); |
| 323 | + // FIXME: This is not a nice way to do it. Maybe we should check for the presence |
| 324 | + // of a module instead or something. |
| 325 | + if ( $title->equals( SpecialPage::getTitleFor( 'GadgetManager' ) ) || |
| 326 | + $title->equals( SpecialPage::getTitleFor( 'Preferences' ) ) ) |
| 327 | + { |
323 | 328 | global $wgGadgetEnableSharing; |
| 329 | + |
| 330 | + // Pass the source data for each source that is used by a repository |
| 331 | + $repos = GadgetRepo::getAllRepos(); |
| 332 | + $sources = $out->getResourceLoader()->getSources(); |
| 333 | + $repoData = array(); |
| 334 | + foreach ( $repos as $repo ) { |
| 335 | + $repoData[$repo->getSource()] = $sources[$repo->getSource()]; |
| 336 | + } |
324 | 337 | |
325 | | - $vars['gadgetManagerConf'] = array( |
| 338 | + $vars['gadgetsConf'] = array( |
326 | 339 | 'enableSharing' => $wgGadgetEnableSharing, |
327 | 340 | 'allRights' => User::getAllRights(), |
| 341 | + 'repos' => $repoData |
328 | 342 | ); |
329 | 343 | } |
330 | 344 | return true; |