Index: trunk/extensions/Maps/ParserFunctions/Coordinates/Maps_Coordinates.php |
— | — | @@ -1,10 +1,9 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | /** |
5 | | - * This file contains registration |
| 5 | + * This file contains registration for the #coordinates parser function, |
| 6 | + * which can transform the notation of a set of coordinates. |
6 | 7 | * |
7 | | - * |
8 | | - * |
9 | 8 | * @file Maps_Coordinates.php |
10 | 9 | * @ingroup Maps |
11 | 10 | * |
— | — | @@ -37,6 +36,7 @@ |
38 | 37 | return true; |
39 | 38 | } |
40 | 39 | |
| 40 | +// TODO: add coordinate validation |
41 | 41 | function efMapsRenderCoordinates() { |
42 | 42 | global $egMapsAvailableServices, $egMapsAvailableGeoServices, $egMapsAvailableCoordNotations; |
43 | 43 | global $egMapsDefaultServices, $egMapsDefaultGeoService, $egMapsCoordinateNotation; |
— | — | @@ -74,6 +74,9 @@ |
75 | 75 | 'criteria' => array( |
76 | 76 | 'in_array' => $egMapsAvailableCoordNotations |
77 | 77 | ), |
| 78 | + 'aliases' => array( |
| 79 | + 'format' |
| 80 | + ), |
78 | 81 | 'default' => $egMapsCoordinateNotation |
79 | 82 | ), |
80 | 83 | 'directional' => array( |
— | — | @@ -92,13 +95,15 @@ |
93 | 96 | $parsedCoords = MapsCoordinateParser::parseCoordinates( $parameters['location'] ); |
94 | 97 | |
95 | 98 | if ( $parsedCoords ) { |
96 | | - return MapsCoordinateParser::formatCoordinates( $parsedCoords, $parameters['notation'], $parameters['directional'] ) . |
97 | | - $manager->getErrorList(); |
| 99 | + $output = MapsCoordinateParser::formatCoordinates( $parsedCoords, $parameters['notation'], $parameters['directional'] ) . |
| 100 | + '<br />' . $manager->getErrorList(); |
98 | 101 | } else { |
99 | | - return htmlspecialchars( wfMsgExt( 'maps-invalid-coordinates', 'parsemag', $parameters['location'] ) ) . |
100 | | - $manager->getErrorList(); |
| 102 | + $output = htmlspecialchars( wfMsgExt( 'maps-invalid-coordinates', 'parsemag', $parameters['location'] ) ) . |
| 103 | + '<br />' . $manager->getErrorList(); |
101 | 104 | } |
102 | 105 | } else { |
103 | | - return $manager->getErrorList(); |
104 | | - } |
| 106 | + $output = $manager->getErrorList(); |
| 107 | + } |
| 108 | + |
| 109 | + return array( $output, 'noparse' => true, 'isHTML' => true ); |
105 | 110 | } |
\ No newline at end of file |