Index: trunk/extensions/SemanticMaps/includes/queryprinters/SM_MapPrinter.php |
— | — | @@ -285,18 +285,33 @@ |
286 | 286 | * @param array $queryLocations |
287 | 287 | */ |
288 | 288 | protected function handleMarkerData( array &$params, array $queryLocations ) { |
289 | | - global $wgTitle; |
| 289 | + global $wgParser; |
290 | 290 | |
291 | | - $parser = new Parser(); |
| 291 | + $parserClone = clone $wgParser; |
292 | 292 | $iconUrl = MapsMapper::getFileUrl( $params['icon'] ); |
293 | 293 | $params['locations'] = array(); |
294 | 294 | |
295 | | - foreach ( array_merge( $params['staticlocations'], $queryLocations ) as $location ) { |
| 295 | + foreach ( $params['staticlocations'] as $location ) { |
296 | 296 | if ( $location->isValid() ) { |
297 | 297 | $jsonObj = $location->getJSONObject( $params['title'], $params['label'], $iconUrl ); |
298 | 298 | |
| 299 | + $jsonObj['title'] = $parserClone->parse( $jsonObj['title'], $parserClone->getTitle(), new ParserOptions() )->getText(); |
| 300 | + $jsonObj['text'] = $parserClone->parse( $jsonObj['text'], $parserClone->getTitle(), new ParserOptions() )->getText(); |
| 301 | + |
| 302 | + $hasTitleAndtext = $jsonObj['title'] != '' && $jsonObj['text'] != ''; |
| 303 | + $jsonObj['text'] = ( $hasTitleAndtext ? '<b>' . $jsonObj['title'] . '</b><hr />' : $jsonObj['title'] ) . $jsonObj['text']; |
299 | 304 | $jsonObj['title'] = strip_tags( $jsonObj['title'] ); |
300 | 305 | |
| 306 | + $params['locations'][] = $jsonObj; |
| 307 | + } |
| 308 | + } |
| 309 | + |
| 310 | + foreach ( $queryLocations as $location ) { |
| 311 | + if ( $location->isValid() ) { |
| 312 | + $jsonObj = $location->getJSONObject( $params['title'], $params['label'], $iconUrl ); |
| 313 | + |
| 314 | + $jsonObj['title'] = strip_tags( $jsonObj['title'] ); |
| 315 | + |
301 | 316 | $params['locations'][] = $jsonObj; |
302 | 317 | } |
303 | 318 | } |