Index: trunk/extensions/LanguageSelector/LanguageSelector.php |
— | — | @@ -152,7 +152,7 @@ |
153 | 153 | global $wgExtensionAssetsPath, $wgLanguageSelectorLocation, $wgLanguageSelectorFormUsed; |
154 | 154 | |
155 | 155 | if ( $wgLanguageSelectorLocation == LANGUAGE_SELECTOR_AT_TOP_OF_TEXT ) { |
156 | | - $html = wfLanguageSelectorHTML(); |
| 156 | + $html = wfLanguageSelectorHTML( $out->getTitle() ); |
157 | 157 | $out->mBodytext = $html . $out->mBodytext; |
158 | 158 | } |
159 | 159 | |
— | — | @@ -171,8 +171,8 @@ |
172 | 172 | return true; |
173 | 173 | } |
174 | 174 | |
175 | | -function wfLanguageSelectorSkinHook( &$out ) { |
176 | | - $html = wfLanguageSelectorHTML(); |
| 175 | +function wfLanguageSelectorSkinHook( &$skin ) { |
| 176 | + $html = wfLanguageSelectorHTML( $skin->mTitle ); |
177 | 177 | print $html; |
178 | 178 | return true; |
179 | 179 | } |
— | — | @@ -213,7 +213,7 @@ |
214 | 214 | # So that this also works with parser cache |
215 | 215 | $parser->getOutput()->addOutputHook( 'languageselector' ); |
216 | 216 | |
217 | | - return wfLanguageSelectorHTML( $style, $class, $selectorstyle, $buttonstyle, $showcode ); |
| 217 | + return wfLanguageSelectorHTML( $parser->getTitle(), $style, $class, $selectorstyle, $buttonstyle, $showcode ); |
218 | 218 | } |
219 | 219 | |
220 | 220 | function wfLanguageSelectorSkinTemplateOutputPageBeforeExec( &$skin, &$tpl ) { |
— | — | @@ -247,7 +247,7 @@ |
248 | 248 | } |
249 | 249 | |
250 | 250 | if ($key) { |
251 | | - $html = wfLanguageSelectorHTML(); |
| 251 | + $html = wfLanguageSelectorHTML( $wgTitle ); |
252 | 252 | $tpl->set( $key, $tpl->data[ $key ] . $html ); |
253 | 253 | } |
254 | 254 | |
— | — | @@ -344,8 +344,8 @@ |
345 | 345 | $wgLanguageSelectorFormUsed = true; |
346 | 346 | } |
347 | 347 | |
348 | | -function wfLanguageSelectorHTML( $style = null, $class = null, $selectorstyle = null, $buttonstyle = null, $showCode = null ) { |
349 | | - global $wgLanguageSelectorLanguages, $wgTitle, $wgLang, $wgContLang, $wgScript, |
| 348 | +function wfLanguageSelectorHTML( Title $title, $style = null, $class = null, $selectorstyle = null, $buttonstyle = null, $showCode = null ) { |
| 349 | + global $wgLanguageSelectorLanguages, $wgLang, $wgContLang, $wgScript, |
350 | 350 | $wgLanguageSelectorShowCode, $wgLanguageSelectorFormUsed; |
351 | 351 | |
352 | 352 | if ( $showCode === null ) { |
— | — | @@ -371,7 +371,7 @@ |
372 | 372 | 'action' => $wgScript, |
373 | 373 | 'style' => 'display:inline;' |
374 | 374 | ) ); |
375 | | - $html .= Xml::hidden( 'title', $wgTitle->getPrefixedDBKey() ); |
| 375 | + $html .= Xml::hidden( 'title', $title->getPrefixedDBKey() ); |
376 | 376 | $html .= Xml::openElement('select', array( |
377 | 377 | 'name' => 'setlang', |
378 | 378 | 'id' => 'languageselector-select-' . $id, |