Index: branches/REL1_17/extensions/Vector/Vector.hooks.php |
— | — | @@ -130,13 +130,34 @@ |
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
134 | | - * MakeGlobalVariablesScript hook |
| 134 | + * ResourceLoaderGetConfigVars hook |
135 | 135 | * |
136 | 136 | * Adds enabled/disabled switches for Vector modules |
137 | 137 | */ |
138 | 138 | public static function resourceLoaderGetConfigVars( &$vars ) { |
139 | 139 | global $wgVectorFeatures; |
140 | 140 | |
| 141 | + $configurations = array(); |
| 142 | + foreach ( self::$features as $name => $feature ) { |
| 143 | + if ( |
| 144 | + isset( $feature['configurations'] ) && |
| 145 | + ( !isset( $wgVectorFeatures[$name] ) || self::isEnabled( $name ) ) |
| 146 | + ) { |
| 147 | + foreach ( $feature['configurations'] as $configuration ) { |
| 148 | + global $$configuration; |
| 149 | + $configurations[$configuration] = $$configuration; |
| 150 | + } |
| 151 | + } |
| 152 | + } |
| 153 | + if ( count( $configurations ) ) { |
| 154 | + $vars = array_merge( $vars, $configurations ); |
| 155 | + } |
| 156 | + return true; |
| 157 | + } |
| 158 | + |
| 159 | + public static function makeGlobalVariablesScript( &$vars ) { |
| 160 | + global $wgVectorFeatures; |
| 161 | + |
141 | 162 | // Build and export old-style wgVectorEnabledModules object for back compat |
142 | 163 | $enabledModules = array(); |
143 | 164 | foreach ( self::$features as $name => $feature ) { |