Index: trunk/extensions/UsabilityInitiative/Vector/Vector.php |
— | — | @@ -49,5 +49,5 @@ |
50 | 50 | $wgExtensionMessagesFiles['VectorSimpleSearch'] = dirname( __FILE__ ) . '/Modules/SimpleSearch/SimpleSearch.i18n.php'; |
51 | 51 | |
52 | 52 | // Register Hooks |
53 | | -$wgHooks['BeforePageDisplay'][] = 'VectorHooks::addModules'; |
| 53 | +$wgHooks['UsabilityInitiativeLoadModules'][] = 'VectorHooks::addModules'; |
54 | 54 | $wgHooks['GetPreferences'][] = 'VectorHooks::addPreferences'; |
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.hooks.php |
— | — | @@ -61,14 +61,15 @@ |
62 | 62 | */ |
63 | 63 | |
64 | 64 | /** |
65 | | - * BeforePageDislay hook |
| 65 | + * BeforePageDisplay hook |
66 | 66 | * Adds the modules to the edit form |
67 | 67 | */ |
68 | | - public static function addModules( &$out, &$sk ) { |
69 | | - global $wgUser, $wgJsMimeType; |
| 68 | + public static function addModules() { |
| 69 | + global $wgUser, $wgJsMimeType, $wgOut; |
70 | 70 | global $wgVectorModules, $wgUsabilityInitiativeResourceMode; |
71 | 71 | |
72 | 72 | // Modules |
| 73 | + UsabilityInitiativeHooks::initialize(); |
73 | 74 | $preferences = array(); |
74 | 75 | foreach ( $wgVectorModules as $module => $enable ) { |
75 | 76 | if ( |
— | — | @@ -78,7 +79,6 @@ |
79 | 80 | && $wgUser->getOption( self::$modules[$module]['preferences']['enable']['key'] ) |
80 | 81 | ) |
81 | 82 | ) { |
82 | | - UsabilityInitiativeHooks::initialize(); |
83 | 83 | // Messages |
84 | 84 | if ( isset( self::$modules[$module]['i18n'], self::$modules[$module]['messages'] ) ) { |
85 | 85 | wfLoadExtensionMessages( self::$modules[$module]['i18n'] ); |
— | — | @@ -111,7 +111,7 @@ |
112 | 112 | ); |
113 | 113 | } |
114 | 114 | // Preferences (maybe the UsabilityInitiative class could do most of this for us?) |
115 | | - $out->addScript( |
| 115 | + $wgOut->addScript( |
116 | 116 | Xml::tags( |
117 | 117 | 'script', |
118 | 118 | array( 'type' => $wgJsMimeType ), |
Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -105,6 +105,8 @@ |
106 | 106 | global $wgEnableJS2system, $wgEditToolbarRunTests; |
107 | 107 | global $wgStyleVersion; |
108 | 108 | |
| 109 | + wfRunHooks( 'UsabilityInitiativeLoadModules' ); |
| 110 | + |
109 | 111 | if ( !self::$doOutput ) |
110 | 112 | return true; |
111 | 113 | |