Index: trunk/extensions/SemanticMaps/includes/queryprinters/SM_MapPrinter.php |
— | — | @@ -243,14 +243,14 @@ |
244 | 244 | * @since 0.7 |
245 | 245 | */ |
246 | 246 | protected function addStaticLocations() { |
247 | | - global $wgTitle; |
| 247 | + global $wgParser; |
248 | 248 | |
249 | 249 | // New parser object to render popup contents with. |
250 | | - $parser = new Parser(); |
| 250 | + $parser = clone $wgParser; |
| 251 | + |
| 252 | + $this->title = $parser->parse( $this->title, $parser->getTitle(), new ParserOptions() )->getText(); |
| 253 | + $this->label = $parser->parse( $this->label, $parser->getTitle(), new ParserOptions() )->getText(); |
251 | 254 | |
252 | | - $this->title = $parser->parse( $this->title, $wgTitle, new ParserOptions() )->getText(); |
253 | | - $this->label = $parser->parse( $this->label, $wgTitle, new ParserOptions() )->getText(); |
254 | | - |
255 | 255 | // Each $location is an array containg the coordinate set as first element, possibly followed by meta data. |
256 | 256 | foreach ( $this->staticlocations as $location ) { |
257 | 257 | $markerData = MapsCoordinateParser::parseCoordinates( array_shift( $location ) ); |
— | — | @@ -261,11 +261,11 @@ |
262 | 262 | |
263 | 263 | if ( count( $location ) > 0 ) { |
264 | 264 | // Parse and add the point specific title if it's present. |
265 | | - $markerData['title'] = $parser->parse( $location[0], $wgTitle, new ParserOptions() )->getText(); |
| 265 | + $markerData['title'] = $parser->parse( $location[0], $parser->getTitle(), new ParserOptions() )->getText(); |
266 | 266 | |
267 | 267 | if ( count( $location ) > 1 ) { |
268 | 268 | // Parse and add the point specific label if it's present. |
269 | | - $markerData['label'] = $parser->parse( $location[1], $wgTitle, new ParserOptions() )->getText(); |
| 269 | + $markerData['label'] = $parser->parse( $location[1], $parser->getTitle(), new ParserOptions() )->getText(); |
270 | 270 | |
271 | 271 | if ( count( $location ) > 2 ) { |
272 | 272 | // Add the point specific icon if it's present. |
— | — | @@ -307,7 +307,7 @@ |
308 | 308 | * @param array $row The record you want to add data from |
309 | 309 | */ |
310 | 310 | protected function addResultRow( $outputmode, array $row ) { |
311 | | - global $wgUser, $smgUseSpatialExtensions, $wgTitle; |
| 311 | + global $wgUser, $smgUseSpatialExtensions; |
312 | 312 | |
313 | 313 | $skin = $wgUser->getSkin(); |
314 | 314 | |
— | — | @@ -354,7 +354,8 @@ |
355 | 355 | |
356 | 356 | if ( $this->template ) { |
357 | 357 | // New parser object to render the templates with. |
358 | | - $parser = new Parser(); |
| 358 | + global $wgParser; |
| 359 | + $parser = clone $wgParser; |
359 | 360 | } |
360 | 361 | |
361 | 362 | foreach ( $coords as $coord ) { |
— | — | @@ -375,7 +376,7 @@ |
376 | 377 | $label |
377 | 378 | ); |
378 | 379 | |
379 | | - $text = $parser->parse( '{{' . implode( '|', $segments ) . '}}', $wgTitle, new ParserOptions() )->getText(); |
| 380 | + $text = $parser->parse( '{{' . implode( '|', $segments ) . '}}', $parser->getTitle(), new ParserOptions() )->getText(); |
380 | 381 | } |
381 | 382 | |
382 | 383 | $this->locations[] = array( |