Index: trunk/extensions/Translate/tag/PageTranslationHooks.php |
— | — | @@ -210,12 +210,14 @@ |
211 | 211 | |
212 | 212 | $options = $parser->getOptions(); |
213 | 213 | |
214 | | - $sk = $options->getSkin(); |
| 214 | + // Backward compat for MediaWiki 1.17 |
215 | 215 | if ( method_exists( $options, 'getUserLang' ) ) { |
216 | 216 | $userLangCode = $options->getUserLang(); |
| 217 | + $sk = $options->getSkin(); |
217 | 218 | } else { |
218 | 219 | global $wgLang; |
219 | 220 | $userLangCode = $wgLang->getCode(); |
| 221 | + $sk = false; |
220 | 222 | } |
221 | 223 | |
222 | 224 | $languages = array(); |
— | — | @@ -247,9 +249,19 @@ |
248 | 250 | if ( $parser->getTitle()->getText() === $_title->getText() ) { |
249 | 251 | $languages[] = Html::rawElement( 'b', null, "*$name* $percent" ); |
250 | 252 | } elseif ( $code === $userLangCode ) { |
251 | | - $languages[] = $sk->linkKnown( $_title, Html::rawElement( 'b', null, "$name $percent" ) ); |
| 253 | + // Backward compat for MediaWiki 1.17 |
| 254 | + if( $sk ) { |
| 255 | + $languages[] = $sk->linkKnown( $_title, Html::rawElement( 'b', null, "$name $percent" ) ); |
| 256 | + } else { |
| 257 | + $languages[] = Linker::linkKnown( $_title, Html::rawElement( 'b', null, "$name $percent" ) ); |
| 258 | + } |
252 | 259 | } else { |
253 | | - $languages[] = $sk->linkKnown( $_title, "$name $percent" ); |
| 260 | + // Backward compat for MediaWiki 1.17 |
| 261 | + if( $sk ) { |
| 262 | + $languages[] = $sk->linkKnown( $_title, "$name $percent" ); |
| 263 | + } else { |
| 264 | + $languages[] = Linker::linkKnown( $_title, "$name $percent" ); |
| 265 | + } |
254 | 266 | } |
255 | 267 | } |
256 | 268 | |