Index: trunk/extensions/SemanticMaps/Features/QueryPrinters/SM_MapPrinter.php |
— | — | @@ -249,7 +249,7 @@ |
250 | 250 | * @param array $row The record you want to add data from |
251 | 251 | */ |
252 | 252 | private function addResultRow( $outputmode, array $row ) { |
253 | | - global $wgUser, $smgUseSpatialExtensions; |
| 253 | + global $wgUser, $smgUseSpatialExtensions, $wgTitle; |
254 | 254 | |
255 | 255 | $skin = $wgUser->getSkin(); |
256 | 256 | |
— | — | @@ -292,6 +292,11 @@ |
293 | 293 | } |
294 | 294 | } |
295 | 295 | |
| 296 | + if ( $this->template ) { |
| 297 | + // New parser object to render the templates with. |
| 298 | + $parser = new Parser(); |
| 299 | + } |
| 300 | + |
296 | 301 | foreach ( $coords as $coord ) { |
297 | 302 | if ( count( $coord ) >= 2 ) { |
298 | 303 | if ( $smgUseSpatialExtensions ) { |
— | — | @@ -305,14 +310,13 @@ |
306 | 311 | $icon = $this->getLocationIcon( $row ); |
307 | 312 | |
308 | 313 | if ( $this->template ) { |
309 | | - global $wgParser; |
310 | | - |
311 | 314 | $segments = array_merge( |
312 | 315 | array( $this->template, 'title=' . $titleForTemplate, 'latitude=' . $lat, 'longitude=' . $lon ), |
313 | 316 | $label |
314 | 317 | ); |
315 | 318 | |
316 | | - $text = preg_replace( '/\n+/m', '<br />', $wgParser->recursiveTagParse( '{{' . implode( '|', $segments ) . '}}' ) ); |
| 319 | + |
| 320 | + $text = $parser->parse( '{{' . implode( '|', $segments ) . '}}', $wgTitle, new ParserOptions() )->getText(); |
317 | 321 | } |
318 | 322 | |
319 | 323 | $this->locations[] = array( |
— | — | @@ -340,7 +344,7 @@ |
341 | 345 | |
342 | 346 | // Look for display_options field, which can be set by Semantic Compound Queries |
343 | 347 | // the location of this field changed in SMW 1.5 |
344 | | - $display_location = method_exists( $row[0], 'getResultSubject' ) ? $display_location = $row[0]->getResultSubject() : $row[0]; |
| 348 | + $display_location = method_exists( $row[0], 'getResultSubject' ) ? $row[0]->getResultSubject() : $row[0]; |
345 | 349 | |
346 | 350 | if ( property_exists( $display_location, 'display_options' ) && is_array( $display_location->display_options ) ) { |
347 | 351 | $display_options = $display_location->display_options; |